diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -394,40 +394,35 @@ } } - template - _LIBCPP_CONSTEXPR_AFTER_CXX17 - vector(_InputIterator __first, - typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_InputIterator>::reference>::value, - _InputIterator>::type __last); - template - _LIBCPP_CONSTEXPR_AFTER_CXX17 - vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a, - typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_InputIterator>::reference>::value>::type* = 0); - template - _LIBCPP_CONSTEXPR_AFTER_CXX17 - vector(_ForwardIterator __first, - typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_ForwardIterator>::reference>::value, - _ForwardIterator>::type __last); - template - _LIBCPP_CONSTEXPR_AFTER_CXX17 - vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a, - typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0); - - _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI - ~vector() - { + template ::value && + is_constructible::reference>::value, + int> = 0> + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 vector(_InputIterator __first, _InputIterator __last); + + template ::value && + is_constructible::reference>::value, + int> = 0> + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 + vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a); + + template < + class _ForwardIterator, + __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value && + is_constructible::reference>::value, + int> = 0> + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 vector(_ForwardIterator __first, _ForwardIterator __last); + + template < + class _ForwardIterator, + __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value && + is_constructible::reference>::value, + int> = 0> + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 + vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a); + + _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI ~vector() { __annotate_delete(); std::__debug_db_erase_c(this); @@ -469,25 +464,18 @@ vector& operator=(vector&& __x) _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)); - template - _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if <__is_exactly_cpp17_input_iterator<_InputIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_InputIterator>::reference>::value, - void - >::type - assign(_InputIterator __first, _InputIterator __last); - template - _LIBCPP_CONSTEXPR_AFTER_CXX17 - typename enable_if - < - __is_cpp17_forward_iterator<_ForwardIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_ForwardIterator>::reference>::value, - void - >::type - assign(_ForwardIterator __first, _ForwardIterator __last); + template ::value && + is_constructible::reference>::value, + int> = 0> + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void assign(_InputIterator __first, _InputIterator __last); + + template < + class _ForwardIterator, + __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value && + is_constructible::reference>::value, + int> = 0> + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void assign(_ForwardIterator __first, _ForwardIterator __last); _LIBCPP_CONSTEXPR_AFTER_CXX17 void assign(size_type __n, const_reference __u); @@ -600,26 +588,22 @@ template _LIBCPP_CONSTEXPR_AFTER_CXX17 iterator emplace(const_iterator __position, _Args&&... __args); - _LIBCPP_CONSTEXPR_AFTER_CXX17 iterator insert(const_iterator __position, size_type __n, const_reference __x); - template - _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if <__is_exactly_cpp17_input_iterator<_InputIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_InputIterator>::reference>::value, - iterator - >::type - insert(const_iterator __position, _InputIterator __first, _InputIterator __last); - template - _LIBCPP_CONSTEXPR_AFTER_CXX17 - typename enable_if - < - __is_cpp17_forward_iterator<_ForwardIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_ForwardIterator>::reference>::value, - iterator - >::type - insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last); + _LIBCPP_CONSTEXPR_AFTER_CXX17 iterator insert(const_iterator __position, size_type __n, const_reference __x); + + template ::value && + is_constructible< value_type, typename iterator_traits<_InputIterator>::reference>::value, + int> = 0> + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 iterator + insert(const_iterator __position, _InputIterator __first, _InputIterator __last); + + template < + class _ForwardIterator, + __enable_if_t<__is_cpp17_forward_iterator<_ForwardIterator>::value && + is_constructible< value_type, typename iterator_traits<_ForwardIterator>::reference>::value, + int> = 0> + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 iterator + insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last); #ifndef _LIBCPP_CXX03_LANG _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI @@ -691,14 +675,11 @@ _LIBCPP_CONSTEXPR_AFTER_CXX17 void __construct_at_end(size_type __n); _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n, const_reference __x); - template - _LIBCPP_CONSTEXPR_AFTER_CXX17 - typename enable_if - < - __is_cpp17_forward_iterator<_ForwardIterator>::value, - void - >::type - __construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n); + + template ::value> > + _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 void + __construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n); + _LIBCPP_CONSTEXPR_AFTER_CXX17 void __append(size_type __n); _LIBCPP_CONSTEXPR_AFTER_CXX17 void __append(size_type __n, const_reference __x); _LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI @@ -1018,13 +999,8 @@ } template -template -_LIBCPP_CONSTEXPR_AFTER_CXX17 -typename enable_if -< - __is_cpp17_forward_iterator<_ForwardIterator>::value, - void ->::type +template +_LIBCPP_CONSTEXPR_AFTER_CXX17 void vector<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n) { _ConstructTransaction __tx(*this, __n); @@ -1111,14 +1087,11 @@ } template -template +template ::value && + is_constructible<_Tp, typename iterator_traits<_InputIterator>::reference>::value, + int> > _LIBCPP_CONSTEXPR_AFTER_CXX17 -vector<_Tp, _Allocator>::vector(_InputIterator __first, - typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_InputIterator>::reference>::value, - _InputIterator>::type __last) +vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last) { std::__debug_db_insert_c(this); for (; __first != __last; ++__first) @@ -1126,13 +1099,11 @@ } template -template +template ::value && + is_constructible<_Tp, typename iterator_traits<_InputIterator>::reference>::value, + int> > _LIBCPP_CONSTEXPR_AFTER_CXX17 -vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a, - typename enable_if<__is_exactly_cpp17_input_iterator<_InputIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_InputIterator>::reference>::value>::type*) +vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a) : __end_cap_(nullptr, __a) { std::__debug_db_insert_c(this); @@ -1141,14 +1112,11 @@ } template -template +template ::value && + is_constructible<_Tp, typename iterator_traits<_ForwardIterator>::reference>::value, + int> > _LIBCPP_CONSTEXPR_AFTER_CXX17 -vector<_Tp, _Allocator>::vector(_ForwardIterator __first, - typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_ForwardIterator>::reference>::value, - _ForwardIterator>::type __last) +vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last) { std::__debug_db_insert_c(this); size_type __n = static_cast(std::distance(__first, __last)); @@ -1160,13 +1128,11 @@ } template -template +template ::value && + is_constructible<_Tp, typename iterator_traits<_ForwardIterator>::reference>::value, + int> > _LIBCPP_CONSTEXPR_AFTER_CXX17 -vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a, - typename enable_if<__is_cpp17_forward_iterator<_ForwardIterator>::value && - is_constructible< - value_type, - typename iterator_traits<_ForwardIterator>::reference>::value>::type*) +vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a) : __end_cap_(nullptr, __a) { std::__debug_db_insert_c(this); @@ -1335,13 +1301,10 @@ } template -template -_LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if <__is_exactly_cpp17_input_iterator<_InputIterator>::value && - is_constructible< - _Tp, - typename iterator_traits<_InputIterator>::reference>::value, - void ->::type +template ::value && + is_constructible<_Tp, typename iterator_traits<_InputIterator>::reference>::value, + int>> +_LIBCPP_CONSTEXPR_AFTER_CXX17 void vector<_Tp, _Allocator>::assign(_InputIterator __first, _InputIterator __last) { clear(); @@ -1350,16 +1313,10 @@ } template -template -_LIBCPP_CONSTEXPR_AFTER_CXX17 -typename enable_if -< - __is_cpp17_forward_iterator<_ForwardIterator>::value && - is_constructible< - _Tp, - typename iterator_traits<_ForwardIterator>::reference>::value, - void ->::type +template ::value && + is_constructible<_Tp, typename iterator_traits<_ForwardIterator>::reference>::value, + int> > +_LIBCPP_CONSTEXPR_AFTER_CXX17 void vector<_Tp, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last) { size_type __new_size = static_cast(std::distance(__first, __last)); @@ -1811,13 +1768,10 @@ } template -template -_LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if <__is_exactly_cpp17_input_iterator<_InputIterator>::value && - is_constructible< - _Tp, - typename iterator_traits<_InputIterator>::reference>::value, - typename vector<_Tp, _Allocator>::iterator ->::type +template ::value && + is_constructible<_Tp, typename iterator_traits<_InputIterator>::reference>::value, + int> > +_LIBCPP_CONSTEXPR_AFTER_CXX17 typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last) { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__position)) == this, @@ -1859,16 +1813,10 @@ } template -template -_LIBCPP_CONSTEXPR_AFTER_CXX17 -typename enable_if -< - __is_cpp17_forward_iterator<_ForwardIterator>::value && - is_constructible< - _Tp, - typename iterator_traits<_ForwardIterator>::reference>::value, - typename vector<_Tp, _Allocator>::iterator ->::type +template ::value && + is_constructible<_Tp, typename iterator_traits<_ForwardIterator>::reference>::value, + int> > +_LIBCPP_CONSTEXPR_AFTER_CXX17 typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last) { _LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__position)) == this,