зеркало из https://github.com/microsoft/STL.git
Avoid concepts when __cpp_lib_concepts isn't defined (#1749)
Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@googlemail.com>
This commit is contained in:
Родитель
6d5cf9c949
Коммит
d3d9735b4d
|
@ -58,20 +58,19 @@ namespace chrono {
|
|||
};
|
||||
|
||||
#if _HAS_CXX20
|
||||
template <class _Clock>
|
||||
concept _Is_clock = requires {
|
||||
typename _Clock::rep;
|
||||
typename _Clock::period;
|
||||
typename _Clock::duration;
|
||||
typename _Clock::time_point;
|
||||
_Clock::is_steady;
|
||||
_Clock::now();
|
||||
};
|
||||
template <class _Clock, class = void>
|
||||
inline constexpr bool _Is_clock_v = false;
|
||||
|
||||
template <class _Clock>
|
||||
struct is_clock : bool_constant<_Is_clock<_Clock>> {};
|
||||
inline constexpr bool
|
||||
_Is_clock_v<_Clock, void_t<typename _Clock::rep, typename _Clock::period, typename _Clock::duration,
|
||||
typename _Clock::time_point, decltype(_Clock::is_steady), decltype(_Clock::now())>> =
|
||||
true; // TRANSITION, GH-602
|
||||
|
||||
template <class _Clock>
|
||||
inline constexpr bool is_clock_v = _Is_clock<_Clock>;
|
||||
struct is_clock : bool_constant<_Is_clock_v<_Clock>> {};
|
||||
template <class _Clock>
|
||||
inline constexpr bool is_clock_v = _Is_clock_v<_Clock>;
|
||||
#endif // _HAS_CXX20
|
||||
|
||||
// CLASS TEMPLATE duration
|
||||
|
|
|
@ -168,7 +168,7 @@ public:
|
|||
}
|
||||
|
||||
#if _HAS_CXX20
|
||||
template <_Allocator _Alloc2>
|
||||
template <class _Alloc2, enable_if_t<_Is_allocator<_Alloc2>::value, int> = 0>
|
||||
_NODISCARD basic_string<_Elem, _Traits, _Alloc2> str(const _Alloc2& _Al) const {
|
||||
return basic_string<_Elem, _Traits, _Alloc2>{view(), _Al};
|
||||
}
|
||||
|
@ -632,7 +632,7 @@ public:
|
|||
}
|
||||
|
||||
#if _HAS_CXX20
|
||||
template <_Allocator _Alloc2>
|
||||
template <class _Alloc2, enable_if_t<_Is_allocator<_Alloc2>::value, int> = 0>
|
||||
_NODISCARD basic_string<_Elem, _Traits, _Alloc2> str(const _Alloc2& _Al) const {
|
||||
return _Stringbuffer.str(_Al);
|
||||
}
|
||||
|
@ -752,7 +752,7 @@ public:
|
|||
}
|
||||
|
||||
#if _HAS_CXX20
|
||||
template <_Allocator _Alloc2>
|
||||
template <class _Alloc2, enable_if_t<_Is_allocator<_Alloc2>::value, int> = 0>
|
||||
_NODISCARD basic_string<_Elem, _Traits, _Alloc2> str(const _Alloc2& _Al) const {
|
||||
return _Stringbuffer.str(_Al);
|
||||
}
|
||||
|
@ -878,7 +878,7 @@ public:
|
|||
}
|
||||
|
||||
#if _HAS_CXX20
|
||||
template <_Allocator _Alloc2>
|
||||
template <class _Alloc2, enable_if_t<_Is_allocator<_Alloc2>::value, int> = 0>
|
||||
_NODISCARD basic_string<_Elem, _Traits, _Alloc2> str(const _Alloc2& _Al) const {
|
||||
return _Stringbuffer.str(_Al);
|
||||
}
|
||||
|
|
|
@ -1459,11 +1459,6 @@ using _Enable_if_execution_policy_t = typename remove_reference_t<_ExPo>::_Stand
|
|||
|
||||
#endif // _HAS_CXX17
|
||||
|
||||
#if _HAS_CXX20
|
||||
template <class _Ty>
|
||||
concept _Allocator = _Is_allocator<_Ty>::value;
|
||||
#endif // _HAS_CXX20
|
||||
|
||||
// FUNCTION TEMPLATE _Idl_distance
|
||||
template <class _Checked, class _Iter>
|
||||
_NODISCARD constexpr auto _Idl_distance(const _Iter& _First, const _Iter& _Last) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче