summaryrefslogtreecommitdiffstats
path: root/libcxx/include/forward_list
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/forward_list')
-rw-r--r--libcxx/include/forward_list72
1 files changed, 41 insertions, 31 deletions
diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index 9e68dfd4749..b23981ec7e9 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -355,10 +355,10 @@ protected:
__forward_list_base(const allocator_type& __a)
: __before_begin_(__begin_node(), __node_allocator(__a)) {}
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__forward_list_base(__forward_list_base&& __x);
__forward_list_base(__forward_list_base&& __x, const allocator_type& __a);
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
private:
__forward_list_base(const __forward_list_base&);
@@ -405,7 +405,7 @@ private:
}
};
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Alloc>
inline
@@ -428,7 +428,7 @@ __forward_list_base<_Tp, _Alloc>::__forward_list_base(__forward_list_base&& __x,
}
}
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Alloc>
__forward_list_base<_Tp, _Alloc>::~__forward_list_base()
@@ -498,17 +498,17 @@ public:
>::type* = nullptr);
forward_list(const forward_list& __x);
forward_list(const forward_list& __x, const allocator_type& __a);
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
forward_list(forward_list&& __x) : base(_STD::move(__x)) {}
forward_list(forward_list&& __x, const allocator_type& __a);
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
forward_list(initializer_list<value_type> __il);
forward_list(initializer_list<value_type> __il, const allocator_type& __a);
// ~forward_list() = default;
forward_list& operator=(const forward_list& __x);
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
forward_list& operator=(forward_list&& __x);
#endif
forward_list& operator=(initializer_list<value_type> __il);
@@ -543,19 +543,23 @@ public:
reference front() {return base::__before_begin()->__next_->__value_;}
const_reference front() const {return base::__before_begin()->__next_->__value_;}
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args> void emplace_front(_Args&&... __args);
+#endif
void push_front(value_type&& __v);
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void push_front(const value_type& __v);
void pop_front();
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class... _Args>
iterator emplace_after(const_iterator __p, _Args&&... __args);
+#endif // _LIBCPP_HAS_NO_VARIADICS
iterator insert_after(const_iterator __p, value_type&& __v);
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
iterator insert_after(const_iterator __p, const value_type& __v);
iterator insert_after(const_iterator __p, size_type __n, const value_type& __v);
template <class _InputIterator>
@@ -577,28 +581,28 @@ public:
void resize(size_type __n, const value_type& __v);
void clear() {base::clear();}
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
void splice_after(const_iterator __p, forward_list&& __x);
void splice_after(const_iterator __p, forward_list&& __x, const_iterator __i);
void splice_after(const_iterator __p, forward_list&& __x,
const_iterator __f, const_iterator __l);
-#else // _LIBCPP_MOVE
+#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void splice_after(const_iterator __p, forward_list& __x);
void splice_after(const_iterator __p, forward_list& __x, const_iterator __i);
void splice_after(const_iterator __p, forward_list& __x,
const_iterator __f, const_iterator __l);
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void remove(const value_type& __v);
template <class _Predicate> void remove_if(_Predicate __pred);
void unique() {unique(__equal_to<value_type>());}
template <class _BinaryPredicate> void unique(_BinaryPredicate __binary_pred);
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
void merge(forward_list&& __x) {merge(_STD::move(__x), __less<value_type>());}
template <class _Compare> void merge(forward_list&& __x, _Compare __comp);
-#else // _LIBCPP_MOVE
+#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void merge(forward_list& __x) {merge(__x, __less<value_type>());}
template <class _Compare> void merge(forward_list& __x, _Compare __comp);
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void sort() {sort(__less<value_type>());}
template <class _Compare> void sort(_Compare __comp);
void reverse();
@@ -609,10 +613,10 @@ private:
typedef typename base::__node_traits __node_traits;
typedef typename base::__node_pointer __node_pointer;
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
void __move_assign(forward_list& __x, true_type);
void __move_assign(forward_list& __x, false_type);
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Compare>
static
@@ -705,7 +709,7 @@ forward_list<_Tp, _Alloc>::forward_list(const forward_list& __x,
insert_after(cbefore_begin(), __x.begin(), __x.end());
}
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Alloc>
forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
@@ -719,7 +723,7 @@ forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
}
}
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Alloc>
forward_list<_Tp, _Alloc>::forward_list(initializer_list<value_type> __il)
@@ -747,7 +751,7 @@ forward_list<_Tp, _Alloc>::operator=(const forward_list& __x)
return *this;
}
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Alloc>
void
@@ -782,7 +786,7 @@ forward_list<_Tp, _Alloc>::operator=(forward_list&& __x)
return *this;
}
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Alloc>
inline
@@ -836,7 +840,8 @@ forward_list<_Tp, _Alloc>::assign(initializer_list<value_type> __il)
assign(__il.begin(), __il.end());
}
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _Tp, class _Alloc>
template <class... _Args>
@@ -852,6 +857,8 @@ forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
base::__before_begin()->__next_ = __h.release();
}
+#endif // _LIBCPP_HAS_NO_VARIADICS
+
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::push_front(value_type&& __v)
@@ -864,7 +871,7 @@ forward_list<_Tp, _Alloc>::push_front(value_type&& __v)
base::__before_begin()->__next_ = __h.release();
}
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Alloc>
void
@@ -889,7 +896,8 @@ forward_list<_Tp, _Alloc>::pop_front()
__node_traits::deallocate(__a, __p, 1);
}
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _Tp, class _Alloc>
template <class... _Args>
@@ -907,6 +915,8 @@ forward_list<_Tp, _Alloc>::emplace_after(const_iterator __p, _Args&&... __args)
return iterator(__r->__next_);
}
+#endif // _LIBCPP_HAS_NO_VARIADICS
+
template <class _Tp, class _Alloc>
typename forward_list<_Tp, _Alloc>::iterator
forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v)
@@ -921,7 +931,7 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v)
return iterator(__r->__next_);
}
-#endif // _LIBCPP_MOVE
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Alloc>
typename forward_list<_Tp, _Alloc>::iterator
@@ -1137,7 +1147,7 @@ forward_list<_Tp, _Alloc>::resize(size_type __n, const value_type& __v)
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
forward_list&& __x)
#else
forward_list& __x)
@@ -1162,7 +1172,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
forward_list&& __x,
#else
forward_list& __x,
@@ -1184,7 +1194,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
template <class _Tp, class _Alloc>
void
forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
forward_list&& __x,
#else
forward_list& __x,
@@ -1272,7 +1282,7 @@ forward_list<_Tp, _Alloc>::unique(_BinaryPredicate __binary_pred)
template <class _Tp, class _Alloc>
template <class _Compare>
void
-#ifdef _LIBCPP_MOVE
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
forward_list<_Tp, _Alloc>::merge(forward_list&& __x, _Compare __comp)
#else
forward_list<_Tp, _Alloc>::merge(forward_list& __x, _Compare __comp)
OpenPOWER on IntegriCloud