From 70bbcae9b58b021b9c353b580886561136cc1935 Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Sat, 30 Jul 2011 00:06:52 +0000 Subject: [PATCH] Oops. That last commit was from an earlier revision of the file and was more than just a bit broken. This one should compile and run without infinite loops. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@136545 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/ext/slist | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/include/ext/slist b/include/ext/slist index a7703e47..ef115b3d 100644 --- a/include/ext/slist +++ b/include/ext/slist @@ -58,15 +58,15 @@ public: slist(size_type __n) : __base_type(__n) { } _LIBCPP_INLINE_VISIBILITY slist(size_type __n, const _Tp& __t) : __base_type(__n, __t) { } - _LIBCPP_INLINE_VISIBILITY template + _LIBCPP_INLINE_VISIBILITY slist(_InputIterator __f, _InputIterator __l) : __base_type(__f, __l) { } _LIBCPP_INLINE_VISIBILITY - void swap (slist& __s) { __base_type::swap(s); } + void swap (slist& __s) { __base_type::swap(__s); } _LIBCPP_INLINE_VISIBILITY - void merge (slist& __s) { __base_type::merge(s); } + void merge (slist& __s) { __base_type::merge(__s); } _LIBCPP_INLINE_VISIBILITY friend bool operator==(const slist& __l, const slist& __r) @@ -88,22 +88,22 @@ public: const_iterator previous(const_iterator __pos); _LIBCPP_INLINE_VISIBILITY - iterator insert(iterator __pos, const _Tp& __x) { return insert(previous(__pos), __x); } - _LIBCPP_INLINE_VISIBILITY + iterator insert(iterator __pos, const _Tp& __x) { return insert_after(previous(__pos), __x); } template - void insert(iterator __pos, _InputIterator __f, _InputIterator __l) { return insert(previous(__pos), __f, __l); } _LIBCPP_INLINE_VISIBILITY - void insert(iterator __pos, size_type __n, const _Tp& __x) { return insert(previous(__pos), __n, __x); } + void insert(iterator __pos, _InputIterator __f, _InputIterator __l) { return insert_after(previous(__pos), __f, __l); } + _LIBCPP_INLINE_VISIBILITY + void insert(iterator __pos, size_type __n, const _Tp& __x) { return insert_after(previous(__pos), __n, __x); } _LIBCPP_INLINE_VISIBILITY - iterator erase(iterator __pos) { return erase(previous(__pos)); } + iterator erase(iterator __pos) { return erase_after(previous(__pos)); } _LIBCPP_INLINE_VISIBILITY - iterator erase(iterator __f, iterator __l) { return erase(previous(__f), previous(__l)); } + iterator erase(iterator __f, iterator __l) { return erase_after(previous(__f), previous(__l)); } }; template inline _LIBCPP_INLINE_VISIBILITY -slist<_Tp, _Alloc>::iterator slist<_Tp, _Alloc>::previous(iterator __pos) +typename slist<_Tp, _Alloc>::iterator slist<_Tp, _Alloc>::previous(iterator __pos) { iterator __a = begin(), __b = end(); while (__a != __pos) @@ -116,7 +116,7 @@ slist<_Tp, _Alloc>::iterator slist<_Tp, _Alloc>::previous(iterator __pos) template inline _LIBCPP_INLINE_VISIBILITY -slist<_Tp, _Alloc>::const_iterator slist<_Tp, _Alloc>::previous(const_iterator __pos) +typename slist<_Tp, _Alloc>::const_iterator slist<_Tp, _Alloc>::previous(const_iterator __pos) { iterator __a = begin(), __b = end(); while (__a != __pos) @@ -126,3 +126,7 @@ slist<_Tp, _Alloc>::const_iterator slist<_Tp, _Alloc>::previous(const_iterator _ } return __b; } + +} + +#endif