mirror of
https://github.com/intel/llvm.git
synced 2026-02-06 06:31:50 +08:00
[libc++][NFC] Refactor return type enable_ifs 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 depedent return type is shorter. Reviewed By: #libc, ldionne Spies: ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D157736
This commit is contained in:
@@ -21,14 +21,11 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template<class _InputIterator, class _Size, class _OutputIterator>
|
||||
template<class _InputIterator, class _Size, class _OutputIterator,
|
||||
__enable_if_t<__has_input_iterator_category<_InputIterator>::value &&
|
||||
!__has_random_access_iterator_category<_InputIterator>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename enable_if
|
||||
<
|
||||
__has_input_iterator_category<_InputIterator>::value &&
|
||||
!__has_random_access_iterator_category<_InputIterator>::value,
|
||||
_OutputIterator
|
||||
>::type
|
||||
_OutputIterator
|
||||
copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
|
||||
{
|
||||
typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
|
||||
@@ -47,13 +44,10 @@ copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
|
||||
return __result;
|
||||
}
|
||||
|
||||
template<class _InputIterator, class _Size, class _OutputIterator>
|
||||
template<class _InputIterator, class _Size, class _OutputIterator,
|
||||
__enable_if_t<__has_random_access_iterator_category<_InputIterator>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename enable_if
|
||||
<
|
||||
__has_random_access_iterator_category<_InputIterator>::value,
|
||||
_OutputIterator
|
||||
>::type
|
||||
_OutputIterator
|
||||
copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result)
|
||||
{
|
||||
typedef typename iterator_traits<_InputIterator>::difference_type difference_type;
|
||||
|
||||
@@ -22,25 +22,17 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
// Perform division by two quickly for positive integers (llvm.org/PR39129)
|
||||
|
||||
template <typename _Integral>
|
||||
template <typename _Integral, __enable_if_t<is_integral<_Integral>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Integral>::value,
|
||||
_Integral
|
||||
>::type
|
||||
_Integral
|
||||
__half_positive(_Integral __value)
|
||||
{
|
||||
return static_cast<_Integral>(static_cast<__make_unsigned_t<_Integral> >(__value) / 2);
|
||||
}
|
||||
|
||||
template <typename _Tp>
|
||||
template <typename _Tp, __enable_if_t<!is_integral<_Tp>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
!is_integral<_Tp>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
__half_positive(_Tp __value)
|
||||
{
|
||||
return __value / 2;
|
||||
|
||||
@@ -505,25 +505,17 @@ _Tp atomic_fetch_sub_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::difference
|
||||
|
||||
// atomic_fetch_and
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_and(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_and(__op);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_and(__op);
|
||||
@@ -531,25 +523,17 @@ atomic_fetch_and(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXC
|
||||
|
||||
// atomic_fetch_and_explicit
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_and(__op, __m);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_and(__op, __m);
|
||||
@@ -557,25 +541,17 @@ atomic_fetch_and_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __o
|
||||
|
||||
// atomic_fetch_or
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_or(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_or(__op);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_or(__op);
|
||||
@@ -583,25 +559,17 @@ atomic_fetch_or(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCE
|
||||
|
||||
// atomic_fetch_or_explicit
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_or(__op, __m);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_or(__op, __m);
|
||||
@@ -609,25 +577,17 @@ atomic_fetch_or_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op
|
||||
|
||||
// atomic_fetch_xor
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_xor(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_xor(__op);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_xor(__op);
|
||||
@@ -635,25 +595,17 @@ atomic_fetch_xor(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op) _NOEXC
|
||||
|
||||
// atomic_fetch_xor_explicit
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_xor(__op, __m);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value && !is_same<_Tp, bool>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
|
||||
_Tp
|
||||
>::type
|
||||
_Tp
|
||||
atomic_fetch_xor_explicit(atomic<_Tp>* __o, typename atomic<_Tp>::value_type __op, memory_order __m) _NOEXCEPT
|
||||
{
|
||||
return __o->fetch_xor(__op, __m);
|
||||
|
||||
@@ -32,14 +32,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
// [atomics.types.generic]p1 guarantees _Tp is trivially copyable. Because
|
||||
// the default operator= in an object is not volatile, a byte-by-byte copy
|
||||
// is required.
|
||||
template <typename _Tp, typename _Tv> _LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
|
||||
__cxx_atomic_assign_volatile(_Tp& __a_value, _Tv const& __val) {
|
||||
template <typename _Tp, typename _Tv, __enable_if_t<is_assignable<_Tp&, _Tv>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI
|
||||
void __cxx_atomic_assign_volatile(_Tp& __a_value, _Tv const& __val) {
|
||||
__a_value = __val;
|
||||
}
|
||||
template <typename _Tp, typename _Tv> _LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if<is_assignable<_Tp&, _Tv>::value>::type
|
||||
__cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val) {
|
||||
template <typename _Tp, typename _Tv, __enable_if_t<is_assignable<_Tp&, _Tv>::value, int> = 0> _LIBCPP_HIDE_FROM_ABI
|
||||
void __cxx_atomic_assign_volatile(_Tp volatile& __a_value, _Tv volatile const& __val) {
|
||||
volatile char* __to = reinterpret_cast<volatile char*>(std::addressof(__a_value));
|
||||
volatile char* __end = __to + sizeof(_Tp);
|
||||
volatile const char* __from = reinterpret_cast<volatile const char*>(std::addressof(__val));
|
||||
|
||||
@@ -116,14 +116,10 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false>
|
||||
}
|
||||
};
|
||||
|
||||
template <class _ToDuration, class _Rep, class _Period>
|
||||
template <class _ToDuration, class _Rep, class _Period, __enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
__is_duration<_ToDuration>::value,
|
||||
_ToDuration
|
||||
>::type
|
||||
_ToDuration
|
||||
duration_cast(const duration<_Rep, _Period>& __fd)
|
||||
{
|
||||
return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
|
||||
@@ -147,13 +143,9 @@ public:
|
||||
};
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17
|
||||
template <class _ToDuration, class _Rep, class _Period>
|
||||
template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
__is_duration<_ToDuration>::value,
|
||||
_ToDuration
|
||||
>::type
|
||||
_ToDuration
|
||||
floor(const duration<_Rep, _Period>& __d)
|
||||
{
|
||||
_ToDuration __t = chrono::duration_cast<_ToDuration>(__d);
|
||||
@@ -162,13 +154,9 @@ floor(const duration<_Rep, _Period>& __d)
|
||||
return __t;
|
||||
}
|
||||
|
||||
template <class _ToDuration, class _Rep, class _Period>
|
||||
template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
__is_duration<_ToDuration>::value,
|
||||
_ToDuration
|
||||
>::type
|
||||
_ToDuration
|
||||
ceil(const duration<_Rep, _Period>& __d)
|
||||
{
|
||||
_ToDuration __t = chrono::duration_cast<_ToDuration>(__d);
|
||||
@@ -177,13 +165,9 @@ ceil(const duration<_Rep, _Period>& __d)
|
||||
return __t;
|
||||
}
|
||||
|
||||
template <class _ToDuration, class _Rep, class _Period>
|
||||
template <class _ToDuration, class _Rep, class _Period, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
__is_duration<_ToDuration>::value,
|
||||
_ToDuration
|
||||
>::type
|
||||
_ToDuration
|
||||
round(const duration<_Rep, _Period>& __d)
|
||||
{
|
||||
_ToDuration __lower = chrono::floor<_ToDuration>(__d);
|
||||
@@ -462,14 +446,11 @@ operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
|
||||
|
||||
// Duration *
|
||||
|
||||
template <class _Rep1, class _Period, class _Rep2>
|
||||
template <class _Rep1, class _Period, class _Rep2,
|
||||
__enable_if_t<is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
|
||||
duration<typename common_type<_Rep1, _Rep2>::type, _Period>
|
||||
>::type
|
||||
duration<typename common_type<_Rep1, _Rep2>::type, _Period>
|
||||
operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
||||
{
|
||||
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
||||
@@ -477,14 +458,11 @@ operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
||||
return _Cd(_Cd(__d).count() * static_cast<_Cr>(__s));
|
||||
}
|
||||
|
||||
template <class _Rep1, class _Period, class _Rep2>
|
||||
template <class _Rep1, class _Period, class _Rep2,
|
||||
__enable_if_t<is_convertible<_Rep1, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
is_convertible<_Rep1, typename common_type<_Rep1, _Rep2>::type>::value,
|
||||
duration<typename common_type<_Rep1, _Rep2>::type, _Period>
|
||||
>::type
|
||||
duration<typename common_type<_Rep1, _Rep2>::type, _Period>
|
||||
operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d)
|
||||
{
|
||||
return __d * __s;
|
||||
@@ -492,15 +470,11 @@ operator*(const _Rep1& __s, const duration<_Rep2, _Period>& __d)
|
||||
|
||||
// Duration /
|
||||
|
||||
template <class _Rep1, class _Period, class _Rep2>
|
||||
template <class _Rep1, class _Period, class _Rep2,
|
||||
__enable_if_t<!__is_duration<_Rep2>::value && is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
!__is_duration<_Rep2>::value &&
|
||||
is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
|
||||
duration<typename common_type<_Rep1, _Rep2>::type, _Period>
|
||||
>::type
|
||||
duration<typename common_type<_Rep1, _Rep2>::type, _Period>
|
||||
operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
||||
{
|
||||
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
||||
@@ -520,15 +494,11 @@ operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
|
||||
|
||||
// Duration %
|
||||
|
||||
template <class _Rep1, class _Period, class _Rep2>
|
||||
template <class _Rep1, class _Period, class _Rep2,
|
||||
__enable_if_t<!__is_duration<_Rep2>::value && is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
!__is_duration<_Rep2>::value &&
|
||||
is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
|
||||
duration<typename common_type<_Rep1, _Rep2>::type, _Period>
|
||||
>::type
|
||||
duration<typename common_type<_Rep1, _Rep2>::type, _Period>
|
||||
operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
||||
{
|
||||
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
||||
|
||||
@@ -93,49 +93,33 @@ time_point_cast(const time_point<_Clock, _Duration>& __t)
|
||||
}
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17
|
||||
template <class _ToDuration, class _Clock, class _Duration>
|
||||
template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
__is_duration<_ToDuration>::value,
|
||||
time_point<_Clock, _ToDuration>
|
||||
>::type
|
||||
time_point<_Clock, _ToDuration>
|
||||
floor(const time_point<_Clock, _Duration>& __t)
|
||||
{
|
||||
return time_point<_Clock, _ToDuration>{chrono::floor<_ToDuration>(__t.time_since_epoch())};
|
||||
}
|
||||
|
||||
template <class _ToDuration, class _Clock, class _Duration>
|
||||
template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
__is_duration<_ToDuration>::value,
|
||||
time_point<_Clock, _ToDuration>
|
||||
>::type
|
||||
time_point<_Clock, _ToDuration>
|
||||
ceil(const time_point<_Clock, _Duration>& __t)
|
||||
{
|
||||
return time_point<_Clock, _ToDuration>{chrono::ceil<_ToDuration>(__t.time_since_epoch())};
|
||||
}
|
||||
|
||||
template <class _ToDuration, class _Clock, class _Duration>
|
||||
template <class _ToDuration, class _Clock, class _Duration, enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
__is_duration<_ToDuration>::value,
|
||||
time_point<_Clock, _ToDuration>
|
||||
>::type
|
||||
time_point<_Clock, _ToDuration>
|
||||
round(const time_point<_Clock, _Duration>& __t)
|
||||
{
|
||||
return time_point<_Clock, _ToDuration>{chrono::round<_ToDuration>(__t.time_since_epoch())};
|
||||
}
|
||||
|
||||
template <class _Rep, class _Period>
|
||||
template <class _Rep, class _Period, enable_if_t<numeric_limits<_Rep>::is_signed, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
typename enable_if
|
||||
<
|
||||
numeric_limits<_Rep>::is_signed,
|
||||
duration<_Rep, _Period>
|
||||
>::type
|
||||
duration<_Rep, _Period>
|
||||
abs(duration<_Rep, _Period> __d)
|
||||
{
|
||||
return __d >= __d.zero() ? +__d : -__d;
|
||||
|
||||
@@ -76,9 +76,9 @@ struct __can_convert_char<char32_t> {
|
||||
using __char_type = char32_t;
|
||||
};
|
||||
|
||||
template <class _ECharT>
|
||||
template <class _ECharT, __enable_if_t<__can_convert_char<_ECharT>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if<__can_convert_char<_ECharT>::value, bool>::type
|
||||
bool
|
||||
__is_separator(_ECharT __e) {
|
||||
#if defined(_LIBCPP_WIN32API)
|
||||
return __e == _ECharT('/') || __e == _ECharT('\\');
|
||||
@@ -305,17 +305,17 @@ struct _PathCVT {
|
||||
template <>
|
||||
struct _PathCVT<__path_value> {
|
||||
|
||||
template <class _Iter>
|
||||
template <class _Iter, __enable_if_t<__has_exactly_input_iterator_category<_Iter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static typename enable_if<__has_exactly_input_iterator_category<_Iter>::value>::type
|
||||
static void
|
||||
__append_range(__path_string& __dest, _Iter __b, _Iter __e) {
|
||||
for (; __b != __e; ++__b)
|
||||
__dest.push_back(*__b);
|
||||
}
|
||||
|
||||
template <class _Iter>
|
||||
template <class _Iter, __enable_if_t<__has_forward_iterator_category<_Iter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static typename enable_if<__has_forward_iterator_category<_Iter>::value>::type
|
||||
static void
|
||||
__append_range(__path_string& __dest, _Iter __b, _Iter __e) {
|
||||
__dest.append(__b, __e);
|
||||
}
|
||||
@@ -350,17 +350,17 @@ struct _PathCVT<char> {
|
||||
__char_to_wide(__str, const_cast<__path_value*>(__dest.data()) + __pos, __size);
|
||||
}
|
||||
|
||||
template <class _Iter>
|
||||
template <class _Iter, __enable_if_t<__has_exactly_input_iterator_category<_Iter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static typename enable_if<__has_exactly_input_iterator_category<_Iter>::value>::type
|
||||
static void
|
||||
__append_range(__path_string& __dest, _Iter __b, _Iter __e) {
|
||||
basic_string<char> __tmp(__b, __e);
|
||||
__append_string(__dest, __tmp);
|
||||
}
|
||||
|
||||
template <class _Iter>
|
||||
template <class _Iter, __enable_if_t<__has_forward_iterator_category<_Iter>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static typename enable_if<__has_forward_iterator_category<_Iter>::value>::type
|
||||
static void
|
||||
__append_range(__path_string& __dest, _Iter __b, _Iter __e) {
|
||||
basic_string<char> __tmp(__b, __e);
|
||||
__append_string(__dest, __tmp);
|
||||
@@ -678,9 +678,9 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class _ECharT>
|
||||
template <class _ECharT, __enable_if_t<__can_convert_char<_ECharT>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename enable_if<__can_convert_char<_ECharT>::value, path&>::type
|
||||
path&
|
||||
operator+=(_ECharT __x) {
|
||||
_PathCVT<_ECharT>::__append_source(__pn_,
|
||||
basic_string_view<_ECharT>(&__x, 1));
|
||||
@@ -1040,21 +1040,19 @@ public:
|
||||
iterator end() const;
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
|
||||
template <class _CharT, class _Traits>
|
||||
template <class _CharT, class _Traits, __enable_if_t<is_same<_CharT, value_type>::value &&
|
||||
is_same<_Traits, char_traits<value_type> >::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI friend
|
||||
typename enable_if<is_same<_CharT, value_type>::value &&
|
||||
is_same<_Traits, char_traits<value_type> >::value,
|
||||
basic_ostream<_CharT, _Traits>&>::type
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
|
||||
__os << _VSTD::__quoted(__p.native());
|
||||
return __os;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
template <class _CharT, class _Traits, __enable_if_t<!is_same<_CharT, value_type>::value ||
|
||||
!is_same<_Traits, char_traits<value_type> >::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI friend
|
||||
typename enable_if<!is_same<_CharT, value_type>::value ||
|
||||
!is_same<_Traits, char_traits<value_type> >::value,
|
||||
basic_ostream<_CharT, _Traits>&>::type
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const path& __p) {
|
||||
__os << _VSTD::__quoted(__p.string<_CharT, _Traits>());
|
||||
return __os;
|
||||
|
||||
@@ -32,9 +32,9 @@ _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
|
||||
|
||||
_LIBCPP_AVAILABILITY_FILESYSTEM_LIBRARY_PUSH
|
||||
|
||||
template <class _InputIt>
|
||||
template <class _InputIt, __enable_if_t<__is_pathable<_InputIt>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
|
||||
typename enable_if<__is_pathable<_InputIt>::value, path>::type
|
||||
path
|
||||
u8path(_InputIt __f, _InputIt __l) {
|
||||
static_assert(
|
||||
#ifndef _LIBCPP_HAS_NO_CHAR8_T
|
||||
@@ -56,9 +56,9 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
|
||||
}
|
||||
|
||||
#if defined(_LIBCPP_WIN32API)
|
||||
template <class _InputIt>
|
||||
template <class _InputIt, __enable_if_t<__is_pathable<_InputIt>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
|
||||
typename enable_if<__is_pathable<_InputIt>::value, path>::type
|
||||
path
|
||||
u8path(_InputIt __f, _NullSentinel) {
|
||||
static_assert(
|
||||
#ifndef _LIBCPP_HAS_NO_CHAR8_T
|
||||
@@ -79,9 +79,9 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
|
||||
}
|
||||
#endif /* _LIBCPP_WIN32API */
|
||||
|
||||
template <class _Source>
|
||||
template <class _Source, __enable_if_t<__is_pathable<_Source>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
|
||||
typename enable_if<__is_pathable<_Source>::value, path>::type
|
||||
path
|
||||
u8path(const _Source& __s) {
|
||||
static_assert(
|
||||
#ifndef _LIBCPP_HAS_NO_CHAR8_T
|
||||
|
||||
@@ -120,28 +120,20 @@ struct __mu_return2<true, _Ti, _Uj>
|
||||
typedef typename tuple_element<is_placeholder<_Ti>::value - 1, _Uj>::type type;
|
||||
};
|
||||
|
||||
template <class _Ti, class _Uj>
|
||||
template <class _Ti, class _Uj, __enable_if_t<0 < is_placeholder<_Ti>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename enable_if
|
||||
<
|
||||
0 < is_placeholder<_Ti>::value,
|
||||
typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
|
||||
>::type
|
||||
typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
|
||||
__mu(_Ti&, _Uj& __uj)
|
||||
{
|
||||
const size_t __indx = is_placeholder<_Ti>::value - 1;
|
||||
return _VSTD::forward<typename tuple_element<__indx, _Uj>::type>(_VSTD::get<__indx>(__uj));
|
||||
}
|
||||
|
||||
template <class _Ti, class _Uj>
|
||||
template <class _Ti, class _Uj, __enable_if_t<!is_bind_expression<_Ti>::value &&
|
||||
is_placeholder<_Ti>::value == 0 &&
|
||||
!__is_reference_wrapper<_Ti>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename enable_if
|
||||
<
|
||||
!is_bind_expression<_Ti>::value &&
|
||||
is_placeholder<_Ti>::value == 0 &&
|
||||
!__is_reference_wrapper<_Ti>::value,
|
||||
_Ti&
|
||||
>::type
|
||||
_Ti&
|
||||
__mu(_Ti& __ti, _Uj&)
|
||||
{
|
||||
return __ti;
|
||||
@@ -329,28 +321,20 @@ public:
|
||||
: base(_VSTD::forward<_Gp>(__f),
|
||||
_VSTD::forward<_BA>(__bound_args)...) {}
|
||||
|
||||
template <class ..._Args>
|
||||
template <class ..._Args, __enable_if_t<is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
|
||||
result_type>::value || is_void<_Rp>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename enable_if
|
||||
<
|
||||
is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
|
||||
result_type>::value || is_void<_Rp>::value,
|
||||
result_type
|
||||
>::type
|
||||
result_type
|
||||
operator()(_Args&& ...__args)
|
||||
{
|
||||
typedef __invoke_void_return_wrapper<_Rp> _Invoker;
|
||||
return _Invoker::__call(static_cast<base&>(*this), _VSTD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class ..._Args>
|
||||
template <class ..._Args, __enable_if_t<is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
|
||||
result_type>::value || is_void<_Rp>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename enable_if
|
||||
<
|
||||
is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
|
||||
result_type>::value || is_void<_Rp>::value,
|
||||
result_type
|
||||
>::type
|
||||
result_type
|
||||
operator()(_Args&& ...__args) const
|
||||
{
|
||||
typedef __invoke_void_return_wrapper<_Rp> _Invoker;
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _InputIter>
|
||||
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
|
||||
typename enable_if<__has_input_iterator_category<_InputIter>::value, _InputIter>::type
|
||||
_InputIter
|
||||
next(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1) {
|
||||
_LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
|
||||
"Attempt to next(it, n) with negative n on a non-bidirectional iterator");
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _InputIter>
|
||||
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
|
||||
typename enable_if<__has_input_iterator_category<_InputIter>::value, _InputIter>::type
|
||||
_InputIter
|
||||
prev(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1) {
|
||||
_LIBCPP_ASSERT_UNCATEGORIZED(__n <= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
|
||||
"Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");
|
||||
|
||||
@@ -1642,33 +1642,18 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
weak_ptr& operator=(weak_ptr const& __r) _NOEXCEPT;
|
||||
template<class _Yp>
|
||||
typename enable_if
|
||||
<
|
||||
__compatible_with<_Yp, _Tp>::value,
|
||||
weak_ptr&
|
||||
>::type
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY weak_ptr&
|
||||
operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
weak_ptr& operator=(weak_ptr&& __r) _NOEXCEPT;
|
||||
template<class _Yp>
|
||||
typename enable_if
|
||||
<
|
||||
__compatible_with<_Yp, _Tp>::value,
|
||||
weak_ptr&
|
||||
>::type
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY weak_ptr&
|
||||
operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT;
|
||||
|
||||
template<class _Yp>
|
||||
typename enable_if
|
||||
<
|
||||
__compatible_with<_Yp, _Tp>::value,
|
||||
weak_ptr&
|
||||
>::type
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY weak_ptr&
|
||||
operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -1786,13 +1771,9 @@ weak_ptr<_Tp>::operator=(weak_ptr const& __r) _NOEXCEPT
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
template<class _Yp>
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
|
||||
inline
|
||||
typename enable_if
|
||||
<
|
||||
__compatible_with<_Yp, _Tp>::value,
|
||||
weak_ptr<_Tp>&
|
||||
>::type
|
||||
weak_ptr<_Tp>&
|
||||
weak_ptr<_Tp>::operator=(weak_ptr<_Yp> const& __r) _NOEXCEPT
|
||||
{
|
||||
weak_ptr(__r).swap(*this);
|
||||
@@ -1809,13 +1790,9 @@ weak_ptr<_Tp>::operator=(weak_ptr&& __r) _NOEXCEPT
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
template<class _Yp>
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
|
||||
inline
|
||||
typename enable_if
|
||||
<
|
||||
__compatible_with<_Yp, _Tp>::value,
|
||||
weak_ptr<_Tp>&
|
||||
>::type
|
||||
weak_ptr<_Tp>&
|
||||
weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
|
||||
{
|
||||
weak_ptr(_VSTD::move(__r)).swap(*this);
|
||||
@@ -1823,13 +1800,9 @@ weak_ptr<_Tp>::operator=(weak_ptr<_Yp>&& __r) _NOEXCEPT
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
template<class _Yp>
|
||||
template<class _Yp, __enable_if_t<__compatible_with<_Yp, _Tp>::value, int> >
|
||||
inline
|
||||
typename enable_if
|
||||
<
|
||||
__compatible_with<_Yp, _Tp>::value,
|
||||
weak_ptr<_Tp>&
|
||||
>::type
|
||||
weak_ptr<_Tp>&
|
||||
weak_ptr<_Tp>::operator=(shared_ptr<_Yp> const& __r) _NOEXCEPT
|
||||
{
|
||||
weak_ptr(__r).swap(*this);
|
||||
|
||||
@@ -247,11 +247,10 @@ public:
|
||||
}
|
||||
|
||||
#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
|
||||
typename enable_if<is_convertible<_Up*, _Tp*>::value &&
|
||||
is_same<_Dp, default_delete<_Tp> >::value,
|
||||
unique_ptr&>::type
|
||||
unique_ptr&
|
||||
operator=(auto_ptr<_Up> __p) {
|
||||
reset(__p.release());
|
||||
return *this;
|
||||
@@ -490,10 +489,9 @@ public:
|
||||
return __t;
|
||||
}
|
||||
|
||||
template <class _Pp>
|
||||
template <class _Pp, __enable_if_t<_CheckArrayPointerConversion<_Pp>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
|
||||
typename enable_if< _CheckArrayPointerConversion<_Pp>::value >::type
|
||||
reset(_Pp __p) _NOEXCEPT {
|
||||
void reset(_Pp __p) _NOEXCEPT {
|
||||
pointer __tmp = __ptr_.first();
|
||||
__ptr_.first() = __p;
|
||||
if (__tmp)
|
||||
@@ -512,9 +510,9 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Tp, class _Dp>
|
||||
template <class _Tp, class _Dp, __enable_if_t<__is_swappable<_Dp>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23
|
||||
typename enable_if< __is_swappable<_Dp>::value, void >::type
|
||||
void
|
||||
swap(unique_ptr<_Tp, _Dp>& __x, unique_ptr<_Tp, _Dp>& __y) _NOEXCEPT {
|
||||
__x.swap(__y);
|
||||
}
|
||||
|
||||
@@ -82,13 +82,9 @@ public:
|
||||
void seed() {__e_.seed(); __n_ = 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed(result_type __sd) {__e_.seed(__sd); __n_ = 0;}
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, discard_block_engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, discard_block_engine>::value,
|
||||
void
|
||||
>::type
|
||||
void
|
||||
seed(_Sseq& __q) {__e_.seed(__q); __n_ = 0;}
|
||||
|
||||
// generating functions
|
||||
|
||||
@@ -114,13 +114,9 @@ public:
|
||||
void seed() {__e_.seed();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed(result_type __sd) {__e_.seed(__sd);}
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, independent_bits_engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, independent_bits_engine>::value,
|
||||
void
|
||||
>::type
|
||||
void
|
||||
seed(_Sseq& __q) {__e_.seed(__q);}
|
||||
|
||||
// generating functions
|
||||
@@ -166,24 +162,16 @@ private:
|
||||
result_type __eval(false_type);
|
||||
_LIBCPP_HIDE_FROM_ABI result_type __eval(true_type);
|
||||
|
||||
template <size_t __count>
|
||||
template <size_t __count, __enable_if_t<__count < _Dt, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
typename enable_if
|
||||
<
|
||||
__count < _Dt,
|
||||
result_type
|
||||
>::type
|
||||
result_type
|
||||
__lshift(result_type __x) {return __x << __count;}
|
||||
|
||||
template <size_t __count>
|
||||
template <size_t __count, __enable_if_t<(__count >= _Dt), int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
typename enable_if
|
||||
<
|
||||
(__count >= _Dt),
|
||||
result_type
|
||||
>::type
|
||||
result_type
|
||||
__lshift(result_type) {return result_type(0);}
|
||||
};
|
||||
|
||||
|
||||
@@ -255,13 +255,9 @@ public:
|
||||
void seed(result_type __s = default_seed)
|
||||
{seed(integral_constant<bool, __m == 0>(),
|
||||
integral_constant<bool, __c == 0>(), __s);}
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, linear_congruential_engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, linear_congruential_engine>::value,
|
||||
void
|
||||
>::type
|
||||
void
|
||||
seed(_Sseq& __q)
|
||||
{__seed(__q, integral_constant<unsigned,
|
||||
1 + (__m == 0 ? (sizeof(result_type) * __CHAR_BIT__ - 1)/32
|
||||
|
||||
@@ -141,13 +141,9 @@ public:
|
||||
typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0)
|
||||
{seed(__q);}
|
||||
_LIBCPP_HIDE_FROM_ABI void seed(result_type __sd = default_seed);
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, mersenne_twister_engine>::value,
|
||||
void
|
||||
>::type
|
||||
void
|
||||
seed(_Sseq& __q)
|
||||
{__seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());}
|
||||
|
||||
@@ -202,44 +198,28 @@ private:
|
||||
template<class _Sseq>
|
||||
_LIBCPP_HIDE_FROM_ABI void __seed(_Sseq& __q, integral_constant<unsigned, 2>);
|
||||
|
||||
template <size_t __count>
|
||||
template <size_t __count, __enable_if_t<__count < __w, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
typename enable_if
|
||||
<
|
||||
__count < __w,
|
||||
result_type
|
||||
>::type
|
||||
result_type
|
||||
__lshift(result_type __x) {return (__x << __count) & _Max;}
|
||||
|
||||
template <size_t __count>
|
||||
template <size_t __count, __enable_if_t<(__count >= __w), int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
typename enable_if
|
||||
<
|
||||
(__count >= __w),
|
||||
result_type
|
||||
>::type
|
||||
result_type
|
||||
__lshift(result_type) {return result_type(0);}
|
||||
|
||||
template <size_t __count>
|
||||
template <size_t __count, __enable_if_t<__count < _Dt, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
typename enable_if
|
||||
<
|
||||
__count < _Dt,
|
||||
result_type
|
||||
>::type
|
||||
result_type
|
||||
__rshift(result_type __x) {return __x >> __count;}
|
||||
|
||||
template <size_t __count>
|
||||
template <size_t __count, __enable_if_t<(__count >= _Dt), int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static
|
||||
typename enable_if
|
||||
<
|
||||
(__count >= _Dt),
|
||||
result_type
|
||||
>::type
|
||||
result_type
|
||||
__rshift(result_type) {return result_type(0);}
|
||||
};
|
||||
|
||||
|
||||
@@ -108,13 +108,9 @@ public:
|
||||
void seed() {__e_.seed(); __init();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed(result_type __sd) {__e_.seed(__sd); __init();}
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, shuffle_order_engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, shuffle_order_engine>::value,
|
||||
void
|
||||
>::type
|
||||
void
|
||||
seed(_Sseq& __q) {__e_.seed(__q); __init();}
|
||||
|
||||
// generating functions
|
||||
@@ -174,23 +170,15 @@ private:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
result_type __eval2(true_type) {return __evalf<__k, 0>();}
|
||||
|
||||
template <uint64_t _Np, uint64_t _Dp>
|
||||
template <uint64_t _Np, uint64_t _Dp, __enable_if_t<(__uratio<_Np, _Dp>::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)), int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
(__uratio<_Np, _Dp>::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)),
|
||||
result_type
|
||||
>::type
|
||||
result_type
|
||||
__eval(__uratio<_Np, _Dp>)
|
||||
{return __evalf<__uratio<_Np, _Dp>::num, __uratio<_Np, _Dp>::den>();}
|
||||
|
||||
template <uint64_t _Np, uint64_t _Dp>
|
||||
template <uint64_t _Np, uint64_t _Dp, __enable_if_t<__uratio<_Np, _Dp>::num <= 0xFFFFFFFFFFFFFFFFull / (_Max - _Min), int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__uratio<_Np, _Dp>::num <= 0xFFFFFFFFFFFFFFFFull / (_Max - _Min),
|
||||
result_type
|
||||
>::type
|
||||
result_type
|
||||
__eval(__uratio<_Np, _Dp>)
|
||||
{
|
||||
const size_t __j = static_cast<size_t>(__uratio<_Np, _Dp>::num * (__y_ - _Min)
|
||||
|
||||
@@ -109,13 +109,9 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed(result_type __sd = default_seed)
|
||||
{seed(__sd, integral_constant<unsigned, 1 + (__w - 1) / 32>());}
|
||||
template<class _Sseq>
|
||||
template<class _Sseq, __enable_if_t<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value,
|
||||
void
|
||||
>::type
|
||||
void
|
||||
seed(_Sseq& __q)
|
||||
{__seed(__q, integral_constant<unsigned, 1 + (__w - 1) / 32>());}
|
||||
|
||||
|
||||
@@ -61,9 +61,8 @@ public:
|
||||
__cat_ = &__cat;
|
||||
}
|
||||
|
||||
template <class _Ep>
|
||||
_LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_code_enum<_Ep>::value, error_code& >::type
|
||||
operator=(_Ep __e) _NOEXCEPT {
|
||||
template <class _Ep, __enable_if_t<is_error_code_enum<_Ep>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI error_code& operator=(_Ep __e) _NOEXCEPT {
|
||||
using __adl_only::make_error_code;
|
||||
*this = make_error_code(__e);
|
||||
return *this;
|
||||
|
||||
@@ -70,9 +70,8 @@ public:
|
||||
__cat_ = &__cat;
|
||||
}
|
||||
|
||||
template <class _Ep>
|
||||
_LIBCPP_HIDE_FROM_ABI typename enable_if< is_error_condition_enum<_Ep>::value, error_condition& >::type
|
||||
operator=(_Ep __e) _NOEXCEPT {
|
||||
template <class _Ep, __enable_if_t<is_error_condition_enum<_Ep>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI error_condition& operator=(_Ep __e) _NOEXCEPT {
|
||||
using __adl_only::make_error_condition;
|
||||
*this = make_error_condition(__e);
|
||||
return *this;
|
||||
|
||||
@@ -47,10 +47,9 @@ template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 __swap_result_t<_Tp> swap(_Tp& __x, _Tp& __y)
|
||||
_NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value&& is_nothrow_move_assignable<_Tp>::value);
|
||||
|
||||
template <class _Tp, size_t _Np>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename enable_if<__is_swappable<_Tp>::value>::type swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np])
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value);
|
||||
template <class _Tp, size_t _Np, __enable_if_t<__is_swappable<_Tp>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np])
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value);
|
||||
|
||||
namespace __detail {
|
||||
// ALL generic swap overloads MUST already have a declaration available at this point.
|
||||
|
||||
@@ -39,9 +39,9 @@ long long __convert_to_integral(long long __val) { return __val; }
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
unsigned long long __convert_to_integral(unsigned long long __val) {return __val; }
|
||||
|
||||
template<typename _Fp>
|
||||
template<typename _Fp, __enable_if_t<is_floating_point<_Fp>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
typename enable_if<is_floating_point<_Fp>::value, long long>::type
|
||||
long long
|
||||
__convert_to_integral(_Fp __val) { return __val; }
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_INT128
|
||||
|
||||
@@ -688,14 +688,9 @@ struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> {
|
||||
};
|
||||
#endif // _LIBCPP_STD_VER >= 23
|
||||
|
||||
template <class _T1, class _T2>
|
||||
template <class _T1, class _T2, __enable_if_t<__is_swappable<_T1>::value && __is_swappable<_T2>::value, int> = 0>
|
||||
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename enable_if
|
||||
<
|
||||
__is_swappable<_T1>::value &&
|
||||
__is_swappable<_T2>::value,
|
||||
void
|
||||
>::type
|
||||
void
|
||||
swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
|
||||
_NOEXCEPT_((__is_nothrow_swappable<_T1>::value &&
|
||||
__is_nothrow_swappable<_T2>::value))
|
||||
|
||||
@@ -44,9 +44,9 @@ inline _LIBCPP_INLINE_VISIBILITY __swap_result_t<_Tp> _LIBCPP_CONSTEXPR_SINCE_CX
|
||||
__y = _VSTD::move(__t);
|
||||
}
|
||||
|
||||
template <class _Tp, size_t _Np>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 typename enable_if<__is_swappable<_Tp>::value>::type
|
||||
swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
|
||||
template <class _Tp, size_t _Np, __enable_if_t<__is_swappable<_Tp>::value, int> >
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 void swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np])
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
|
||||
for (size_t __i = 0; __i != _Np; ++__i) {
|
||||
swap(__a[__i], __b[__i]);
|
||||
}
|
||||
|
||||
@@ -569,9 +569,9 @@ hypot(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class _A1>
|
||||
template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
_LIBCPP_CONSTEXPR bool
|
||||
__constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT
|
||||
{
|
||||
#if __has_builtin(__builtin_isnan)
|
||||
@@ -581,17 +581,17 @@ __constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class _A1>
|
||||
template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
|
||||
_LIBCPP_CONSTEXPR bool
|
||||
__constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT
|
||||
{
|
||||
return std::isnan(__lcpp_x);
|
||||
}
|
||||
|
||||
template <class _A1>
|
||||
template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
_LIBCPP_CONSTEXPR bool
|
||||
__constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT
|
||||
{
|
||||
#if __has_builtin(__builtin_isinf)
|
||||
@@ -601,17 +601,17 @@ __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class _A1>
|
||||
template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
|
||||
_LIBCPP_CONSTEXPR bool
|
||||
__constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT
|
||||
{
|
||||
return std::isinf(__lcpp_x);
|
||||
}
|
||||
|
||||
template <class _A1>
|
||||
template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
_LIBCPP_CONSTEXPR bool
|
||||
__constexpr_isfinite(_A1 __lcpp_x) _NOEXCEPT
|
||||
{
|
||||
#if __has_builtin(__builtin_isfinite)
|
||||
@@ -621,9 +621,9 @@ __constexpr_isfinite(_A1 __lcpp_x) _NOEXCEPT
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class _A1>
|
||||
template <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR typename enable_if<!is_floating_point<_A1>::value, bool>::type
|
||||
_LIBCPP_CONSTEXPR bool
|
||||
__constexpr_isfinite(_A1 __lcpp_x) _NOEXCEPT
|
||||
{
|
||||
return __builtin_isfinite(__lcpp_x);
|
||||
|
||||
@@ -942,35 +942,25 @@ arg(const complex<_Tp>& __c)
|
||||
return std::atan2(__c.imag(), __c.real());
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_same<_Tp, long double>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<
|
||||
is_same<_Tp, long double>::value,
|
||||
long double
|
||||
>::type
|
||||
long double
|
||||
arg(_Tp __re)
|
||||
{
|
||||
return std::atan2l(0.L, __re);
|
||||
}
|
||||
|
||||
template<class _Tp>
|
||||
template<class _Tp, __enable_if_t<is_integral<_Tp>::value || is_same<_Tp, double>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value || is_same<_Tp, double>::value,
|
||||
double
|
||||
>::type
|
||||
double
|
||||
arg(_Tp __re)
|
||||
{
|
||||
return std::atan2(0., __re);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_same<_Tp, float>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<
|
||||
is_same<_Tp, float>::value,
|
||||
float
|
||||
>::type
|
||||
float
|
||||
arg(_Tp __re)
|
||||
{
|
||||
return std::atan2f(0.F, __re);
|
||||
@@ -1033,13 +1023,9 @@ proj(const complex<_Tp>& __c)
|
||||
return __r;
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_floating_point<_Tp>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_Tp>::value,
|
||||
typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
|
||||
>::type
|
||||
typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
|
||||
proj(_Tp __re)
|
||||
{
|
||||
if (std::__constexpr_isinf(__re))
|
||||
@@ -1047,13 +1033,9 @@ proj(_Tp __re)
|
||||
return complex<_Tp>(__re);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
template <class _Tp, __enable_if_t<is_integral<_Tp>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_integral<_Tp>::value,
|
||||
typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
|
||||
>::type
|
||||
typename __libcpp_complex_overload_traits<_Tp>::_ComplexType
|
||||
proj(_Tp __re)
|
||||
{
|
||||
typedef typename __libcpp_complex_overload_traits<_Tp>::_ComplexType _ComplexType;
|
||||
@@ -1173,26 +1155,18 @@ pow(const complex<_Tp>& __x, const complex<_Up>& __y)
|
||||
return _VSTD::pow(result_type(__x), result_type(__y));
|
||||
}
|
||||
|
||||
template<class _Tp, class _Up>
|
||||
template<class _Tp, class _Up, __enable_if_t<is_arithmetic<_Up>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_Up>::value,
|
||||
complex<typename __promote<_Tp, _Up>::type>
|
||||
>::type
|
||||
complex<typename __promote<_Tp, _Up>::type>
|
||||
pow(const complex<_Tp>& __x, const _Up& __y)
|
||||
{
|
||||
typedef complex<typename __promote<_Tp, _Up>::type> result_type;
|
||||
return _VSTD::pow(result_type(__x), result_type(__y));
|
||||
}
|
||||
|
||||
template<class _Tp, class _Up>
|
||||
template<class _Tp, class _Up, __enable_if_t<is_arithmetic<_Tp>::value, int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_arithmetic<_Tp>::value,
|
||||
complex<typename __promote<_Tp, _Up>::type>
|
||||
>::type
|
||||
complex<typename __promote<_Tp, _Up>::type>
|
||||
pow(const _Tp& __x, const complex<_Up>& __y)
|
||||
{
|
||||
typedef complex<typename __promote<_Tp, _Up>::type> result_type;
|
||||
|
||||
@@ -1117,15 +1117,17 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p)
|
||||
return __os << __p.get();
|
||||
}
|
||||
|
||||
template<class _CharT, class _Traits, class _Yp, class _Dp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_same<void, __void_t<decltype((std::declval<basic_ostream<_CharT, _Traits>&>() << std::declval<typename unique_ptr<_Yp, _Dp>::pointer>()))> >::value,
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
>::type
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p)
|
||||
{
|
||||
template <
|
||||
class _CharT,
|
||||
class _Traits,
|
||||
class _Yp,
|
||||
class _Dp,
|
||||
__enable_if_t<is_same<void,
|
||||
__void_t<decltype((std::declval<basic_ostream<_CharT, _Traits>&>()
|
||||
<< std::declval<typename unique_ptr<_Yp, _Dp>::pointer>()))> >::value,
|
||||
int> = 0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p) {
|
||||
return __os << __p.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -2776,9 +2776,9 @@ public:
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
{return assign(__s.begin(), __s.end(), __f);}
|
||||
|
||||
template <class _InputIterator>
|
||||
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__has_exactly_input_iterator_category<_InputIterator>::value, basic_regex&>::type
|
||||
basic_regex&
|
||||
assign(_InputIterator __first, _InputIterator __last,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
{
|
||||
@@ -2798,13 +2798,9 @@ private:
|
||||
}
|
||||
public:
|
||||
|
||||
template <class _ForwardIterator>
|
||||
template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__has_forward_iterator_category<_ForwardIterator>::value,
|
||||
basic_regex&
|
||||
>::type
|
||||
basic_regex&
|
||||
assign(_ForwardIterator __first, _ForwardIterator __last,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
{
|
||||
|
||||
@@ -920,13 +920,13 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
|
||||
iterator
|
||||
find(const _K2& __k) {return __tree_.find(__k);}
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
|
||||
const_iterator
|
||||
find(const _K2& __k) const {return __tree_.find(__k);}
|
||||
#endif
|
||||
|
||||
@@ -934,18 +934,18 @@ public:
|
||||
size_type count(const key_type& __k) const
|
||||
{return __tree_.__count_unique(__k);}
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
|
||||
size_type
|
||||
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
|
||||
#endif
|
||||
|
||||
#if _LIBCPP_STD_VER >= 20
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool contains(const key_type& __k) const {return find(__k) != end();}
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
|
||||
bool
|
||||
contains(const _K2& __k) const { return find(__k) != end(); }
|
||||
#endif // _LIBCPP_STD_VER >= 20
|
||||
|
||||
@@ -956,14 +956,14 @@ public:
|
||||
const_iterator lower_bound(const key_type& __k) const
|
||||
{return __tree_.lower_bound(__k);}
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
|
||||
iterator
|
||||
lower_bound(const _K2& __k) {return __tree_.lower_bound(__k);}
|
||||
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
|
||||
const_iterator
|
||||
lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
|
||||
#endif
|
||||
|
||||
@@ -974,13 +974,13 @@ public:
|
||||
const_iterator upper_bound(const key_type& __k) const
|
||||
{return __tree_.upper_bound(__k);}
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
|
||||
iterator
|
||||
upper_bound(const _K2& __k) {return __tree_.upper_bound(__k);}
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
|
||||
const_iterator
|
||||
upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
|
||||
#endif
|
||||
|
||||
@@ -991,13 +991,13 @@ public:
|
||||
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
|
||||
{return __tree_.__equal_range_unique(__k);}
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
|
||||
pair<iterator,iterator>
|
||||
equal_range(const _K2& __k) {return __tree_.__equal_range_multi(__k);}
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
|
||||
pair<const_iterator,const_iterator>
|
||||
equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
|
||||
#endif
|
||||
};
|
||||
@@ -1511,13 +1511,13 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator find(const key_type& __k) const {return __tree_.find(__k);}
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
|
||||
iterator
|
||||
find(const _K2& __k) {return __tree_.find(__k);}
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
|
||||
const_iterator
|
||||
find(const _K2& __k) const {return __tree_.find(__k);}
|
||||
#endif
|
||||
|
||||
@@ -1525,18 +1525,18 @@ public:
|
||||
size_type count(const key_type& __k) const
|
||||
{return __tree_.__count_multi(__k);}
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,size_type>::type
|
||||
size_type
|
||||
count(const _K2& __k) const {return __tree_.__count_multi(__k);}
|
||||
#endif
|
||||
|
||||
#if _LIBCPP_STD_VER >= 20
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool contains(const key_type& __k) const {return find(__k) != end();}
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
|
||||
bool
|
||||
contains(const _K2& __k) const { return find(__k) != end(); }
|
||||
#endif // _LIBCPP_STD_VER >= 20
|
||||
|
||||
@@ -1547,14 +1547,14 @@ public:
|
||||
const_iterator lower_bound(const key_type& __k) const
|
||||
{return __tree_.lower_bound(__k);}
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
|
||||
iterator
|
||||
lower_bound(const _K2& __k) {return __tree_.lower_bound(__k);}
|
||||
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
|
||||
const_iterator
|
||||
lower_bound(const _K2& __k) const {return __tree_.lower_bound(__k);}
|
||||
#endif
|
||||
|
||||
@@ -1565,13 +1565,13 @@ public:
|
||||
const_iterator upper_bound(const key_type& __k) const
|
||||
{return __tree_.upper_bound(__k);}
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
|
||||
iterator
|
||||
upper_bound(const _K2& __k) {return __tree_.upper_bound(__k);}
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,const_iterator>::type
|
||||
const_iterator
|
||||
upper_bound(const _K2& __k) const {return __tree_.upper_bound(__k);}
|
||||
#endif
|
||||
|
||||
@@ -1582,13 +1582,13 @@ public:
|
||||
pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
|
||||
{return __tree_.__equal_range_multi(__k);}
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
|
||||
pair<iterator,iterator>
|
||||
equal_range(const _K2& __k) {return __tree_.__equal_range_multi(__k);}
|
||||
template <typename _K2>
|
||||
template <typename _K2, enable_if_t<__is_transparent<_Compare, _K2>::value, int> = 0>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
|
||||
pair<const_iterator,const_iterator>
|
||||
equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
|
||||
#endif
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2198,17 +2198,11 @@ public:
|
||||
vector& operator=(vector&& __v)
|
||||
_NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
|
||||
|
||||
template <class _InputIterator>
|
||||
typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
|
||||
void
|
||||
>::type
|
||||
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
|
||||
void
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 assign(_InputIterator __first, _InputIterator __last);
|
||||
template <class _ForwardIterator>
|
||||
typename enable_if
|
||||
<
|
||||
__has_forward_iterator_category<_ForwardIterator>::value,
|
||||
void
|
||||
>::type
|
||||
template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
|
||||
void
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 assign(_ForwardIterator __first, _ForwardIterator __last);
|
||||
|
||||
#if _LIBCPP_STD_VER >= 23
|
||||
@@ -2332,17 +2326,11 @@ public:
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, const value_type& __x);
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 iterator insert(const_iterator __position, size_type __n, const value_type& __x);
|
||||
template <class _InputIterator>
|
||||
typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
|
||||
iterator
|
||||
>::type
|
||||
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> = 0>
|
||||
iterator
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert(const_iterator __position, _InputIterator __first, _InputIterator __last);
|
||||
template <class _ForwardIterator>
|
||||
typename enable_if
|
||||
<
|
||||
__has_forward_iterator_category<_ForwardIterator>::value,
|
||||
iterator
|
||||
>::type
|
||||
template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0>
|
||||
iterator
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
|
||||
|
||||
#if _LIBCPP_STD_VER >= 23
|
||||
@@ -2924,10 +2912,9 @@ vector<bool, _Allocator>::assign(size_type __n, const value_type& __x)
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
|
||||
void
|
||||
>::type
|
||||
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> >
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
void
|
||||
vector<bool, _Allocator>::assign(_InputIterator __first, _InputIterator __last)
|
||||
{
|
||||
__assign_with_sentinel(__first, __last);
|
||||
@@ -2943,13 +2930,9 @@ void vector<bool, _Allocator>::__assign_with_sentinel(_Iterator __first, _Sentin
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
template <class _ForwardIterator>
|
||||
template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename enable_if
|
||||
<
|
||||
__has_forward_iterator_category<_ForwardIterator>::value,
|
||||
void
|
||||
>::type
|
||||
void
|
||||
vector<bool, _Allocator>::assign(_ForwardIterator __first, _ForwardIterator __last)
|
||||
{
|
||||
__assign_with_size(__first, __last, std::distance(__first, __last));
|
||||
@@ -3090,10 +3073,9 @@ vector<bool, _Allocator>::insert(const_iterator __position, size_type __n, const
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
template <class _InputIterator>
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 typename enable_if <__has_exactly_input_iterator_category<_InputIterator>::value,
|
||||
typename vector<bool, _Allocator>::iterator
|
||||
>::type
|
||||
template <class _InputIterator, __enable_if_t<__has_exactly_input_iterator_category<_InputIterator>::value, int> >
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename vector<bool, _Allocator>::iterator
|
||||
vector<bool, _Allocator>::insert(const_iterator __position, _InputIterator __first, _InputIterator __last)
|
||||
{
|
||||
return __insert_with_sentinel(__position, __first, __last);
|
||||
@@ -3140,13 +3122,9 @@ vector<bool, _Allocator>::__insert_with_sentinel(const_iterator __position, _Inp
|
||||
}
|
||||
|
||||
template <class _Allocator>
|
||||
template <class _ForwardIterator>
|
||||
template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> >
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
typename enable_if
|
||||
<
|
||||
__has_forward_iterator_category<_ForwardIterator>::value,
|
||||
typename vector<bool, _Allocator>::iterator
|
||||
>::type
|
||||
typename vector<bool, _Allocator>::iterator
|
||||
vector<bool, _Allocator>::insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last)
|
||||
{
|
||||
return __insert_with_size(__position, __first, __last, std::distance(__first, __last));
|
||||
|
||||
Reference in New Issue
Block a user