aboutsummaryrefslogtreecommitdiff
path: root/List.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'List.hpp')
-rw-r--r--List.hpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/List.hpp b/List.hpp
index 8f13d02..72d24d2 100644
--- a/List.hpp
+++ b/List.hpp
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/01 09:31:07 by cacharle #+# #+# */
-/* Updated: 2020/04/26 12:50:59 by charles ### ########.fr */
+/* Updated: 2020/04/27 11:24:58 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -328,6 +328,25 @@ namespace ft
m_size = 0;
}
+ void splice(iterator position, List& x)
+ {
+ for (iterator it = x.begin(); it != x.end(); ++it)
+ insert(position, *it);
+ clear(x);
+ }
+
+ void splice(iterator position, List& x, iterator i)
+ {
+ insert(position, *i);
+ x.erase(i);
+ }
+
+ void splice(iterator position, List& x, iterator first, iterator last)
+ {
+ insert(position, first, last);
+ x.erase(first, last);
+ }
+
void remove(const value_type& val) { remove_if(EqualPredicate(val)); }
template <typename Predicate>