aboutsummaryrefslogtreecommitdiff
path: root/List.hpp
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-04-27 14:01:11 +0200
committerCharles <sircharlesaze@gmail.com>2020-04-27 14:01:11 +0200
commitc98b797c38a14d545ca339ef66256459909da09a (patch)
treee27df1d943332176b15b8b5a5f0a10918af0f26d /List.hpp
parente3e4d37195f8dba4dc8a1671c19bfd5707c014d2 (diff)
downloadft_containers-master.tar.gz
ft_containers-master.tar.bz2
ft_containers-master.zip
Added ReverseIteratorHEADmaster
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>