diff options
Diffstat (limited to 'include/forward_list')
-rw-r--r-- | include/forward_list | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/include/forward_list b/include/forward_list index 61fe290d9e2f..19f748478f5d 100644 --- a/include/forward_list +++ b/include/forward_list @@ -174,6 +174,8 @@ template <class T, class Allocator> #include <iterator> #include <algorithm> +#include <__undef_min_max> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif @@ -770,8 +772,8 @@ forward_list<_Tp, _Alloc>::forward_list(size_type __n) if (__n > 0) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(nullptr, _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1)); for (__node_pointer __p = base::__before_begin(); __n > 0; --__n, __p = __p->__next_) { @@ -846,8 +848,8 @@ forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x, { if (base::__alloc() != __x.__alloc()) { - typedef move_iterator<iterator> _I; - insert_after(cbefore_begin(), _I(__x.begin()), _I(__x.end())); + typedef move_iterator<iterator> _Ip; + insert_after(cbefore_begin(), _Ip(__x.begin()), _Ip(__x.end())); } } @@ -904,8 +906,8 @@ forward_list<_Tp, _Alloc>::__move_assign(forward_list& __x, false_type) __move_assign(__x, true_type()); else { - typedef move_iterator<iterator> _I; - assign(_I(__x.begin()), _I(__x.end())); + typedef move_iterator<iterator> _Ip; + assign(_Ip(__x.begin()), _Ip(__x.end())); } } @@ -993,8 +995,8 @@ void forward_list<_Tp, _Alloc>::emplace_front(_Args&&... __args) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...); __h->__next_ = base::__before_begin()->__next_; @@ -1008,8 +1010,8 @@ void forward_list<_Tp, _Alloc>::push_front(value_type&& __v) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v)); __h->__next_ = base::__before_begin()->__next_; base::__before_begin()->__next_ = __h.release(); @@ -1022,8 +1024,8 @@ void forward_list<_Tp, _Alloc>::push_front(const value_type& __v) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v); __h->__next_ = base::__before_begin()->__next_; base::__before_begin()->__next_ = __h.release(); @@ -1050,8 +1052,8 @@ forward_list<_Tp, _Alloc>::emplace_after(const_iterator __p, _Args&&... __args) { __node_pointer const __r = const_cast<__node_pointer>(__p.__ptr_); __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...); __h->__next_ = __r->__next_; @@ -1067,8 +1069,8 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v) { __node_pointer const __r = const_cast<__node_pointer>(__p.__ptr_); __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), _VSTD::move(__v)); __h->__next_ = __r->__next_; __r->__next_ = __h.release(); @@ -1083,8 +1085,8 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, const value_type& __ { __node_pointer const __r = const_cast<__node_pointer>(__p.__ptr_); __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v); __h->__next_ = __r->__next_; __r->__next_ = __h.release(); @@ -1100,8 +1102,8 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, size_type __n, if (__n > 0) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), __v); __node_pointer __first = __h.release(); __node_pointer __last = __first; @@ -1150,8 +1152,8 @@ forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, if (__f != __l) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(__node_traits::allocate(__a, 1), _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(__node_traits::allocate(__a, 1), _Dp(__a, 1)); __node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f); __node_pointer __first = __h.release(); __node_pointer __last = __first; @@ -1242,8 +1244,8 @@ forward_list<_Tp, _Alloc>::resize(size_type __n) if (__n > 0) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(nullptr, _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1)); for (__node_pointer __ptr = __p.__ptr_; __n > 0; --__n, __ptr = __ptr->__next_) { @@ -1274,8 +1276,8 @@ forward_list<_Tp, _Alloc>::resize(size_type __n, const value_type& __v) if (__n > 0) { __node_allocator& __a = base::__alloc(); - typedef __allocator_destructor<__node_allocator> _D; - unique_ptr<__node, _D> __h(nullptr, _D(__a, 1)); + typedef __allocator_destructor<__node_allocator> _Dp; + unique_ptr<__node, _Dp> __h(nullptr, _Dp(__a, 1)); for (__node_pointer __ptr = __p.__ptr_; __n > 0; --__n, __ptr = __ptr->__next_) { @@ -1567,12 +1569,12 @@ template <class _Tp, class _Alloc> bool operator==(const forward_list<_Tp, _Alloc>& __x, const forward_list<_Tp, _Alloc>& __y) { - typedef forward_list<_Tp, _Alloc> _C; - typedef typename _C::const_iterator _I; - _I __ix = __x.begin(); - _I __ex = __x.end(); - _I __iy = __y.begin(); - _I __ey = __y.end(); + typedef forward_list<_Tp, _Alloc> _Cp; + typedef typename _Cp::const_iterator _Ip; + _Ip __ix = __x.begin(); + _Ip __ex = __x.end(); + _Ip __iy = __y.begin(); + _Ip __ey = __y.end(); for (; __ix != __ex && __iy != __ey; ++__ix, ++__iy) if (!(*__ix == *__iy)) return false; |