From c98b797c38a14d545ca339ef66256459909da09a Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 27 Apr 2020 14:01:11 +0200 Subject: Added ReverseIterator --- List.hpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'List.hpp') diff --git a/List.hpp b/List.hpp index 8f13d02..72d24d2 100644 --- a/List.hpp +++ b/List.hpp @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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 -- cgit