[libc++][NFC] Refactor enable_ifs in defaulted arguments to defaulted template arguments
This brings most of the enable_ifs in libc++ to the same style. It also has the nice side-effect of reducing the size of names of these symbols, since the arguments don't get mangled anymore. Reviewed By: #libc, Mordante Spies: Mordante, libcxx-commits Differential Revision: https://reviews.llvm.org/D157748
This commit is contained in:
parent
fc06cce30d
commit
4da76ea70a
@ -234,28 +234,20 @@ public:
|
||||
_LIBCPP_HIDE_FROM_ABI duration() {}
|
||||
#endif
|
||||
|
||||
template <class _Rep2>
|
||||
template <class _Rep2, __enable_if_t<is_convertible<const _Rep2&, rep>::value &&
|
||||
(treat_as_floating_point<rep>::value ||
|
||||
!treat_as_floating_point<_Rep2>::value), int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
explicit duration(const _Rep2& __r,
|
||||
typename enable_if
|
||||
<
|
||||
is_convertible<const _Rep2&, rep>::value &&
|
||||
(treat_as_floating_point<rep>::value ||
|
||||
!treat_as_floating_point<_Rep2>::value)
|
||||
>::type* = nullptr)
|
||||
explicit duration(const _Rep2& __r)
|
||||
: __rep_(__r) {}
|
||||
|
||||
// conversions
|
||||
template <class _Rep2, class _Period2>
|
||||
template <class _Rep2, class _Period2, __enable_if_t<__no_overflow<_Period2, period>::value && (
|
||||
treat_as_floating_point<rep>::value ||
|
||||
(__no_overflow<_Period2, period>::type::den == 1 &&
|
||||
!treat_as_floating_point<_Rep2>::value)), int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
duration(const duration<_Rep2, _Period2>& __d,
|
||||
typename enable_if
|
||||
<
|
||||
__no_overflow<_Period2, period>::value && (
|
||||
treat_as_floating_point<rep>::value ||
|
||||
(__no_overflow<_Period2, period>::type::den == 1 &&
|
||||
!treat_as_floating_point<_Rep2>::value))
|
||||
>::type* = nullptr)
|
||||
duration(const duration<_Rep2, _Period2>& __d)
|
||||
: __rep_(chrono::duration_cast<duration>(__d).count()) {}
|
||||
|
||||
// observer
|
||||
|
||||
@ -49,13 +49,9 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit time_point(const duration& __d) : __d_(__d) {}
|
||||
|
||||
// conversions
|
||||
template <class _Duration2>
|
||||
template <class _Duration2, __enable_if_t<is_convertible<_Duration2, duration>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
|
||||
time_point(const time_point<clock, _Duration2>& __t,
|
||||
typename enable_if
|
||||
<
|
||||
is_convertible<_Duration2, duration>::value
|
||||
>::type* = nullptr)
|
||||
time_point(const time_point<clock, _Duration2>& __t)
|
||||
: __d_(__t.time_since_epoch()) {}
|
||||
|
||||
// observer
|
||||
|
||||
@ -45,9 +45,8 @@ public:
|
||||
: __i_()
|
||||
{
|
||||
}
|
||||
template <class _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
|
||||
__wrap_iter(const __wrap_iter<_Up>& __u,
|
||||
typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = nullptr) _NOEXCEPT
|
||||
template <class _Up, __enable_if_t<is_convertible<_Up, iterator_type>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter(const __wrap_iter<_Up>& __u) _NOEXCEPT
|
||||
: __i_(__u.base())
|
||||
{
|
||||
}
|
||||
|
||||
@ -1624,20 +1624,22 @@ private:
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR weak_ptr() _NOEXCEPT;
|
||||
template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(shared_ptr<_Yp> const& __r,
|
||||
typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0)
|
||||
_NOEXCEPT;
|
||||
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY weak_ptr(shared_ptr<_Yp> const& __r) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
weak_ptr(weak_ptr const& __r) _NOEXCEPT;
|
||||
template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp> const& __r,
|
||||
typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0)
|
||||
_NOEXCEPT;
|
||||
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp> const& __r) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
weak_ptr(weak_ptr&& __r) _NOEXCEPT;
|
||||
template<class _Yp> _LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r,
|
||||
typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type = 0)
|
||||
_NOEXCEPT;
|
||||
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY weak_ptr(weak_ptr<_Yp>&& __r) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI ~weak_ptr();
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@ -1706,10 +1708,9 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr const& __r) _NOEXCEPT
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
template<class _Yp>
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
|
||||
inline
|
||||
weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r,
|
||||
typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type)
|
||||
weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r)
|
||||
_NOEXCEPT
|
||||
: __ptr_(__r.__ptr_),
|
||||
__cntrl_(__r.__cntrl_)
|
||||
@ -1719,10 +1720,9 @@ weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r,
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
template<class _Yp>
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
|
||||
inline
|
||||
weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r,
|
||||
typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type)
|
||||
weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r)
|
||||
_NOEXCEPT
|
||||
: __ptr_(__r.__ptr_),
|
||||
__cntrl_(__r.__cntrl_)
|
||||
@ -1742,10 +1742,9 @@ weak_ptr<_Tp>::weak_ptr(weak_ptr&& __r) _NOEXCEPT
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
template<class _Yp>
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
|
||||
inline
|
||||
weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r,
|
||||
typename enable_if<__compatible_with<_Yp, _Tp>::value, __nat*>::type)
|
||||
weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp>&& __r)
|
||||
_NOEXCEPT
|
||||
: __ptr_(__r.__ptr_),
|
||||
__cntrl_(__r.__cntrl_)
|
||||
|
||||
@ -58,9 +58,9 @@ struct _LIBCPP_TEMPLATE_VIS default_delete {
|
||||
#else
|
||||
_LIBCPP_INLINE_VISIBILITY default_delete() {}
|
||||
#endif
|
||||
template <class _Up>
|
||||
template <class _Up, __enable_if_t<is_convertible<_Up*, _Tp*>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 default_delete(
|
||||
const default_delete<_Up>&, typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
|
||||
const default_delete<_Up>&) _NOEXCEPT {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 void operator()(_Tp* __ptr) const _NOEXCEPT {
|
||||
static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");
|
||||
@ -221,12 +221,10 @@ public:
|
||||
: __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}
|
||||
|
||||
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
|
||||
template <class _Up>
|
||||
template <class _Up, __enable_if_t<is_convertible<_Up*, _Tp*>::value &&
|
||||
is_same<_Dp, default_delete<_Tp> >::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
unique_ptr(auto_ptr<_Up>&& __p,
|
||||
typename enable_if<is_convertible<_Up*, _Tp*>::value &&
|
||||
is_same<_Dp, default_delete<_Tp> >::value,
|
||||
__nat>::type = __nat()) _NOEXCEPT
|
||||
unique_ptr(auto_ptr<_Up>&& __p) _NOEXCEPT
|
||||
: __ptr_(__p.release(), __value_init_tag()) {}
|
||||
#endif
|
||||
|
||||
|
||||
@ -72,11 +72,10 @@ public:
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, discard_block_engine>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit discard_block_engine(_Sseq& __q,
|
||||
typename enable_if<__is_seed_sequence<_Sseq, discard_block_engine>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
|
||||
explicit discard_block_engine(_Sseq& __q)
|
||||
: __e_(__q), __n_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed() {__e_.seed(); __n_ = 0;}
|
||||
|
||||
@ -104,11 +104,10 @@ public:
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, independent_bits_engine>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit independent_bits_engine(_Sseq& __q,
|
||||
typename enable_if<__is_seed_sequence<_Sseq, independent_bits_engine>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
|
||||
explicit independent_bits_engine(_Sseq& __q)
|
||||
: __e_(__q) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed() {__e_.seed();}
|
||||
|
||||
@ -246,10 +246,9 @@ public:
|
||||
seed(__s);
|
||||
}
|
||||
#endif
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, linear_congruential_engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit linear_congruential_engine(_Sseq& __q,
|
||||
typename enable_if<__is_seed_sequence<_Sseq, linear_congruential_engine>::value>::type* = 0)
|
||||
explicit linear_congruential_engine(_Sseq& __q)
|
||||
{seed(__q);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed(result_type __s = default_seed)
|
||||
|
||||
@ -135,10 +135,9 @@ public:
|
||||
seed(__sd);
|
||||
}
|
||||
#endif
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit mersenne_twister_engine(_Sseq& __q,
|
||||
typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0)
|
||||
explicit mersenne_twister_engine(_Sseq& __q)
|
||||
{seed(__q);}
|
||||
_LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed);
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>
|
||||
|
||||
@ -98,11 +98,10 @@ public:
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();}
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, shuffle_order_engine>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit shuffle_order_engine(_Sseq& __q,
|
||||
typename enable_if<__is_seed_sequence<_Sseq, shuffle_order_engine>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
|
||||
explicit shuffle_order_engine(_Sseq& __q)
|
||||
: __e_(__q) {__init();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed() {__e_.seed(); __init();}
|
||||
|
||||
@ -101,10 +101,9 @@ public:
|
||||
seed(__sd);
|
||||
}
|
||||
#endif
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit subtract_with_carry_engine(_Sseq& __q,
|
||||
typename enable_if<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value>::type* = 0)
|
||||
explicit subtract_with_carry_engine(_Sseq& __q)
|
||||
{seed(__q);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed(result_type __sd = default_seed)
|
||||
|
||||
@ -49,9 +49,8 @@ public:
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI error_code(int __val, const error_category& __cat) _NOEXCEPT : __val_(__val), __cat_(&__cat) {}
|
||||
|
||||
template <class _Ep>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
error_code(_Ep __e, typename enable_if<is_error_code_enum<_Ep>::value>::type* = nullptr) _NOEXCEPT {
|
||||
template <class _Ep, __enable_if_t<is_error_code_enum<_Ep>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI error_code(_Ep __e) _NOEXCEPT {
|
||||
using __adl_only::make_error_code;
|
||||
*this = make_error_code(__e);
|
||||
}
|
||||
|
||||
@ -58,9 +58,8 @@ public:
|
||||
: __val_(__val),
|
||||
__cat_(&__cat) {}
|
||||
|
||||
template <class _Ep>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
error_condition(_Ep __e, typename enable_if<is_error_condition_enum<_Ep>::value>::type* = nullptr) _NOEXCEPT {
|
||||
template <class _Ep, __enable_if_t<is_error_condition_enum<_Ep>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI error_condition(_Ep __e) _NOEXCEPT {
|
||||
using __adl_only::make_error_condition;
|
||||
*this = make_error_condition(__e);
|
||||
}
|
||||
|
||||
@ -284,10 +284,9 @@ public:
|
||||
#endif
|
||||
{}
|
||||
|
||||
template <class _Pp, class _Rp, class _MP>
|
||||
template <class _Pp, class _Rp, class _MP, __enable_if_t<is_convertible<_Pp, pointer>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
__deque_iterator(const __deque_iterator<value_type, _Pp, _Rp, _MP, difference_type, _BS>& __it,
|
||||
typename enable_if<is_convertible<_Pp, pointer>::value>::type* = 0) _NOEXCEPT
|
||||
__deque_iterator(const __deque_iterator<value_type, _Pp, _Rp, _MP, difference_type, _BS>& __it) _NOEXCEPT
|
||||
: __m_iter_(__it.__m_iter_), __ptr_(__it.__ptr_) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI reference operator*() const {return *__ptr_;}
|
||||
@ -614,12 +613,10 @@ public:
|
||||
__append(__n, __v);
|
||||
}
|
||||
|
||||
template <class _InputIter>
|
||||
_LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l,
|
||||
typename enable_if<__has_input_iterator_category<_InputIter>::value>::type* = 0);
|
||||
template <class _InputIter>
|
||||
_LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l, const allocator_type& __a,
|
||||
typename enable_if<__has_input_iterator_category<_InputIter>::value>::type* = 0);
|
||||
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l);
|
||||
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l, const allocator_type& __a);
|
||||
|
||||
#if _LIBCPP_STD_VER >= 23
|
||||
template <_ContainerCompatibleRange<_Tp> _Range>
|
||||
@ -662,13 +659,11 @@ public:
|
||||
void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
template <class _InputIter>
|
||||
_LIBCPP_HIDE_FROM_ABI void assign(_InputIter __f, _InputIter __l,
|
||||
typename enable_if<__has_input_iterator_category<_InputIter>::value &&
|
||||
!__has_random_access_iterator_category<_InputIter>::value>::type* = 0);
|
||||
template <class _RAIter>
|
||||
_LIBCPP_HIDE_FROM_ABI void assign(_RAIter __f, _RAIter __l,
|
||||
typename enable_if<__has_random_access_iterator_category<_RAIter>::value>::type* = 0);
|
||||
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value &&
|
||||
!__has_random_access_iterator_category<_InputIter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI void assign(_InputIter __f, _InputIter __l);
|
||||
template <class _RAIter, __enable_if_t<__has_random_access_iterator_category<_RAIter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI void assign(_RAIter __f, _RAIter __l);
|
||||
|
||||
#if _LIBCPP_STD_VER >= 23
|
||||
template <_ContainerCompatibleRange<_Tp> _Range>
|
||||
@ -820,15 +815,12 @@ public:
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, const value_type& __v);
|
||||
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, size_type __n, const value_type& __v);
|
||||
template <class _InputIter>
|
||||
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InputIter __f, _InputIter __l,
|
||||
typename enable_if<__has_exactly_input_iterator_category<_InputIter>::value>::type* = 0);
|
||||
template <class _ForwardIterator>
|
||||
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l,
|
||||
typename enable_if<__has_exactly_forward_iterator_category<_ForwardIterator>::value>::type* = 0);
|
||||
template <class _BiIter>
|
||||
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _BiIter __f, _BiIter __l,
|
||||
typename enable_if<__has_bidirectional_iterator_category<_BiIter>::value>::type* = 0);
|
||||
template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _InputIter __f, _InputIter __l);
|
||||
template <class _ForwardIterator, __enable_if_t<__has_exactly_forward_iterator_category<_ForwardIterator>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l);
|
||||
template <class _BiIter, __enable_if_t<__has_bidirectional_iterator_category<_BiIter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI iterator insert(const_iterator __p, _BiIter __f, _BiIter __l);
|
||||
|
||||
#if _LIBCPP_STD_VER >= 23
|
||||
template <_ContainerCompatibleRange<_Tp> _Range>
|
||||
@ -1262,12 +1254,10 @@ public:
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
iterator __insert_bidirectional(const_iterator __p, _BiIter __f, _BiIter __l, size_type __n);
|
||||
|
||||
template <class _InpIter>
|
||||
_LIBCPP_HIDE_FROM_ABI void __append(_InpIter __f, _InpIter __l,
|
||||
typename enable_if<__has_exactly_input_iterator_category<_InpIter>::value>::type* = 0);
|
||||
template <class _ForIter>
|
||||
_LIBCPP_HIDE_FROM_ABI void __append(_ForIter __f, _ForIter __l,
|
||||
typename enable_if<__has_forward_iterator_category<_ForIter>::value>::type* = 0);
|
||||
template <class _InpIter, __enable_if_t<__has_exactly_input_iterator_category<_InpIter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI void __append(_InpIter __f, _InpIter __l);
|
||||
template <class _ForIter, __enable_if_t<__has_forward_iterator_category<_ForIter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI void __append(_ForIter __f, _ForIter __l);
|
||||
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_HIDE_FROM_ABI void __append_with_size(_InputIterator __from, size_type __n);
|
||||
@ -1377,9 +1367,8 @@ deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v)
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _InputIter>
|
||||
deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l,
|
||||
typename enable_if<__has_input_iterator_category<_InputIter>::value>::type*)
|
||||
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> >
|
||||
deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l)
|
||||
: __start_(0), __size_(0, __default_init_tag())
|
||||
{
|
||||
__annotate_new(0);
|
||||
@ -1387,9 +1376,8 @@ deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l,
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _InputIter>
|
||||
deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l, const allocator_type& __a,
|
||||
typename enable_if<__has_input_iterator_category<_InputIter>::value>::type*)
|
||||
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> >
|
||||
deque<_Tp, _Allocator>::deque(_InputIter __f, _InputIter __l, const allocator_type& __a)
|
||||
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a)
|
||||
{
|
||||
__annotate_new(0);
|
||||
@ -1514,11 +1502,10 @@ deque<_Tp, _Allocator>::__move_assign(deque& __c, true_type)
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _InputIter>
|
||||
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value &&
|
||||
!__has_random_access_iterator_category<_InputIter>::value, int> >
|
||||
void
|
||||
deque<_Tp, _Allocator>::assign(_InputIter __f, _InputIter __l,
|
||||
typename enable_if<__has_input_iterator_category<_InputIter>::value &&
|
||||
!__has_random_access_iterator_category<_InputIter>::value>::type*)
|
||||
deque<_Tp, _Allocator>::assign(_InputIter __f, _InputIter __l)
|
||||
{
|
||||
__assign_with_sentinel(__f, __l);
|
||||
}
|
||||
@ -1538,10 +1525,9 @@ void deque<_Tp, _Allocator>::__assign_with_sentinel(_Iterator __f, _Sentinel __l
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _RAIter>
|
||||
template <class _RAIter, __enable_if_t<__has_random_access_iterator_category<_RAIter>::value, int> >
|
||||
void
|
||||
deque<_Tp, _Allocator>::assign(_RAIter __f, _RAIter __l,
|
||||
typename enable_if<__has_random_access_iterator_category<_RAIter>::value>::type*)
|
||||
deque<_Tp, _Allocator>::assign(_RAIter __f, _RAIter __l)
|
||||
{
|
||||
__assign_with_size_random_access(__f, __l - __f);
|
||||
}
|
||||
@ -2064,10 +2050,9 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _InputIter>
|
||||
template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> >
|
||||
typename deque<_Tp, _Allocator>::iterator
|
||||
deque<_Tp, _Allocator>::insert(const_iterator __p, _InputIter __f, _InputIter __l,
|
||||
typename enable_if<__has_exactly_input_iterator_category<_InputIter>::value>::type*)
|
||||
deque<_Tp, _Allocator>::insert(const_iterator __p, _InputIter __f, _InputIter __l)
|
||||
{
|
||||
return __insert_with_sentinel(__p, __f, __l);
|
||||
}
|
||||
@ -2084,10 +2069,9 @@ deque<_Tp, _Allocator>::__insert_with_sentinel(const_iterator __p, _Iterator __f
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _ForwardIterator>
|
||||
template <class _ForwardIterator, __enable_if_t<__has_exactly_forward_iterator_category<_ForwardIterator>::value, int> >
|
||||
typename deque<_Tp, _Allocator>::iterator
|
||||
deque<_Tp, _Allocator>::insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l,
|
||||
typename enable_if<__has_exactly_forward_iterator_category<_ForwardIterator>::value>::type*)
|
||||
deque<_Tp, _Allocator>::insert(const_iterator __p, _ForwardIterator __f, _ForwardIterator __l)
|
||||
{
|
||||
return __insert_with_size(__p, __f, std::distance(__f, __l));
|
||||
}
|
||||
@ -2104,10 +2088,9 @@ deque<_Tp, _Allocator>::__insert_with_size(const_iterator __p, _Iterator __f, si
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _BiIter>
|
||||
template <class _BiIter, __enable_if_t<__has_bidirectional_iterator_category<_BiIter>::value, int> >
|
||||
typename deque<_Tp, _Allocator>::iterator
|
||||
deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
|
||||
typename enable_if<__has_bidirectional_iterator_category<_BiIter>::value>::type*)
|
||||
deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l)
|
||||
{
|
||||
return __insert_bidirectional(__p, __f, __l, std::distance(__f, __l));
|
||||
}
|
||||
@ -2190,10 +2173,9 @@ deque<_Tp, _Allocator>::__insert_bidirectional(const_iterator __p, _BiIter __f,
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _InpIter>
|
||||
template <class _InpIter, __enable_if_t<__has_exactly_input_iterator_category<_InpIter>::value, int> >
|
||||
void
|
||||
deque<_Tp, _Allocator>::__append(_InpIter __f, _InpIter __l,
|
||||
typename enable_if<__has_exactly_input_iterator_category<_InpIter>::value>::type*)
|
||||
deque<_Tp, _Allocator>::__append(_InpIter __f, _InpIter __l)
|
||||
{
|
||||
__append_with_sentinel(__f, __l);
|
||||
}
|
||||
@ -2211,10 +2193,9 @@ void deque<_Tp, _Allocator>::__append_with_sentinel(_InputIterator __f, _Sentine
|
||||
}
|
||||
|
||||
template <class _Tp, class _Allocator>
|
||||
template <class _ForIter>
|
||||
template <class _ForIter, __enable_if_t<__has_forward_iterator_category<_ForIter>::value, int> >
|
||||
void
|
||||
deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l,
|
||||
typename enable_if<__has_forward_iterator_category<_ForIter>::value>::type*)
|
||||
deque<_Tp, _Allocator>::__append(_ForIter __f, _ForIter __l)
|
||||
{
|
||||
__append_with_size(__f, std::distance(__f, __l));
|
||||
}
|
||||
|
||||
@ -2142,18 +2142,14 @@ public:
|
||||
#endif
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(size_type __n, const value_type& __v);
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(size_type __n, const value_type& __v, const allocator_type& __a);
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_InputIterator __first, _InputIterator __last,
|
||||
typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value>::type* = 0);
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
|
||||
typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value>::type* = 0);
|
||||
template <class _ForwardIterator>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_ForwardIterator __first, _ForwardIterator __last,
|
||||
typename enable_if<__has_forward_iterator_category<_ForwardIterator>::value>::type* = 0);
|
||||
template <class _ForwardIterator>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
|
||||
typename enable_if<__has_forward_iterator_category<_ForwardIterator>::value>::type* = 0);
|
||||
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_InputIterator __first, _InputIterator __last);
|
||||
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
|
||||
template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_ForwardIterator __first, _ForwardIterator __last);
|
||||
template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a);
|
||||
|
||||
#if _LIBCPP_STD_VER >= 23
|
||||
template <_ContainerCompatibleRange<bool> _Range>
|
||||
@ -2685,10 +2681,9 @@ vector<bool, _Allocator>::vector(size_type __n, const value_type& __x, const all
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
template <class _InputIterator>
|
||||
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> >
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
|
||||
typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value>::type*)
|
||||
vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last)
|
||||
: __begin_(nullptr),
|
||||
__size_(0),
|
||||
__cap_alloc_(0, __default_init_tag())
|
||||
@ -2697,10 +2692,9 @@ vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
template <class _InputIterator>
|
||||
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> >
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a,
|
||||
typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value>::type*)
|
||||
vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a)
|
||||
: __begin_(nullptr),
|
||||
__size_(0),
|
||||
__cap_alloc_(0, static_cast<__storage_allocator>(__a))
|
||||
@ -2709,10 +2703,9 @@ vector<bool, _Allocator>::vector(_InputIterator __first, _InputIterator __last,
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
template <class _ForwardIterator>
|
||||
template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last,
|
||||
typename enable_if<__has_forward_iterator_category<_ForwardIterator>::value>::type*)
|
||||
vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last)
|
||||
: __begin_(nullptr),
|
||||
__size_(0),
|
||||
__cap_alloc_(0, __default_init_tag())
|
||||
@ -2722,10 +2715,9 @@ vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __la
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
template <class _ForwardIterator>
|
||||
template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a,
|
||||
typename enable_if<__has_forward_iterator_category<_ForwardIterator>::value>::type*)
|
||||
vector<bool, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a)
|
||||
: __begin_(nullptr),
|
||||
__size_(0),
|
||||
__cap_alloc_(0, static_cast<__storage_allocator>(__a))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user