Avoid concepts when __cpp_lib_concepts isn't defined (#1749)

Co-authored-by: Michael Schellenberger Costa <mschellenbergercosta@googlemail.com>
This commit is contained in:
Stephan T. Lavavej 2021-03-22 17:55:11 -07:00 коммит произвёл GitHub
Родитель 6d5cf9c949
Коммит d3d9735b4d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 14 добавлений и 20 удалений

Просмотреть файл

@ -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) {