`static operator()` for stateless functors (#4358)

Co-authored-by: Casey Carter <cacarter@microsoft.com>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
This commit is contained in:
A. Jiang 2024-02-06 17:18:25 +08:00 коммит произвёл GitHub
Родитель 0c47a7cfc9
Коммит 2fa1641fb6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
27 изменённых файлов: 732 добавлений и 535 удалений

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

@ -376,19 +376,19 @@ constexpr decltype(auto) _Select_countr_zero_impl(_Fn _Callback) {
#if _HAS_TZCNT_BSF_INTRINSICS && _HAS_CXX20
if (!_STD is_constant_evaluated()) {
#ifdef __AVX2__
return _Callback([](_Ty _Val) { return _Countr_zero_tzcnt(_Val); });
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_tzcnt(_Val); });
#else // ^^^ AVX2 / not AVX2 vvv
const bool _Definitely_have_tzcnt = __isa_available >= _Stl_isa_available_avx2;
if (_Definitely_have_tzcnt) {
return _Callback([](_Ty _Val) { return _Countr_zero_tzcnt(_Val); });
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_tzcnt(_Val); });
} else {
return _Callback([](_Ty _Val) { return _Countr_zero_bsf(_Val); });
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_bsf(_Val); });
}
#endif // ^^^ not AVX2 ^^^
}
#endif // ^^^ _HAS_TZCNT_BSF_INTRINSICS && _HAS_CXX20 ^^^
// C++17 constexpr gcd() calls this function, so it should be constexpr unless we detect runtime evaluation.
return _Callback([](_Ty _Val) { return _Countr_zero_fallback(_Val); });
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Countr_zero_fallback(_Val); });
}
template <class _Ty, enable_if_t<_Is_standard_unsigned_integer<_Ty>, int> = 0>
@ -420,16 +420,16 @@ _CONSTEXPR20 decltype(auto) _Select_popcount_impl(_Fn _Callback) {
#ifndef __AVX__
const bool _Definitely_have_popcnt = __isa_available >= _Stl_isa_available_sse42;
if (!_Definitely_have_popcnt) {
return _Callback([](_Ty _Val) { return _Popcount_fallback(_Val); });
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Popcount_fallback(_Val); });
}
#endif // !defined(__AVX__)
return _Callback([](_Ty _Val) { return _Unchecked_x86_x64_popcount(_Val); });
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Unchecked_x86_x64_popcount(_Val); });
#elif _HAS_NEON_INTRINSICS // ^^^ x86/x64 intrinsics available / ARM64 intrinsics available vvv
return _Callback([](_Ty _Val) { return _Arm64_popcount(_Val); });
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Arm64_popcount(_Val); });
#endif // ^^^ ARM64 intrinsics available ^^^
}
#endif // ^^^ any intrinsics available ^^^
return _Callback([](_Ty _Val) { return _Popcount_fallback(_Val); });
return _Callback([](_Ty _Val) _STATIC_CALL_OPERATOR { return _Popcount_fallback(_Val); });
}
#undef _HAS_POPCNT_INTRINSICS

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

@ -101,28 +101,28 @@ struct _Tzdb_deleter;
template <>
struct _Tzdb_deleter<__std_tzdb_time_zones_info> {
void operator()(__std_tzdb_time_zones_info* _Info) const noexcept {
_STATIC_CALL_OPERATOR void operator()(__std_tzdb_time_zones_info* _Info) _CONST_CALL_OPERATOR noexcept {
__std_tzdb_delete_time_zones(_Info);
}
};
template <>
struct _Tzdb_deleter<__std_tzdb_current_zone_info> {
void operator()(__std_tzdb_current_zone_info* _Info) const noexcept {
_STATIC_CALL_OPERATOR void operator()(__std_tzdb_current_zone_info* _Info) _CONST_CALL_OPERATOR noexcept {
__std_tzdb_delete_current_zone(_Info);
}
};
template <>
struct _Tzdb_deleter<__std_tzdb_sys_info> {
void operator()(__std_tzdb_sys_info* _Info) const noexcept {
_STATIC_CALL_OPERATOR void operator()(__std_tzdb_sys_info* _Info) _CONST_CALL_OPERATOR noexcept {
__std_tzdb_delete_sys_info(_Info);
}
};
template <>
struct _Tzdb_deleter<__std_tzdb_leap_info[]> {
void operator()(__std_tzdb_leap_info* _Info) const noexcept {
_STATIC_CALL_OPERATOR void operator()(__std_tzdb_leap_info* _Info) _CONST_CALL_OPERATOR noexcept {
__std_tzdb_delete_leap_seconds(_Info);
}
};

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -602,7 +602,7 @@ struct hash<bitset<_Bits>> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = bitset<_Bits>;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const bitset<_Bits>& _Keyval) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const bitset<_Bits>& _Keyval) _CONST_CALL_OPERATOR noexcept {
return _Hash_representation(_Keyval._Array);
}
};

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

@ -341,7 +341,8 @@ _EXPORT_STD struct compare_three_way {
struct _Synth_three_way {
template <class _Ty1, class _Ty2>
_NODISCARD constexpr auto operator()(const _Ty1& _Left, const _Ty2& _Right) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
const _Ty1& _Left, const _Ty2& _Right) _CONST_CALL_OPERATOR
requires requires {
{ _Left < _Right } -> _Boolean_testable;
{ _Right < _Left } -> _Boolean_testable;
@ -409,8 +410,8 @@ namespace _Strong_order {
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD constexpr strong_ordering operator()(_Ty1&& _Left, _Ty2&& _Right) const
noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr strong_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Adl) {
return static_cast<strong_ordering>(strong_order(_Left, _Right)); // intentional ADL
@ -516,8 +517,8 @@ namespace _Weak_order {
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD constexpr weak_ordering operator()(_Ty1&& _Left, _Ty2&& _Right) const
noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr weak_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Adl) {
return static_cast<weak_ordering>(weak_order(_Left, _Right)); // intentional ADL
@ -647,8 +648,8 @@ namespace _Partial_order {
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD constexpr partial_ordering operator()(_Ty1&& _Left, _Ty2&& _Right) const
noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr partial_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Adl) {
return static_cast<partial_ordering>(/* ADL */ partial_order(_Left, _Right));
@ -709,8 +710,8 @@ namespace _Compare_strong_order_fallback {
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD constexpr strong_ordering operator()(_Ty1&& _Left, _Ty2&& _Right) const
noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr strong_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Strong) {
return _STD strong_order(_Left, _Right);
@ -759,8 +760,8 @@ namespace _Compare_weak_order_fallback {
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD constexpr weak_ordering operator()(_Ty1&& _Left, _Ty2&& _Right) const
noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr weak_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Weak) {
return _STD weak_order(_Left, _Right);
@ -817,8 +818,8 @@ namespace _Compare_partial_order_fallback {
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1&, _Ty2&>._Strategy != _St::_None)
_NODISCARD constexpr partial_ordering operator()(_Ty1&& _Left, _Ty2&& _Right) const
noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr partial_ordering operator()(
_Ty1&& _Left, _Ty2&& _Right) _CONST_CALL_OPERATOR noexcept(_Choice<_Ty1&, _Ty2&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1&, _Ty2&>._Strategy;
if constexpr (_Strat == _St::_Partial) {
return _STD partial_order(_Left, _Right);

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

@ -122,14 +122,14 @@ namespace ranges {
struct _Cpo {
template <class _Ty1, class _Ty2>
requires _Use_ADL_swap<_Ty1, _Ty2>
constexpr void operator()(_Ty1&& __t, _Ty2&& __u) const
_STATIC_CALL_OPERATOR constexpr void operator()(_Ty1&& __t, _Ty2&& __u) _CONST_CALL_OPERATOR
noexcept(noexcept(swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u)))) { // intentional ADL
swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u)); // intentional ADL
}
template <class _Ty>
requires (!_Use_ADL_swap<_Ty&, _Ty&> && move_constructible<_Ty> && assignable_from<_Ty&, _Ty>)
constexpr void operator()(_Ty& __x, _Ty& __y) const
_STATIC_CALL_OPERATOR constexpr void operator()(_Ty& __x, _Ty& __y) _CONST_CALL_OPERATOR
noexcept(is_nothrow_move_constructible_v<_Ty> && is_nothrow_move_assignable_v<_Ty>) {
_Ty __tmp(static_cast<_Ty&&>(__x));
__x = static_cast<_Ty&&>(__y);
@ -137,11 +137,11 @@ namespace ranges {
}
template <class _Ty1, class _Ty2, size_t _Size>
constexpr void operator()(_Ty1 (&__t)[_Size], _Ty2 (&__u)[_Size]) const
noexcept(noexcept((*this)(__t[0], __u[0])))
requires requires { (*this)(__t[0], __u[0]); } {
_STATIC_CALL_OPERATOR constexpr void operator()(_Ty1 (&__t)[_Size], _Ty2 (&__u)[_Size]) _CONST_CALL_OPERATOR
noexcept(noexcept(operator()(__t[0], __u[0])))
requires requires(_Cpo __fn) { __fn(__t[0], __u[0]); } {
for (size_t __i = 0; __i < _Size; ++__i) {
(*this)(__t[__i], __u[__i]);
operator()(__t[__i], __u[__i]);
}
}
};

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

@ -186,7 +186,8 @@ _NODISCARD constexpr bool operator>=(const coroutine_handle<> _Left, const corou
template <class _Promise>
struct hash<coroutine_handle<_Promise>> {
_NODISCARD size_t operator()(const coroutine_handle<_Promise>& _Coro) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(
const coroutine_handle<_Promise>& _Coro) _CONST_CALL_OPERATOR noexcept {
return _Hash_representation(_Coro.address());
}
};

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

@ -3658,7 +3658,8 @@ template <class _Ty>
struct _Casty_plus {
// Adds the two arguments together and casts the result back to _Ty.
// pre: the result from adding the two arguments together can fit in _Ty
_NODISCARD constexpr _Ty operator()(_Ty _Val1, _Ty _Val2) const noexcept /* terminates */ {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _Ty operator()(_Ty _Val1, _Ty _Val2) _CONST_CALL_OPERATOR noexcept
/* terminates */ {
return static_cast<_Ty>(_Val1 + _Val2);
}
};
@ -5049,6 +5050,13 @@ _FwdIt2 adjacent_difference(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _Last,
return _Dest;
}
template <class _Ty>
struct _Inplace_destroy_fn {
_STATIC_CALL_OPERATOR void operator()(_Ty& _Obj) _CONST_CALL_OPERATOR noexcept {
_STD _Destroy_in_place(_Obj);
}
};
_EXPORT_STD template <class _ExPo, class _NoThrowFwdIt, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
void destroy(_ExPo&& _Exec, const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) noexcept /* terminates */ {
// destroy all elements in [_First, _Last)
@ -5056,7 +5064,7 @@ void destroy(_ExPo&& _Exec, const _NoThrowFwdIt _First, const _NoThrowFwdIt _Las
_STD _Adl_verify_range(_First, _Last);
using _Ty = remove_reference_t<_Iter_ref_t<_NoThrowFwdIt>>;
if constexpr (!is_trivially_destructible_v<_Ty>) {
_STD for_each(_STD forward<_ExPo>(_Exec), _First, _Last, [](_Ty& _Obj) { _STD _Destroy_in_place(_Obj); });
_STD for_each(_STD forward<_ExPo>(_Exec), _First, _Last, _Inplace_destroy_fn<_Ty>{});
}
}
@ -5074,11 +5082,18 @@ _NoThrowFwdIt destroy_n(_ExPo&& _Exec, _NoThrowFwdIt _First, const _Diff _Count_
_STD advance(_First, _Count);
return _First;
} else {
return _STD for_each_n(
_STD forward<_ExPo>(_Exec), _First, _Count, [](_Ty& _Obj) { _STD _Destroy_in_place(_Obj); });
return _STD for_each_n(_STD forward<_ExPo>(_Exec), _First, _Count, _Inplace_destroy_fn<_Ty>{});
}
}
template <class _Ty>
struct _Inplace_default_construct_fn {
_STATIC_CALL_OPERATOR void operator()(_Ty& _Obj) _CONST_CALL_OPERATOR
noexcept(is_nothrow_default_constructible_v<_Ty>) {
_STD _Default_construct_in_place(_Obj);
}
};
_EXPORT_STD template <class _ExPo, class _NoThrowFwdIt, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
void uninitialized_default_construct(_ExPo&& _Exec, const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) noexcept
/* terminates */ {
@ -5087,8 +5102,7 @@ void uninitialized_default_construct(_ExPo&& _Exec, const _NoThrowFwdIt _First,
_STD _Adl_verify_range(_First, _Last);
using _Ty = remove_reference_t<_Iter_ref_t<_NoThrowFwdIt>>;
if constexpr (!is_trivially_default_constructible_v<_Ty>) {
_STD for_each(
_STD forward<_ExPo>(_Exec), _First, _Last, [](_Ty& _Obj) { _STD _Default_construct_in_place(_Obj); });
_STD for_each(_STD forward<_ExPo>(_Exec), _First, _Last, _Inplace_default_construct_fn<_Ty>{});
}
}
@ -5107,11 +5121,18 @@ _NoThrowFwdIt uninitialized_default_construct_n(_ExPo&& _Exec, _NoThrowFwdIt _Fi
_STD advance(_First, _Count);
return _First;
} else {
return _STD for_each_n(
_STD forward<_ExPo>(_Exec), _First, _Count, [](_Ty& _Obj) { _STD _Default_construct_in_place(_Obj); });
return _STD for_each_n(_STD forward<_ExPo>(_Exec), _First, _Count, _Inplace_default_construct_fn<_Ty>{});
}
}
template <class _Ty>
struct _Inplace_value_construct_fn {
_STATIC_CALL_OPERATOR void operator()(_Ty& _Obj) _CONST_CALL_OPERATOR
noexcept(is_nothrow_default_constructible_v<_Ty>) {
_STD _Construct_in_place(_Obj);
}
};
_EXPORT_STD template <class _ExPo, class _NoThrowFwdIt, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
void uninitialized_value_construct(_ExPo&&, _NoThrowFwdIt _First, _NoThrowFwdIt _Last) noexcept /* terminates */ {
// value-initialize all elements in [_First, _Last)
@ -5128,10 +5149,10 @@ void uninitialized_value_construct(_ExPo&&, _NoThrowFwdIt _First, _NoThrowFwdIt
auto _Count = _STD distance(_UFirst, _ULast);
if (_Count >= 2) { // ... with at least 2 elements
_TRY_BEGIN
using _Ty = remove_reference_t<_Iter_ref_t<_NoThrowFwdIt>>;
auto _Ctor_fn = [](_Ty& _Obj) { _STD _Construct_in_place(_Obj); };
_Static_partitioned_for_each2<decltype(_UFirst), decltype(_Count), decltype(_Ctor_fn)> _Operation{
_Hw_threads, _Count, _Ctor_fn};
using _Ty = remove_reference_t<_Iter_ref_t<_NoThrowFwdIt>>;
using _Ctor_fn = _Inplace_value_construct_fn<_Ty>;
_Static_partitioned_for_each2<decltype(_UFirst), decltype(_Count), _Ctor_fn> _Operation{
_Hw_threads, _Count, _Ctor_fn{}};
_Operation._Basis._Populate(_Operation._Team, _UFirst);
_STD _Run_chunked_parallel_work(_Hw_threads, _Operation);
return;
@ -5176,10 +5197,10 @@ _NoThrowFwdIt uninitialized_value_construct_n(_ExPo&&, _NoThrowFwdIt _First, con
const size_t _Hw_threads = _CSTD __std_parallel_algorithms_hw_threads();
if (_Hw_threads > 1 && _Count >= 2) { // parallelize on multiprocessor machines with at least 2 elements
_TRY_BEGIN
using _Ty = remove_reference_t<_Iter_ref_t<_NoThrowFwdIt>>;
auto _Ctor_fn = [](_Ty& _Obj) { _STD _Construct_in_place(_Obj); };
_Static_partitioned_for_each2<decltype(_UFirst), decltype(_Count), decltype(_Ctor_fn)> _Operation{
_Hw_threads, _Count, _Ctor_fn};
using _Ty = remove_reference_t<_Iter_ref_t<_NoThrowFwdIt>>;
using _Ctor_fn = _Inplace_value_construct_fn<_Ty>;
_Static_partitioned_for_each2<decltype(_UFirst), decltype(_Count), _Ctor_fn> _Operation{
_Hw_threads, _Count, _Ctor_fn{}};
_STD _Seek_wrapped(_First, _Operation._Basis._Populate(_Operation._Team, _UFirst));
_STD _Run_chunked_parallel_work(_Hw_threads, _Operation);
return _First;

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

@ -851,7 +851,7 @@ public:
path& append(const basic_string<_Elem, _Traits, _Alloc>& _Str0) { // append arbitrary source string
string_type _Str(_Str0.size(), L'\0');
// convert _Elem and '/' to '\'
_STD transform(_Str0.begin(), _Str0.end(), _Str.begin(), [](const _Elem _Ch) {
_STD transform(_Str0.begin(), _Str0.end(), _Str.begin(), [](const _Elem _Ch) _STATIC_CALL_OPERATOR {
auto _Wch = static_cast<wchar_t>(_Ch);
if (_Wch == _FS_SLASH) {
_Wch = _FS_PREF;

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

@ -345,7 +345,7 @@ namespace filesystem {
}
struct _Is_slash_oper { // predicate testing if input is a preferred-separator or fallback-separator
_NODISCARD constexpr bool operator()(const wchar_t _Ch) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr bool operator()(const wchar_t _Ch) _CONST_CALL_OPERATOR {
return _Ch == L'\\' || _Ch == L'/';
}
};
@ -4445,7 +4445,7 @@ template <>
struct hash<filesystem::path> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = filesystem::path;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const filesystem::path& _Path) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const filesystem::path& _Path) _CONST_CALL_OPERATOR noexcept {
return _STD filesystem::hash_value(_Path);
}
};

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

@ -703,6 +703,7 @@ public:
explicit handle(_Ty& _Val) noexcept
: _Ptr(_STD addressof(_Val)),
_Format([](basic_format_parse_context<_CharType>& _Parse_ctx, _Context& _Format_ctx, const void* _Ptr) {
// TRANSITION, Clang 18, should be marked _STATIC_CALL_OPERATOR
using _Td = remove_const_t<_Ty>;
// doesn't drop const-qualifier per an unnumbered LWG issue
using _Tq = conditional_t<_Formattable_with<const _Ty, _Context>, const _Ty, _Ty>;
@ -1626,7 +1627,7 @@ inline constexpr bool _Is_signed_or_unsigned_large_integer_t =
class _Width_checker {
public:
template <class _Ty>
_NODISCARD constexpr unsigned long long operator()(const _Ty _Value) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr unsigned long long operator()(const _Ty _Value) _CONST_CALL_OPERATOR {
if constexpr (_Is_signed_or_unsigned_large_integer_t<_Ty>) {
if constexpr (is_signed_v<_Ty>) {
if (_Value < 0) {
@ -1645,7 +1646,7 @@ public:
class _Precision_checker {
public:
template <class _Ty>
_NODISCARD constexpr unsigned long long operator()(const _Ty _Value) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr unsigned long long operator()(const _Ty _Value) _CONST_CALL_OPERATOR {
if constexpr (_Is_signed_or_unsigned_large_integer_t<_Ty>) {
if constexpr (is_signed_v<_Ty>) {
if (_Value < 0) {

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

@ -57,7 +57,8 @@ namespace ranges {
template <input_iterator _It, sentinel_for<_It> _Se, _No_throw_forward_iterator _Out,
_No_throw_sentinel_for<_Out> _OSe>
requires constructible_from<iter_value_t<_Out>, iter_reference_t<_It>>
uninitialized_copy_result<_It, _Out> operator()(_It _First1, _Se _Last1, _Out _First2, _OSe _Last2) const {
_STATIC_CALL_OPERATOR uninitialized_copy_result<_It, _Out> operator()(
_It _First1, _Se _Last1, _Out _First2, _OSe _Last2) _CONST_CALL_OPERATOR {
_Adl_verify_range(_First1, _Last1);
_Adl_verify_range(_First2, _Last2);
auto _UResult = _Uninitialized_copy_unchecked(_Unwrap_iter<_Se>(_STD move(_First1)),
@ -71,8 +72,8 @@ namespace ranges {
template <input_range _Rng1, _No_throw_forward_range _Rng2>
requires constructible_from<range_value_t<_Rng2>, range_reference_t<_Rng1>>
uninitialized_copy_result<borrowed_iterator_t<_Rng1>, borrowed_iterator_t<_Rng2>> operator()(
_Rng1&& _Range1, _Rng2&& _Range2) const {
_STATIC_CALL_OPERATOR uninitialized_copy_result<borrowed_iterator_t<_Rng1>, borrowed_iterator_t<_Rng2>>
operator()(_Rng1&& _Range1, _Rng2&& _Range2) _CONST_CALL_OPERATOR {
auto _First1 = _RANGES begin(_Range1);
auto _UResult = _Uninitialized_copy_unchecked(
_Unwrap_range_iter<_Rng1>(_STD move(_First1)), _Uend(_Range1), _Ubegin(_Range2), _Uend(_Range2));
@ -172,8 +173,8 @@ namespace ranges {
public:
template <input_iterator _It, _No_throw_forward_iterator _Out, _No_throw_sentinel_for<_Out> _OSe>
requires constructible_from<iter_value_t<_Out>, iter_reference_t<_It>>
uninitialized_copy_n_result<_It, _Out> operator()(
_It _First1, iter_difference_t<_It> _Count, _Out _First2, _OSe _Last2) const {
_STATIC_CALL_OPERATOR uninitialized_copy_n_result<_It, _Out> operator()(
_It _First1, iter_difference_t<_It> _Count, _Out _First2, _OSe _Last2) _CONST_CALL_OPERATOR {
if (_Count <= 0) {
return {_STD move(_First1), _STD move(_First2)};
}
@ -244,7 +245,8 @@ namespace ranges {
template <input_iterator _It, sentinel_for<_It> _Se, _No_throw_forward_iterator _Out,
_No_throw_sentinel_for<_Out> _OSe>
requires constructible_from<iter_value_t<_Out>, iter_rvalue_reference_t<_It>>
uninitialized_move_result<_It, _Out> operator()(_It _First1, _Se _Last1, _Out _First2, _OSe _Last2) const {
_STATIC_CALL_OPERATOR uninitialized_move_result<_It, _Out> operator()(
_It _First1, _Se _Last1, _Out _First2, _OSe _Last2) _CONST_CALL_OPERATOR {
_Adl_verify_range(_First1, _Last1);
_Adl_verify_range(_First2, _Last2);
auto _UResult = _RANGES _Uninitialized_move_unchecked(_Unwrap_iter<_Se>(_STD move(_First1)),
@ -258,8 +260,8 @@ namespace ranges {
template <input_range _Rng1, _No_throw_forward_range _Rng2>
requires constructible_from<range_value_t<_Rng2>, range_rvalue_reference_t<_Rng1>>
uninitialized_move_result<borrowed_iterator_t<_Rng1>, borrowed_iterator_t<_Rng2>> operator()(
_Rng1&& _Range1, _Rng2&& _Range2) const {
_STATIC_CALL_OPERATOR uninitialized_move_result<borrowed_iterator_t<_Rng1>, borrowed_iterator_t<_Rng2>>
operator()(_Rng1&& _Range1, _Rng2&& _Range2) _CONST_CALL_OPERATOR {
auto _First1 = _RANGES begin(_Range1);
auto _UResult = _RANGES _Uninitialized_move_unchecked(
_Unwrap_range_iter<_Rng1>(_STD move(_First1)), _Uend(_Range1), _Ubegin(_Range2), _Uend(_Range2));
@ -334,8 +336,8 @@ namespace ranges {
public:
template <input_iterator _It, _No_throw_forward_iterator _Out, _No_throw_sentinel_for<_Out> _OSe>
requires constructible_from<iter_value_t<_Out>, iter_rvalue_reference_t<_It>>
uninitialized_move_n_result<_It, _Out> operator()(
_It _First1, iter_difference_t<_It> _Count, _Out _First2, _OSe _Last2) const {
_STATIC_CALL_OPERATOR uninitialized_move_n_result<_It, _Out> operator()(
_It _First1, iter_difference_t<_It> _Count, _Out _First2, _OSe _Last2) _CONST_CALL_OPERATOR {
if (_Count <= 0) {
return {_STD move(_First1), _STD move(_First2)};
}
@ -378,7 +380,7 @@ namespace ranges {
public:
template <_No_throw_forward_iterator _It, _No_throw_sentinel_for<_It> _Se, class _Ty>
requires constructible_from<iter_value_t<_It>, const _Ty&>
_It operator()(_It _First, _Se _Last, const _Ty& _Val) const {
_STATIC_CALL_OPERATOR _It operator()(_It _First, _Se _Last, const _Ty& _Val) _CONST_CALL_OPERATOR {
_Adl_verify_range(_First, _Last);
auto _UResult = _Uninitialized_fill_unchecked(
_Unwrap_iter<_Se>(_STD move(_First)), _Unwrap_sent<_It>(_STD move(_Last)), _Val);
@ -389,7 +391,8 @@ namespace ranges {
template <_No_throw_forward_range _Rng, class _Ty>
requires constructible_from<range_value_t<_Rng>, const _Ty&>
borrowed_iterator_t<_Rng> operator()(_Rng&& _Range, const _Ty& _Val) const {
_STATIC_CALL_OPERATOR borrowed_iterator_t<_Rng> operator()(
_Rng&& _Range, const _Ty& _Val) _CONST_CALL_OPERATOR {
return _Rewrap_iterator(_Range, _Uninitialized_fill_unchecked(_Ubegin(_Range), _Uend(_Range), _Val));
}
@ -483,7 +486,8 @@ namespace ranges {
public:
template <_No_throw_forward_iterator _It, class _Ty>
requires constructible_from<iter_value_t<_It>, const _Ty&>
_It operator()(_It _First, iter_difference_t<_It> _Count, const _Ty& _Val) const {
_STATIC_CALL_OPERATOR _It operator()(
_It _First, iter_difference_t<_It> _Count, const _Ty& _Val) _CONST_CALL_OPERATOR {
if (_Count <= 0) {
return _First;
}
@ -517,14 +521,14 @@ namespace ranges {
class _Construct_at_fn {
public:
// clang-format off
template <class _Ty, class... _Types>
requires requires(_Ty* _Ptr, _Types&&... _Args) {
::new (static_cast<void*>(_Ptr)) _Ty(static_cast<_Types&&>(_Args)...); // per LWG-3888
}
constexpr _Ty* operator()(_Ty* _Location, _Types&&... _Args) const
noexcept(noexcept(::new (static_cast<void*>(_Location))
_Ty(_STD forward<_Types>(_Args)...))) /* strengthened */ {
_STATIC_CALL_OPERATOR constexpr _Ty* operator()(_Ty* _Location, _Types&&... _Args) _CONST_CALL_OPERATOR
// clang-format off
noexcept(noexcept(
::new(static_cast<void*>(_Location)) _Ty(_STD forward<_Types>(_Args)...))) /* strengthened */ {
// clang-format on
#ifdef __EDG__
return _STD construct_at(_Location, _STD forward<_Types>(_Args)...);
@ -543,7 +547,7 @@ namespace ranges {
class _Destroy_at_fn {
public:
template <destructible _Ty>
constexpr void operator()(_Ty* const _Location) const noexcept {
_STATIC_CALL_OPERATOR constexpr void operator()(_Ty* const _Location) _CONST_CALL_OPERATOR noexcept {
if constexpr (is_array_v<_Ty>) {
(void) _RANGES _Destroy_unchecked(_RANGES begin(*_Location), _RANGES end(*_Location));
} else {
@ -587,7 +591,7 @@ namespace ranges {
public:
template <_No_throw_input_iterator _It, _No_throw_sentinel_for<_It> _Se>
requires destructible<iter_value_t<_It>>
constexpr _It operator()(_It _First, _Se _Last) const noexcept {
_STATIC_CALL_OPERATOR constexpr _It operator()(_It _First, _Se _Last) _CONST_CALL_OPERATOR noexcept {
_Adl_verify_range(_First, _Last);
_Seek_wrapped(_First,
_RANGES _Destroy_unchecked(_Unwrap_iter<_Se>(_STD move(_First)), _Unwrap_sent<_It>(_STD move(_Last))));
@ -596,7 +600,8 @@ namespace ranges {
template <_No_throw_input_range _Rng>
requires destructible<range_value_t<_Rng>>
constexpr borrowed_iterator_t<_Rng> operator()(_Rng&& _Range) const noexcept {
_STATIC_CALL_OPERATOR constexpr borrowed_iterator_t<_Rng> operator()(
_Rng&& _Range) _CONST_CALL_OPERATOR noexcept {
auto _First = _RANGES begin(_Range);
_Seek_wrapped(
_First, _RANGES _Destroy_unchecked(_Unwrap_range_iter<_Rng>(_STD move(_First)), _Uend(_Range)));
@ -638,7 +643,8 @@ namespace ranges {
public:
template <_No_throw_input_iterator _It>
requires destructible<iter_value_t<_It>>
constexpr _It operator()(_It _First, const iter_difference_t<_It> _Count_raw) const noexcept {
_STATIC_CALL_OPERATOR constexpr _It operator()(
_It _First, const iter_difference_t<_It> _Count_raw) _CONST_CALL_OPERATOR noexcept {
_Algorithm_int_t<iter_difference_t<_It>> _Count = _Count_raw;
if (_Count <= 0) {
return _First;
@ -689,7 +695,7 @@ namespace ranges {
public:
template <_No_throw_forward_iterator _It, _No_throw_sentinel_for<_It> _Se>
requires default_initializable<iter_value_t<_It>>
_It operator()(_It _First, _Se _Last) const {
_STATIC_CALL_OPERATOR _It operator()(_It _First, _Se _Last) _CONST_CALL_OPERATOR {
_Adl_verify_range(_First, _Last);
auto _UResult = _Uninitialized_default_construct_unchecked(
_Unwrap_iter<_Se>(_STD move(_First)), _Unwrap_sent<_It>(_STD move(_Last)));
@ -700,7 +706,7 @@ namespace ranges {
template <_No_throw_forward_range _Rng>
requires default_initializable<range_value_t<_Rng>>
borrowed_iterator_t<_Rng> operator()(_Rng&& _Range) const {
_STATIC_CALL_OPERATOR borrowed_iterator_t<_Rng> operator()(_Rng&& _Range) _CONST_CALL_OPERATOR {
auto _UResult = _Uninitialized_default_construct_unchecked(_Ubegin(_Range), _Uend(_Range));
return _Rewrap_iterator(_Range, _STD move(_UResult));
@ -766,7 +772,7 @@ namespace ranges {
public:
template <_No_throw_forward_iterator _It>
requires default_initializable<iter_value_t<_It>>
_It operator()(_It _First, iter_difference_t<_It> _Count) const {
_STATIC_CALL_OPERATOR _It operator()(_It _First, iter_difference_t<_It> _Count) _CONST_CALL_OPERATOR {
if (_Count <= 0) {
return _First;
}
@ -819,7 +825,7 @@ namespace ranges {
public:
template <_No_throw_forward_iterator _It, _No_throw_sentinel_for<_It> _Se>
requires default_initializable<iter_value_t<_It>>
_It operator()(_It _First, _Se _Last) const {
_STATIC_CALL_OPERATOR _It operator()(_It _First, _Se _Last) _CONST_CALL_OPERATOR {
_Adl_verify_range(_First, _Last);
auto _UResult = _Uninitialized_value_construct_unchecked(
_Unwrap_iter<_Se>(_STD move(_First)), _Unwrap_sent<_It>(_STD move(_Last)));
@ -830,7 +836,7 @@ namespace ranges {
template <_No_throw_forward_range _Rng>
requires default_initializable<range_value_t<_Rng>>
borrowed_iterator_t<_Rng> operator()(_Rng&& _Range) const {
_STATIC_CALL_OPERATOR borrowed_iterator_t<_Rng> operator()(_Rng&& _Range) _CONST_CALL_OPERATOR {
auto _UResult = _Uninitialized_value_construct_unchecked(_Ubegin(_Range), _Uend(_Range));
return _Rewrap_iterator(_Range, _STD move(_UResult));
@ -883,7 +889,7 @@ namespace ranges {
public:
template <_No_throw_forward_iterator _It>
requires default_initializable<iter_value_t<_It>>
_It operator()(_It _First, iter_difference_t<_It> _Count) const {
_STATIC_CALL_OPERATOR _It operator()(_It _First, iter_difference_t<_It> _Count) _CONST_CALL_OPERATOR {
if (_Count <= 0) {
return _First;
}
@ -3863,7 +3869,7 @@ struct hash<shared_ptr<_Ty>> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = shared_ptr<_Ty>;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const shared_ptr<_Ty>& _Keyval) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const shared_ptr<_Ty>& _Keyval) _CONST_CALL_OPERATOR noexcept {
return hash<typename shared_ptr<_Ty>::element_type*>()(_Keyval.get());
}
};

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

@ -556,7 +556,8 @@ namespace pmr {
const size_t _Size = (_STD max)(_Bytes + sizeof(void*), _Align);
const auto _Log_of_size = static_cast<unsigned char>(_Ceiling_of_log_2(_Size));
return {_STD lower_bound(_Pools.begin(), _Pools.end(), _Log_of_size,
[](const _Pool& _Al, const unsigned char _Log) { return _Al._Log_of_size < _Log; }),
[](const _Pool& _Al, const unsigned char _Log)
_STATIC_CALL_OPERATOR { return _Al._Log_of_size < _Log; }),
_Log_of_size};
}

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

@ -488,7 +488,7 @@ public:
: _MyMutexes(_Mtxes...) {} // construct but don't lock
~scoped_lock() noexcept {
_STD apply([](_Mutexes&... _Mtxes) { (..., (void) _Mtxes.unlock()); }, _MyMutexes);
_STD apply([](_Mutexes&... _Mtxes) _STATIC_CALL_OPERATOR { (..., (void) _Mtxes.unlock()); }, _MyMutexes);
}
scoped_lock(const scoped_lock&) = delete;

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

@ -534,7 +534,8 @@ namespace ranges {
public:
template <input_or_output_iterator _It, sentinel_for<_It> _Se, weakly_incrementable _Ty>
requires indirectly_writable<_It, const _Ty&>
constexpr iota_result<_It, _Ty> operator()(_It _First, _Se _Last, _Ty _Val) const {
_STATIC_CALL_OPERATOR constexpr iota_result<_It, _Ty> operator()(
_It _First, _Se _Last, _Ty _Val) _CONST_CALL_OPERATOR {
_Adl_verify_range(_First, _Last);
_Seek_wrapped(
_First, _Iota_impl(_Unwrap_iter<_Se>(_STD move(_First)), _Unwrap_sent<_It>(_STD move(_Last)), _Val));
@ -542,7 +543,8 @@ namespace ranges {
}
template <weakly_incrementable _Ty, output_range<const _Ty&> _Rng>
constexpr iota_result<borrowed_iterator_t<_Rng>, _Ty> operator()(_Rng&& _Range, _Ty _Val) const {
_STATIC_CALL_OPERATOR constexpr iota_result<borrowed_iterator_t<_Rng>, _Ty> operator()(
_Rng&& _Range, _Ty _Val) _CONST_CALL_OPERATOR {
auto _First = _RANGES begin(_Range);
_Seek_wrapped(_First, _Iota_impl(_Unwrap_range_iter<_Rng>(_STD move(_First)), _Uend(_Range), _Val));
return {_STD move(_First), _STD move(_Val)};

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

@ -1054,7 +1054,7 @@ namespace ranges {
namespace views {
struct _Single_fn {
template <class _Ty>
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(single_view<decay_t<_Ty>>(_STD forward<_Ty>(_Val))))
requires requires {
typename single_view<decay_t<_Ty>>;
@ -1447,7 +1447,7 @@ namespace ranges {
namespace views {
struct _Iota_fn {
template <class _Ty>
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(iota_view(static_cast<_Ty&&>(_Val))))
requires requires { iota_view(static_cast<_Ty&&>(_Val)); }
{
@ -1455,7 +1455,7 @@ namespace ranges {
}
template <class _Ty1, class _Ty2>
_NODISCARD constexpr auto operator()(_Ty1&& _Val1, _Ty2&& _Val2) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty1&& _Val1, _Ty2&& _Val2) _CONST_CALL_OPERATOR
noexcept(noexcept(iota_view(static_cast<_Ty1&&>(_Val1), static_cast<_Ty2&&>(_Val2))))
requires requires { iota_view(static_cast<_Ty1&&>(_Val1), static_cast<_Ty2&&>(_Val2)); }
{
@ -1702,7 +1702,7 @@ namespace ranges {
namespace views {
struct _Repeat_fn {
template <class _Ty>
_NODISCARD constexpr auto operator()(_Ty&& _Value) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Value) _CONST_CALL_OPERATOR
noexcept(noexcept(repeat_view(_STD forward<_Ty>(_Value))))
requires requires { repeat_view(_STD forward<_Ty>(_Value)); }
{
@ -1710,7 +1710,7 @@ namespace ranges {
}
template <class _Ty1, class _Ty2>
_NODISCARD constexpr auto operator()(_Ty1&& _Val1, _Ty2&& _Val2) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty1&& _Val1, _Ty2&& _Val2) _CONST_CALL_OPERATOR
noexcept(noexcept(repeat_view(_STD forward<_Ty1>(_Val1), _STD forward<_Ty2>(_Val2))))
requires requires { repeat_view(_STD forward<_Ty1>(_Val1), _STD forward<_Ty2>(_Val2)); }
{
@ -1816,7 +1816,7 @@ namespace ranges {
struct _Istream_fn {
template <class _StreamTy>
requires _Istreamable<_Ty, _StreamTy>
_NODISCARD constexpr auto operator()(_StreamTy& _Stream) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_StreamTy& _Stream) _CONST_CALL_OPERATOR
noexcept(is_nothrow_default_constructible_v<_Ty>) /* strengthened */ {
return basic_istream_view<_Ty, typename _StreamTy::char_type, typename _StreamTy::traits_type>(_Stream);
}
@ -2018,7 +2018,8 @@ namespace ranges {
public:
template <viewable_range _Rng>
requires (_Choice<_Rng>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Rng&& _Range) const noexcept(_Choice<_Rng>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR
noexcept(_Choice<_Rng>._No_throw) {
constexpr _St _Strat = _Choice<_Rng>._Strategy;
if constexpr (_Strat == _St::_View) {
@ -2154,7 +2155,8 @@ namespace ranges {
public:
template <viewable_range _Rng>
requires (_Choice<_Rng>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Rng&& _Range) const noexcept(_Choice<_Rng>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR
noexcept(_Choice<_Rng>._No_throw) {
constexpr _St _Strat = _Choice<_Rng>._Strategy;
if constexpr (_Strat == _St::_All) {
return views::all(_STD forward<_Rng>(_Range));
@ -2413,7 +2415,7 @@ namespace ranges {
namespace views {
struct _Filter_fn {
template <viewable_range _Rng, class _Pr>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Pr&& _Pred) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range, _Pr&& _Pred) _CONST_CALL_OPERATOR
noexcept(noexcept(filter_view(_STD forward<_Rng>(_Range), _STD forward<_Pr>(_Pred))))
requires requires { filter_view(static_cast<_Rng&&>(_Range), _STD forward<_Pr>(_Pred)); }
{
@ -2422,7 +2424,7 @@ namespace ranges {
template <class _Pr>
requires constructible_from<decay_t<_Pr>, _Pr>
_NODISCARD constexpr auto operator()(_Pr&& _Pred) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Pr&& _Pred) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Pr>, _Pr>) {
return _Range_closure<_Filter_fn, decay_t<_Pr>>{_STD forward<_Pr>(_Pred)};
}
@ -2842,7 +2844,7 @@ namespace ranges {
namespace views {
struct _Transform_fn {
template <viewable_range _Rng, class _Fn>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Fn _Fun) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range, _Fn _Fun) _CONST_CALL_OPERATOR
noexcept(noexcept(transform_view(_STD forward<_Rng>(_Range), _STD move(_Fun))))
requires requires { transform_view(static_cast<_Rng&&>(_Range), _STD move(_Fun)); }
{
@ -2851,7 +2853,7 @@ namespace ranges {
template <class _Fn>
requires constructible_from<decay_t<_Fn>, _Fn>
_NODISCARD constexpr auto operator()(_Fn&& _Fun) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Fn&& _Fun) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Fn>, _Fn>) {
return _Range_closure<_Transform_fn, decay_t<_Fn>>{_STD forward<_Fn>(_Fun)};
}
@ -3103,8 +3105,8 @@ namespace ranges {
public:
template <viewable_range _Rng>
_NODISCARD constexpr auto operator()(_Rng&& _Range, range_difference_t<_Rng> _Count) const
noexcept(_Choice<_Rng>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Rng&& _Range, range_difference_t<_Rng> _Count) _CONST_CALL_OPERATOR noexcept(_Choice<_Rng>._No_throw) {
constexpr _St _Strat = _Choice<_Rng>._Strategy;
if constexpr (_Strat == _St::_Empty) {
@ -3142,7 +3144,7 @@ namespace ranges {
template <class _Ty>
requires constructible_from<decay_t<_Ty>, _Ty>
_NODISCARD constexpr auto operator()(_Ty&& _Length) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Length) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Ty>, _Ty>) {
return _Range_closure<_Take_fn, decay_t<_Ty>>{_STD forward<_Ty>(_Length)};
}
@ -3302,7 +3304,7 @@ namespace ranges {
namespace views {
struct _Take_while_fn {
template <viewable_range _Rng, class _Pr>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Pr _Pred) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range, _Pr _Pred) _CONST_CALL_OPERATOR
noexcept(noexcept(take_while_view(_STD forward<_Rng>(_Range), _STD move(_Pred))))
requires requires { take_while_view(static_cast<_Rng&&>(_Range), _STD move(_Pred)); }
{
@ -3311,7 +3313,7 @@ namespace ranges {
template <class _Pr>
requires constructible_from<decay_t<_Pr>, _Pr>
_NODISCARD constexpr auto operator()(_Pr&& _Pred) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Pr&& _Pred) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Pr>, _Pr>) {
return _Range_closure<_Take_while_fn, decay_t<_Pr>>{_STD forward<_Pr>(_Pred)};
}
@ -3506,8 +3508,8 @@ namespace ranges {
public:
template <viewable_range _Rng>
_NODISCARD constexpr auto operator()(_Rng&& _Range, range_difference_t<_Rng> _Count) const
noexcept(_Choice<_Rng>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Rng&& _Range, range_difference_t<_Rng> _Count) _CONST_CALL_OPERATOR noexcept(_Choice<_Rng>._No_throw) {
constexpr _St _Strat = _Choice<_Rng>._Strategy;
if constexpr (_Strat == _St::_Empty) {
@ -3548,7 +3550,7 @@ namespace ranges {
template <class _Ty>
requires constructible_from<decay_t<_Ty>, _Ty>
_NODISCARD constexpr auto operator()(_Ty&& _Length) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Length) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Ty>, _Ty>) {
return _Range_closure<_Drop_fn, decay_t<_Ty>>{_STD forward<_Ty>(_Length)};
}
@ -3627,7 +3629,7 @@ namespace ranges {
namespace views {
struct _Drop_while_fn {
template <viewable_range _Rng, class _Pr>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Pr _Pred) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range, _Pr _Pred) _CONST_CALL_OPERATOR
noexcept(noexcept(drop_while_view(_STD forward<_Rng>(_Range), _STD move(_Pred))))
requires requires { drop_while_view(static_cast<_Rng&&>(_Range), _STD move(_Pred)); }
{
@ -3636,7 +3638,7 @@ namespace ranges {
template <class _Pr>
requires constructible_from<decay_t<_Pr>, _Pr>
_NODISCARD constexpr auto operator()(_Pr&& _Pred) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Pr&& _Pred) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Pr>, _Pr>) {
return _Range_closure<_Drop_while_fn, decay_t<_Pr>>{_STD forward<_Pr>(_Pred)};
}
@ -4060,7 +4062,7 @@ namespace ranges {
class _Join_fn : public _Pipe::_Base<_Join_fn> {
public:
template <viewable_range _Rng>
_NODISCARD constexpr auto operator()(_Rng&& _Range) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR
noexcept(noexcept(join_view<views::all_t<_Rng>>{_STD forward<_Rng>(_Range)}))
requires requires { join_view<views::all_t<_Rng>>{static_cast<_Rng&&>(_Range)}; }
{
@ -4304,7 +4306,7 @@ namespace ranges {
_NODISCARD constexpr decltype(auto) operator*() const {
using _Ref = common_reference_t<iter_reference_t<_InnerIter>, iter_reference_t<_PatternIter>>;
return _Visit_inner_it<_Ref>([](auto&& _It) -> _Ref { return *_It; });
return _Visit_inner_it<_Ref>([](auto&& _It) _STATIC_CALL_OPERATOR -> _Ref { return *_It; });
}
constexpr _Iterator& operator++() {
@ -4593,7 +4595,8 @@ namespace ranges {
namespace views {
struct _Join_with_fn {
template <viewable_range _Rng, class _Pat>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Pat&& _Pattern) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Rng&& _Range, _Pat&& _Pattern) _CONST_CALL_OPERATOR
noexcept(noexcept(join_with_view(_STD forward<_Rng>(_Range), _STD forward<_Pat>(_Pattern))))
requires requires { join_with_view(_STD forward<_Rng>(_Range), _STD forward<_Pat>(_Pattern)); }
{
@ -4602,7 +4605,7 @@ namespace ranges {
template <class _Delim>
requires constructible_from<decay_t<_Delim>, _Delim>
_NODISCARD constexpr auto operator()(_Delim&& _Delimiter) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Delim&& _Delimiter) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Delim>, _Delim>) {
return _Range_closure<_Join_with_fn, decay_t<_Delim>>{_STD forward<_Delim>(_Delimiter)};
}
@ -5010,7 +5013,8 @@ namespace ranges {
namespace views {
struct _Lazy_split_fn {
template <viewable_range _Rng, class _Pat>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Pat&& _Pattern) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Rng&& _Range, _Pat&& _Pattern) _CONST_CALL_OPERATOR
noexcept(noexcept(lazy_split_view(_STD forward<_Rng>(_Range), _STD forward<_Pat>(_Pattern))))
requires requires { lazy_split_view(static_cast<_Rng&&>(_Range), static_cast<_Pat&&>(_Pattern)); }
{
@ -5019,7 +5023,7 @@ namespace ranges {
template <class _Delim>
requires constructible_from<decay_t<_Delim>, _Delim>
_NODISCARD constexpr auto operator()(_Delim&& _Delimiter) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Delim&& _Delimiter) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Delim>, _Delim>) {
return _Range_closure<_Lazy_split_fn, decay_t<_Delim>>{_STD forward<_Delim>(_Delimiter)};
}
@ -5195,7 +5199,8 @@ namespace ranges {
namespace views {
struct _Split_fn {
template <viewable_range _Rng, class _Pat>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Pat&& _Pattern) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Rng&& _Range, _Pat&& _Pattern) _CONST_CALL_OPERATOR
noexcept(noexcept(split_view(_STD forward<_Rng>(_Range), _STD forward<_Pat>(_Pattern))))
requires requires { split_view(static_cast<_Rng&&>(_Range), static_cast<_Pat&&>(_Pattern)); }
{
@ -5204,7 +5209,7 @@ namespace ranges {
template <class _Delim>
requires constructible_from<decay_t<_Delim>, _Delim>
_NODISCARD constexpr auto operator()(_Delim&& _Delimiter) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Delim&& _Delimiter) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Delim>, _Delim>) {
return _Range_closure<_Split_fn, decay_t<_Delim>>{_STD forward<_Delim>(_Delimiter)};
}
@ -5241,8 +5246,8 @@ namespace ranges {
public:
template <class _It>
requires (input_or_output_iterator<decay_t<_It>> && _Choice<_It>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_It&& _First, const iter_difference_t<decay_t<_It>> _Count) const
noexcept(_Choice<_It>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_It&& _First,
const iter_difference_t<decay_t<_It>> _Count) _CONST_CALL_OPERATOR noexcept(_Choice<_It>._No_throw) {
_STL_ASSERT(_Count >= 0, "The size passed to views::counted must be non-negative");
constexpr _St _Strat = _Choice<_It>._Strategy;
@ -5368,7 +5373,8 @@ namespace ranges {
public:
template <viewable_range _Rng>
requires (_Choice<_Rng>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Rng&& _Range) const noexcept(_Choice<_Rng>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR
noexcept(_Choice<_Rng>._No_throw) {
constexpr _St _Strat = _Choice<_Rng>._Strategy;
if constexpr (_Strat == _St::_All) {
@ -5522,7 +5528,8 @@ namespace ranges {
public:
template <viewable_range _Rng>
requires (_Choice<_Rng>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Rng&& _Range) const noexcept(_Choice<_Rng>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR
noexcept(_Choice<_Rng>._No_throw) {
constexpr _St _Strat = _Choice<_Rng>._Strategy;
if constexpr (_Strat == _St::_Base) {
@ -5660,7 +5667,8 @@ namespace ranges {
public:
template <viewable_range _Rng>
requires (_Choice<_Rng>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Rng&& _Range) const noexcept(_Choice<_Rng>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR
noexcept(_Choice<_Rng>._No_throw) {
using _Ty = remove_cvref_t<_Rng>;
constexpr _St _Strat = _Choice<_Rng>._Strategy;
@ -6095,7 +6103,7 @@ namespace ranges {
class _Elements_fn : public _Pipe::_Base<_Elements_fn<_Index>> {
public:
template <viewable_range _Rng>
_NODISCARD constexpr auto operator()(_Rng&& _Range) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR
noexcept(noexcept(elements_view<views::all_t<_Rng>, _Index>{_STD forward<_Rng>(_Range)}))
requires requires { elements_view<views::all_t<_Rng>, _Index>{static_cast<_Rng&&>(_Range)}; }
{
@ -6439,7 +6447,7 @@ namespace ranges {
class _Enumerate_fn : public _Pipe::_Base<_Enumerate_fn> {
public:
template <viewable_range _Rng>
_NODISCARD constexpr auto operator()(_Rng&& _Range) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR
noexcept(noexcept(enumerate_view<views::all_t<_Rng>>{_STD forward<_Rng>(_Range)}))
requires requires { enumerate_view<views::all_t<_Rng>>{_STD forward<_Rng>(_Range)}; }
{
@ -7038,7 +7046,8 @@ namespace ranges {
namespace views {
struct _Chunk_fn {
template <viewable_range _Rng>
_NODISCARD constexpr auto operator()(_Rng&& _Range, const range_difference_t<_Rng> _Count) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Rng&& _Range, const range_difference_t<_Rng> _Count) _CONST_CALL_OPERATOR
noexcept(noexcept(chunk_view(_STD forward<_Rng>(_Range), _Count)))
requires requires { chunk_view(_STD forward<_Rng>(_Range), _Count); }
{
@ -7047,7 +7056,7 @@ namespace ranges {
template <class _Ty>
requires constructible_from<decay_t<_Ty>, _Ty>
_NODISCARD constexpr auto operator()(_Ty&& _Count) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Count) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Ty>, _Ty>) {
return _Range_closure<_Chunk_fn, decay_t<_Ty>>{_STD forward<_Ty>(_Count)};
}
@ -7436,7 +7445,8 @@ namespace ranges {
namespace views {
struct _Slide_fn {
template <viewable_range _Rng>
_NODISCARD constexpr auto operator()(_Rng&& _Range, const range_difference_t<_Rng> _Count) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Rng&& _Range, const range_difference_t<_Rng> _Count) _CONST_CALL_OPERATOR
noexcept(noexcept(slide_view(_STD forward<_Rng>(_Range), _Count)))
requires requires { slide_view(_STD forward<_Rng>(_Range), _Count); }
{
@ -7445,7 +7455,7 @@ namespace ranges {
template <class _Ty>
requires constructible_from<decay_t<_Ty>, _Ty>
_NODISCARD constexpr auto operator()(_Ty&& _Count) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Count) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Ty>, _Ty>) {
return _Range_closure<_Slide_fn, decay_t<_Ty>>{_STD forward<_Ty>(_Count)};
}
@ -7638,7 +7648,7 @@ namespace ranges {
namespace views {
struct _Chunk_by_fn {
template <viewable_range _Rng, class _Pr>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Pr&& _Pred) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range, _Pr&& _Pred) _CONST_CALL_OPERATOR
noexcept(noexcept(chunk_by_view(_STD forward<_Rng>(_Range), _STD forward<_Pr>(_Pred))))
requires requires { chunk_by_view(_STD forward<_Rng>(_Range), _STD forward<_Pr>(_Pred)); }
{
@ -7647,7 +7657,7 @@ namespace ranges {
template <class _Pr>
requires constructible_from<decay_t<_Pr>, _Pr>
_NODISCARD constexpr auto operator()(_Pr&& _Pred) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Pr&& _Pred) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Pr>, _Pr>) {
return _Range_closure<_Chunk_by_fn, decay_t<_Pr>>{_STD forward<_Pr>(_Pred)};
}
@ -8033,7 +8043,8 @@ namespace ranges {
namespace views {
struct _Stride_fn {
template <viewable_range _Rng>
_NODISCARD constexpr auto operator()(_Rng&& _Range, const range_difference_t<_Rng> _Stride) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Rng&& _Range, const range_difference_t<_Rng> _Stride) _CONST_CALL_OPERATOR
noexcept(noexcept(stride_view(_STD forward<_Rng>(_Range), _Stride)))
requires requires { stride_view(_STD forward<_Rng>(_Range), _Stride); }
{
@ -8042,7 +8053,7 @@ namespace ranges {
template <class _Ty>
requires constructible_from<decay_t<_Ty>, _Ty>
_NODISCARD constexpr auto operator()(_Ty&& _Stride) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Stride) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Ty>, _Ty>) {
return _Range_closure<_Stride_fn, decay_t<_Ty>>{_STD forward<_Ty>(_Stride)};
}
@ -8200,12 +8211,14 @@ namespace ranges {
noexcept((noexcept(*(_STD declval<iterator_t<_Maybe_const<_IsConst, _ViewTypes>>&>()))
&& ...)) /* strengthened */ {
return _Tuple_transform(
[](auto& _Itr) noexcept(noexcept(*_Itr)) -> decltype(auto) { return *_Itr; }, _Current);
[](auto& _Itr) _STATIC_CALL_OPERATOR noexcept(noexcept(*_Itr)) -> decltype(auto) { return *_Itr; },
_Current);
}
constexpr _Iterator& operator++() noexcept(noexcept(
_Tuple_for_each([](auto& _Itr) noexcept(noexcept(++_Itr)) { ++_Itr; }, _Current))) /* strengthened */ {
_Tuple_for_each([](auto& _Itr) noexcept(noexcept(++_Itr)) { ++_Itr; }, _Current);
constexpr _Iterator& operator++() noexcept(
noexcept(_Tuple_for_each([](auto& _Itr) _STATIC_CALL_OPERATOR noexcept(noexcept(++_Itr)) { ++_Itr; },
_Current))) /* strengthened */ {
_Tuple_for_each([](auto& _Itr) _STATIC_CALL_OPERATOR noexcept(noexcept(++_Itr)) { ++_Itr; }, _Current);
return *this;
}
@ -8223,11 +8236,11 @@ namespace ranges {
return _Temp;
}
constexpr _Iterator& operator--() noexcept(noexcept(
_Tuple_for_each([](auto& _Itr) noexcept(noexcept(--_Itr)) { --_Itr; }, _Current))) // strengthened
constexpr _Iterator& operator--() noexcept(noexcept(_Tuple_for_each(
[](auto& _Itr) _STATIC_CALL_OPERATOR noexcept(noexcept(--_Itr)) { --_Itr; }, _Current))) // strengthened
requires _All_bidirectional<_IsConst, _ViewTypes...>
{
_Tuple_for_each([](auto& _Itr) noexcept(noexcept(--_Itr)) { --_Itr; }, _Current);
_Tuple_for_each([](auto& _Itr) _STATIC_CALL_OPERATOR noexcept(noexcept(--_Itr)) { --_Itr; }, _Current);
return *this;
}
@ -8512,7 +8525,7 @@ namespace ranges {
private:
_NODISCARD static constexpr auto _Size_closure() noexcept {
return [](auto... _Sizes) noexcept {
return [](auto... _Sizes) _STATIC_CALL_OPERATOR noexcept {
using _Common_unsigned_type = _Make_unsigned_like_t<common_type_t<decltype(_Sizes)...>>;
return (_RANGES min)({static_cast<_Common_unsigned_type>(_Sizes)...});
};
@ -8555,7 +8568,8 @@ namespace ranges {
public:
template <class... _Types>
_NODISCARD constexpr auto operator()(_Types&&... _Args) const noexcept(_Is_invocation_noexcept<_Types...>())
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Types&&... _Args) _CONST_CALL_OPERATOR
noexcept(_Is_invocation_noexcept<_Types...>())
requires (sizeof...(_Types) == 0)
|| requires { zip_view<views::all_t<_Types>...>(_STD forward<_Types>(_Args)...); }
{
@ -8890,16 +8904,16 @@ namespace ranges {
struct _Zip_transform_fn {
private:
template <class _Func, class... _Types>
static constexpr bool _Is_invocation_noexcept = []() noexcept {
_NODISCARD static consteval bool _Is_invocation_noexcept() {
if constexpr (sizeof...(_Types) == 0) {
return true;
} else {
return noexcept(zip_transform_view(_STD declval<_Func>(), _STD declval<_Types>()...));
}
}();
}
template <class _Func, class... _Types>
static constexpr bool _Enable_cpo = []() noexcept {
_NODISCARD static consteval bool _Enable_cpo() {
if constexpr (sizeof...(_Types) == 0) {
// This is a more efficient implementation of the CPO requirements listed in
// N4950 [range.zip.transform.overview]/2.1.1.
@ -8914,13 +8928,14 @@ namespace ranges {
zip_transform_view(_STD forward<_Func>(_Function), _STD forward<_Types>(_Args)...);
};
}
}();
}
public:
template <class _Func, class... _Types>
requires _Enable_cpo<_Func, _Types...>
_NODISCARD constexpr auto operator()(_Func&& _Function, _Types&&... _Args) const
noexcept(_Is_invocation_noexcept<_Func, _Types...>) /* strengthened */ {
requires (_Enable_cpo<_Func, _Types...>())
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Func&& _Function, _Types&&... _Args) _CONST_CALL_OPERATOR
noexcept(_Is_invocation_noexcept<_Func, _Types...>()) /* strengthened */ {
if constexpr (sizeof...(_Types) == 0) {
using _Decayed_func = decay_t<_Func>;
return empty_view<decay_t<invoke_result_t<_Decayed_func&>>>{};
@ -9048,7 +9063,8 @@ namespace ranges {
: _Iterator(_Other, make_index_sequence<_Nx>{}) {}
_NODISCARD constexpr auto operator*() const {
return _RANGES _Tuple_transform([](auto& _It) -> decltype(auto) { return *_It; }, _Current);
return _RANGES _Tuple_transform(
[](auto& _It) _STATIC_CALL_OPERATOR -> decltype(auto) { return *_It; }, _Current);
}
constexpr _Iterator& operator++() noexcept(noexcept(++_Current.front())) /* strengthened */ {
@ -9360,7 +9376,7 @@ namespace ranges {
class _Adjacent_fn : public _Pipe::_Base<_Adjacent_fn<_Nx>> {
public:
template <viewable_range _Rng>
_NODISCARD constexpr auto operator()(_Rng&& _Range) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR
noexcept(noexcept(adjacent_view<views::all_t<_Rng>, _Nx>{_STD forward<_Rng>(_Range)}))
requires requires { adjacent_view<views::all_t<_Rng>, _Nx>{_STD forward<_Rng>(_Range)}; }
{
@ -9368,7 +9384,7 @@ namespace ranges {
}
template <viewable_range _Rng>
_NODISCARD constexpr auto operator()(_Rng&&) const noexcept
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&&) _CONST_CALL_OPERATOR noexcept
requires (_Nx == 0)
{
return empty_view<tuple<>>{};
@ -9705,7 +9721,7 @@ namespace ranges {
class _Adjacent_transform_fn {
public:
template <viewable_range _Rng, class _Fn>
_NODISCARD constexpr auto operator()(_Rng&&, _Fn&& _Func) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&&, _Fn&& _Func) _CONST_CALL_OPERATOR
noexcept(noexcept(views::zip_transform(_STD forward<_Fn>(_Func))))
requires (_Nx == 0) && requires { views::zip_transform(_STD forward<_Fn>(_Func)); }
{
@ -9713,7 +9729,7 @@ namespace ranges {
}
template <viewable_range _Rng, class _Fn>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Fn&& _Func) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range, _Fn&& _Func) _CONST_CALL_OPERATOR
noexcept(noexcept(adjacent_transform_view<views::all_t<_Rng>, decay_t<_Fn>, _Nx>(
_STD forward<_Rng>(_Range), _STD forward<_Fn>(_Func))))
requires requires {
@ -9727,7 +9743,7 @@ namespace ranges {
template <class _Fn>
requires constructible_from<decay_t<_Fn>, _Fn>
_NODISCARD constexpr auto operator()(_Fn&& _Func) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Fn&& _Func) _CONST_CALL_OPERATOR
noexcept(is_nothrow_constructible_v<decay_t<_Fn>, _Fn>) {
return _Range_closure<_Adjacent_transform_fn, decay_t<_Fn>>{_STD forward<_Fn>(_Func)};
}
@ -9976,7 +9992,8 @@ namespace ranges {
: _Parent(_It._Parent), _Current(_STD move(_It._Current)) {}
_NODISCARD constexpr auto operator*() const {
return _RANGES _Tuple_transform([](auto& _It) -> decltype(auto) { return *_It; }, _Current);
return _RANGES _Tuple_transform(
[](auto& _It) _STATIC_CALL_OPERATOR -> decltype(auto) { return *_It; }, _Current);
}
constexpr _Iterator& operator++() {
@ -10245,12 +10262,12 @@ namespace ranges {
namespace views {
class _Cartesian_product_fn {
public:
_NODISCARD constexpr auto operator()() const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()() _CONST_CALL_OPERATOR noexcept {
return views::single(tuple{});
}
template <class... _Rngs>
_NODISCARD constexpr auto operator()(_Rngs&&... _Ranges) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rngs&&... _Ranges) _CONST_CALL_OPERATOR
noexcept(noexcept(cartesian_product_view<views::all_t<_Rngs>...>{_STD forward<_Rngs>(_Ranges)...}))
requires requires { cartesian_product_view<views::all_t<_Rngs>...>{_STD forward<_Rngs>(_Ranges)...}; }
{
@ -10331,7 +10348,7 @@ namespace ranges {
_RANGES copy(_Range, _Container_inserter<range_reference_t<_Rng>>(_Cont));
return _Cont;
} else if constexpr (!_Ref_converts<_Rng, _Container> && input_range<range_reference_t<_Rng>>) {
const auto _Xform = [](auto&& _Elem) {
const auto _Xform = [](auto&& _Elem) _STATIC_CALL_OPERATOR {
return _RANGES to<range_value_t<_Container>>(_STD forward<decltype(_Elem)>(_Elem));
};
return _RANGES to<_Container>(views::transform(_Range, _Xform), _STD forward<_Types>(_Args)...);
@ -10348,7 +10365,8 @@ namespace ranges {
_STL_INTERNAL_STATIC_ASSERT(!view<_Container>);
template <input_range _Rng, class... _Types>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Types&&... _Args) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Rng&& _Range, _Types&&... _Args) _CONST_CALL_OPERATOR
requires requires { _RANGES to<_Container>(_STD forward<_Rng>(_Range), _STD forward<_Types>(_Args)...); }
{
return _RANGES to<_Container>(_STD forward<_Rng>(_Range), _STD forward<_Types>(_Args)...);
@ -10406,7 +10424,8 @@ namespace ranges {
struct _To_template_fn {
template <input_range _Rng, class... _Types,
class _Deduced = remove_pointer_t<decltype(_To_helper<_Container, _Rng, _Types...>())>>
_NODISCARD constexpr auto operator()(_Rng&& _Range, _Types&&... _Args) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(
_Rng&& _Range, _Types&&... _Args) _CONST_CALL_OPERATOR {
return _RANGES to<_Deduced>(_STD forward<_Rng>(_Range), _STD forward<_Types>(_Args)...);
}
};

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

@ -179,7 +179,7 @@ template <class _Traits>
struct _Char_traits_eq {
using _Elem = typename _Traits::char_type;
bool operator()(_Elem _Left, _Elem _Right) const noexcept {
_STATIC_CALL_OPERATOR bool operator()(_Elem _Left, _Elem _Right) _CONST_CALL_OPERATOR noexcept {
return _Traits::eq(_Left, _Right);
}
};
@ -188,7 +188,7 @@ template <class _Traits>
struct _Char_traits_lt {
using _Elem = typename _Traits::char_type;
bool operator()(_Elem _Left, _Elem _Right) const noexcept {
_STATIC_CALL_OPERATOR bool operator()(_Elem _Left, _Elem _Right) _CONST_CALL_OPERATOR noexcept {
return _Traits::lt(_Left, _Right);
}
};
@ -210,7 +210,7 @@ struct _Lex_compare_memcmp_classify_pred<_Elem, _Elem, _Char_traits_lt<char_trai
template <class _RxTraits>
struct _Cmp_cs { // functor to compare two character values for equality
using _Elem = typename _RxTraits::char_type;
bool operator()(_Elem _Ex1, _Elem _Ex2) {
_STATIC_CALL_OPERATOR bool operator()(_Elem _Ex1, _Elem _Ex2) _CONST_CALL_OPERATOR {
return _Ex1 == _Ex2;
}
};

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

@ -381,7 +381,7 @@ template <>
struct hash<stacktrace_entry> {
// This is a C++23 feature, so argument_type and result_type are omitted.
_NODISCARD size_t operator()(const stacktrace_entry& _Val) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const stacktrace_entry& _Val) _CONST_CALL_OPERATOR noexcept {
return _Hash_representation(_Val.native_handle());
}
};
@ -390,7 +390,8 @@ template <class _Alloc>
struct hash<basic_stacktrace<_Alloc>> {
// This is a C++23 feature, so argument_type and result_type are omitted.
_NODISCARD size_t operator()(const basic_stacktrace<_Alloc>& _Val) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(
const basic_stacktrace<_Alloc>& _Val) _CONST_CALL_OPERATOR noexcept {
return _Val._Get_hash();
}
};

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

@ -443,7 +443,7 @@ struct hash<error_code> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = error_code;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const error_code& _Keyval) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const error_code& _Keyval) _CONST_CALL_OPERATOR noexcept {
return hash<int>{}(_Keyval.value());
}
};
@ -453,7 +453,7 @@ struct hash<error_condition> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = error_condition;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const error_condition& _Keyval) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const error_condition& _Keyval) _CONST_CALL_OPERATOR noexcept {
return hash<int>{}(_Keyval.value());
}
};

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

@ -329,7 +329,7 @@ struct hash<thread::id> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = thread::id;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const thread::id _Keyval) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const thread::id _Keyval) _CONST_CALL_OPERATOR noexcept {
return _Hash_representation(_Keyval._Id);
}
};

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

@ -2366,7 +2366,7 @@ struct _Conditionally_enabled_hash { // conditionally enabled hash base
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Kty;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const _Kty& _Keyval) const
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const _Kty& _Keyval) _CONST_CALL_OPERATOR
noexcept(noexcept(hash<_Kty>::_Do_hash(_Keyval))) /* strengthened */ {
return hash<_Kty>::_Do_hash(_Keyval);
}
@ -2394,7 +2394,7 @@ template <>
struct hash<float> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = float;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const float _Keyval) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const float _Keyval) _CONST_CALL_OPERATOR noexcept {
return _Hash_representation(_Keyval == 0.0F ? 0.0F : _Keyval); // map -0 to 0
}
};
@ -2403,7 +2403,7 @@ template <>
struct hash<double> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = double;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const double _Keyval) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const double _Keyval) _CONST_CALL_OPERATOR noexcept {
return _Hash_representation(_Keyval == 0.0 ? 0.0 : _Keyval); // map -0 to 0
}
};
@ -2412,7 +2412,7 @@ template <>
struct hash<long double> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = long double;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const long double _Keyval) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const long double _Keyval) _CONST_CALL_OPERATOR noexcept {
return _Hash_representation(_Keyval == 0.0L ? 0.0L : _Keyval); // map -0 to 0
}
};
@ -2421,7 +2421,7 @@ template <>
struct hash<nullptr_t> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = nullptr_t;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(nullptr_t) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(nullptr_t) _CONST_CALL_OPERATOR noexcept {
void* _Null{};
return _Hash_representation(_Null);
}

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

@ -81,7 +81,7 @@ struct hash<type_index> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = type_index;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const type_index& _Keyval) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(const type_index& _Keyval) _CONST_CALL_OPERATOR noexcept {
return _Keyval.hash_code();
}
};

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

@ -1689,7 +1689,7 @@ _CONSTEXPR20 void swap(variant<_Types...>& _Left, variant<_Types...>& _Right) no
struct _Variant_hash_visitor { // visitation function for hashing variants
template <class _Ty, size_t _Idx>
_NODISCARD size_t operator()(_Tagged<const _Ty&, _Idx> _Obj) const
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(_Tagged<const _Ty&, _Idx> _Obj) _CONST_CALL_OPERATOR
noexcept(disjunction_v<bool_constant<_Idx == variant_npos>,
is_nothrow_invocable<hash<_Ty>, const _Ty&>>) { // hash contained value _Obj
if constexpr (_Idx == variant_npos) { // hash a valueless variant
@ -1715,7 +1715,7 @@ struct hash<monostate> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = monostate;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(monostate) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(monostate) _CONST_CALL_OPERATOR noexcept {
return 1729; // Arbitrary value
}
};

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

@ -2259,7 +2259,8 @@ _NODISCARD bool operator!=(const vector<_Ty, _Alloc>& _Left, const vector<_Ty, _
template <class _Ret>
struct _Vbase_compare_three_way {
_NODISCARD constexpr _Ret operator()(const _Vbase _Left, const _Vbase _Right) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _Ret operator()(
const _Vbase _Left, const _Vbase _Right) _CONST_CALL_OPERATOR noexcept {
const _Vbase _Differing_bits = _Left ^ _Right;
if (_Differing_bits == 0) { // improves _Countr_zero codegen below
@ -3563,7 +3564,8 @@ struct hash<vector<bool, _Alloc>> {
using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = vector<bool, _Alloc>;
using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = size_t;
_NODISCARD size_t operator()(const vector<bool, _Alloc>& _Keyval) const noexcept {
_NODISCARD _STATIC_CALL_OPERATOR size_t operator()(
const vector<bool, _Alloc>& _Keyval) _CONST_CALL_OPERATOR noexcept {
return _Hash_array_representation(_Keyval._Myvec.data(), _Keyval._Myvec.size());
}
};

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

@ -3319,7 +3319,7 @@ public:
return _Reallocate_grow_by(
_Count,
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size, const _Elem* const _Ptr,
const size_type _Count) {
const size_type _Count) _STATIC_CALL_OPERATOR {
_Traits::copy(_New_ptr, _Old_ptr, _Old_size);
_Traits::copy(_New_ptr + _Old_size, _Ptr, _Count);
_Traits::assign(_New_ptr[_Old_size + _Count], _Elem());
@ -3346,7 +3346,7 @@ public:
return _Reallocate_grow_by(
_Count,
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size, const size_type _Count,
const _Elem _Ch) {
const _Elem _Ch) _STATIC_CALL_OPERATOR {
_Traits::copy(_New_ptr, _Old_ptr, _Old_size);
_Traits::assign(_New_ptr + _Old_size, _Count, _Ch);
_Traits::assign(_New_ptr[_Old_size + _Count], _Elem());
@ -3424,7 +3424,7 @@ public:
return _Reallocate_for(
_Count,
[](_Elem* const _New_ptr, const size_type _Count, const _Elem* const _Ptr) {
[](_Elem* const _New_ptr, const size_type _Count, const _Elem* const _Ptr) _STATIC_CALL_OPERATOR {
_Traits::copy(_New_ptr, _Ptr, _Count);
_Traits::assign(_New_ptr[_Count], _Elem());
},
@ -3448,7 +3448,7 @@ public:
return _Reallocate_for(
_Count,
[](_Elem* const _New_ptr, const size_type _Count, const _Elem _Ch) {
[](_Elem* const _New_ptr, const size_type _Count, const _Elem _Ch) _STATIC_CALL_OPERATOR {
_Traits::assign(_New_ptr, _Count, _Ch);
_Traits::assign(_New_ptr[_Count], _Elem());
},
@ -3564,7 +3564,7 @@ public:
return _Reallocate_grow_by(
_Count,
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size, const size_type _Off,
const _Elem* const _Ptr, const size_type _Count) {
const _Elem* const _Ptr, const size_type _Count) _STATIC_CALL_OPERATOR {
_Traits::copy(_New_ptr, _Old_ptr, _Off);
_Traits::copy(_New_ptr + _Off, _Ptr, _Count);
_Traits::copy(_New_ptr + _Off + _Count, _Old_ptr + _Off, _Old_size - _Off + 1);
@ -3595,7 +3595,7 @@ public:
return _Reallocate_grow_by(
_Count,
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size, const size_type _Off,
const size_type _Count, const _Elem _Ch) {
const size_type _Count, const _Elem _Ch) _STATIC_CALL_OPERATOR {
_Traits::copy(_New_ptr, _Old_ptr, _Off);
_Traits::assign(_New_ptr + _Off, _Count, _Ch);
_Traits::copy(_New_ptr + _Off + _Count, _Old_ptr + _Off, _Old_size - _Off + 1);
@ -3807,7 +3807,7 @@ public:
return _Reallocate_grow_by(
_Growth,
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size, const size_type _Off,
const size_type _Nx, const _Elem* const _Ptr, const size_type _Count) {
const size_type _Nx, const _Elem* const _Ptr, const size_type _Count) _STATIC_CALL_OPERATOR {
_Traits::copy(_New_ptr, _Old_ptr, _Off);
_Traits::copy(_New_ptr + _Off, _Ptr, _Count);
_Traits::copy(_New_ptr + _Off + _Count, _Old_ptr + _Off + _Nx, _Old_size - _Nx - _Off + 1);
@ -3847,7 +3847,7 @@ public:
return _Reallocate_grow_by(
_Count - _Nx,
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size, const size_type _Off,
const size_type _Nx, const size_type _Count, const _Elem _Ch) {
const size_type _Nx, const size_type _Count, const _Elem _Ch) _STATIC_CALL_OPERATOR {
_Traits::copy(_New_ptr, _Old_ptr, _Off);
_Traits::assign(_New_ptr + _Off, _Count, _Ch);
_Traits::copy(_New_ptr + _Off + _Count, _Old_ptr + _Off + _Nx, _Old_size - _Nx - _Off + 1);
@ -4096,11 +4096,12 @@ public:
_Reallocate_grow_by(
1,
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size, const _Elem _Ch) {
_Traits::copy(_New_ptr, _Old_ptr, _Old_size);
_Traits::assign(_New_ptr[_Old_size], _Ch);
_Traits::assign(_New_ptr[_Old_size + 1], _Elem());
},
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size, const _Elem _Ch)
_STATIC_CALL_OPERATOR {
_Traits::copy(_New_ptr, _Old_ptr, _Old_size);
_Traits::assign(_New_ptr[_Old_size], _Ch);
_Traits::assign(_New_ptr[_Old_size + 1], _Elem());
},
_Ch);
}
@ -4195,9 +4196,8 @@ public:
(_CRT_GUARDOVERFLOW const size_type _New_size, _Operation _Op) {
if (_Mypair._Myval2._Myres < _New_size) {
_Reallocate_grow_by(_New_size - _Mypair._Myval2._Mysize,
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size) {
_Traits::copy(_New_ptr, _Old_ptr, _Old_size + 1);
});
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size)
_STATIC_CALL_OPERATOR { _Traits::copy(_New_ptr, _Old_ptr, _Old_size + 1); });
} else {
_ASAN_STRING_MODIFY(*this, _Mypair._Myval2._Mysize, _New_size);
_Mypair._Myval2._Mysize = _New_size;
@ -4233,10 +4233,9 @@ public:
}
const size_type _Old_size = _Mypair._Myval2._Mysize;
_Reallocate_grow_by(
_Newcap - _Old_size, [](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size) {
_Traits::copy(_New_ptr, _Old_ptr, _Old_size + 1);
});
_Reallocate_grow_by(_Newcap - _Old_size,
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size)
_STATIC_CALL_OPERATOR { _Traits::copy(_New_ptr, _Old_ptr, _Old_size + 1); });
_Mypair._Myval2._Mysize = _Old_size;
}
@ -4258,10 +4257,9 @@ public:
if (_Mypair._Myval2._Myres < _Newcap) { // reallocate to grow
const size_type _Old_size = _Mypair._Myval2._Mysize;
_Reallocate_grow_by(
_Newcap - _Old_size, [](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size) {
_Traits::copy(_New_ptr, _Old_ptr, _Old_size + 1);
});
_Reallocate_grow_by(_Newcap - _Old_size,
[](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size)
_STATIC_CALL_OPERATOR { _Traits::copy(_New_ptr, _Old_ptr, _Old_size + 1); });
_Mypair._Myval2._Mysize = _Old_size;
return;

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

@ -637,7 +637,8 @@ namespace ranges {
public:
template <class _Ty>
requires (_Choice<_Ty>._Strategy != _St::_None)
_NODISCARD constexpr decltype(auto) operator()(_Ty && _Val) const noexcept(_Choice<_Ty>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr decltype(auto) operator()(_Ty && _Val) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty>._No_throw) {
constexpr _St _Strat = _Choice<_Ty>._Strategy;
if constexpr (_Strat == _St::_Custom) {
@ -978,7 +979,8 @@ namespace ranges {
public:
template <class _Ty1, class _Ty2>
requires (_Choice<_Ty1, _Ty2>._Strategy != _St::_None)
constexpr void operator()(_Ty1&& _Val1, _Ty2&& _Val2) const noexcept(_Choice<_Ty1, _Ty2>._No_throw) {
_STATIC_CALL_OPERATOR constexpr void operator()(_Ty1&& _Val1, _Ty2&& _Val2) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty1, _Ty2>._No_throw) {
constexpr _St _Strat = _Choice<_Ty1, _Ty2>._Strategy;
if constexpr (_Strat == _St::_Custom) {
@ -2370,7 +2372,8 @@ namespace ranges {
public:
template <_Should_range_access _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty&>._Strategy;
if constexpr (_Strat == _St::_Array) {
@ -2445,7 +2448,8 @@ namespace ranges {
public:
template <_Should_range_access _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty&>._Strategy;
if constexpr (_Strat == _St::_Array) {
@ -2583,7 +2587,8 @@ namespace ranges {
public:
template <_Should_range_access _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty&>._Strategy;
if constexpr (_Strat == _St::_Member) {
@ -2633,7 +2638,8 @@ namespace ranges {
public:
template <_Should_range_access _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty&>._Strategy;
if constexpr (_Strat == _St::_Member) {
@ -2699,13 +2705,13 @@ namespace ranges {
typename const_iterator<_Begin_on_const<_Ty>>;
const_iterator<_Begin_on_const<_Ty>>{_RANGES begin(_RANGES _Possibly_const_range(_Val))};
}
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR noexcept(
noexcept(const_iterator<_Begin_on_const<_Ty>>{_RANGES begin(_RANGES _Possibly_const_range(_Val))})) {
return const_iterator<_Begin_on_const<_Ty>>{_RANGES begin(_RANGES _Possibly_const_range(_Val))};
}
#else // ^^^ C++23 / C++20 vvv
template <class _Ty, class _CTy = _Const_thru_ref<_Ty>>
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES begin(static_cast<_CTy&&>(_Val))))
requires requires { _RANGES begin(static_cast<_CTy&&>(_Val)); }
{
@ -2729,13 +2735,13 @@ namespace ranges {
typename const_sentinel<_End_on_const<_Ty>>;
const_sentinel<_End_on_const<_Ty>>{_RANGES end(_RANGES _Possibly_const_range(_Val))};
}
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(const_sentinel<_End_on_const<_Ty>>{_RANGES end(_RANGES _Possibly_const_range(_Val))})) {
return const_sentinel<_End_on_const<_Ty>>{_RANGES end(_RANGES _Possibly_const_range(_Val))};
}
#else // ^^^ C++23 / C++20 vvv
template <class _Ty, class _CTy = _Const_thru_ref<_Ty>>
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES end(static_cast<_CTy&&>(_Val))))
requires requires { _RANGES end(static_cast<_CTy&&>(_Val)); }
{
@ -2796,7 +2802,8 @@ namespace ranges {
public:
template <_Should_range_access _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty&>._Strategy;
if constexpr (_Strat == _St::_Member) {
@ -2866,7 +2873,8 @@ namespace ranges {
public:
template <_Should_range_access _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty&>._Strategy;
if constexpr (_Strat == _St::_Member) {
@ -2897,13 +2905,13 @@ namespace ranges {
typename const_iterator<_Rbegin_on_const<_Ty>>;
const_iterator<_Rbegin_on_const<_Ty>>{_RANGES rbegin(_RANGES _Possibly_const_range(_Val))};
}
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR noexcept(
noexcept(const_iterator<_Rbegin_on_const<_Ty>>{_RANGES rbegin(_RANGES _Possibly_const_range(_Val))})) {
return const_iterator<_Rbegin_on_const<_Ty>>{_RANGES rbegin(_RANGES _Possibly_const_range(_Val))};
}
#else // ^^^ C++23 / C++20 vvv
template <class _Ty, class _CTy = _Const_thru_ref<_Ty>>
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES rbegin(static_cast<_CTy&&>(_Val))))
requires requires { _RANGES rbegin(static_cast<_CTy&&>(_Val)); }
{
@ -2927,13 +2935,13 @@ namespace ranges {
typename const_sentinel<_Rend_on_const<_Ty>>;
const_sentinel<_Rend_on_const<_Ty>>{_RANGES rend(_RANGES _Possibly_const_range(_Val))};
}
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(const_sentinel<_Rend_on_const<_Ty>>{_RANGES rend(_RANGES _Possibly_const_range(_Val))})) {
return const_sentinel<_Rend_on_const<_Ty>>{_RANGES rend(_RANGES _Possibly_const_range(_Val))};
}
#else // ^^^ C++23 / C++20 vvv
template <class _Ty, class _CTy = _Const_thru_ref<_Ty>>
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES rend(static_cast<_CTy&&>(_Val))))
requires requires { _RANGES rend(static_cast<_CTy&&>(_Val)); }
{
@ -3006,7 +3014,8 @@ namespace ranges {
public:
template <class _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty&>._Strategy;
if constexpr (_Strat == _St::_Array) {
@ -3071,7 +3080,8 @@ namespace ranges {
public:
template <class _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr bool operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr bool operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty&>._Strategy;
if constexpr (_Strat == _St::_Member) {
@ -3127,7 +3137,8 @@ namespace ranges {
public:
template <_Should_range_access _Ty>
requires (_Choice<_Ty&>._Strategy != _St::_None)
_NODISCARD constexpr auto operator()(_Ty&& _Val) const noexcept(_Choice<_Ty&>._No_throw) {
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(_Choice<_Ty&>._No_throw) {
constexpr _St _Strat = _Choice<_Ty&>._Strategy;
if constexpr (_Strat == _St::_Member) {
@ -3151,13 +3162,13 @@ namespace ranges {
requires requires(_Ty& _Val) { //
_RANGES _As_const_pointer(_RANGES data(_RANGES _Possibly_const_range(_Val)));
}
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES data(_RANGES _Possibly_const_range(_Val)))) {
return _RANGES _As_const_pointer(_RANGES data(_RANGES _Possibly_const_range(_Val)));
}
#else // ^^^ C++23 / C++20 vvv
template <class _Ty, class _CTy = _Const_thru_ref<_Ty>>
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES data(static_cast<_CTy&&>(_Val))))
requires requires { _RANGES data(static_cast<_CTy&&>(_Val)); }
{
@ -3213,7 +3224,7 @@ namespace ranges {
class _Advance_fn {
public:
template <input_or_output_iterator _It>
constexpr void operator()(_It& _Where, iter_difference_t<_It> _Off) const {
_STATIC_CALL_OPERATOR constexpr void operator()(_It& _Where, iter_difference_t<_It> _Off) _CONST_CALL_OPERATOR {
if constexpr (random_access_iterator<_It>) {
_Where += _Off;
} else {
@ -3241,11 +3252,11 @@ namespace ranges {
}
template <input_or_output_iterator _It, sentinel_for<_It> _Se>
constexpr void operator()(_It& _Where, _Se _Last) const {
_STATIC_CALL_OPERATOR constexpr void operator()(_It& _Where, _Se _Last) _CONST_CALL_OPERATOR {
if constexpr (assignable_from<_It&, _Se>) {
_Where = static_cast<_Se&&>(_Last);
} else if constexpr (sized_sentinel_for<_Se, _It>) {
(*this)(_Where, _Last - _Where);
operator()(_Where, _Last - _Where);
} else {
_Adl_verify_range(_Where, _Last);
@ -3264,19 +3275,20 @@ namespace ranges {
}
template <input_or_output_iterator _It, sentinel_for<_It> _Se>
constexpr iter_difference_t<_It> operator()(_It& _Where, iter_difference_t<_It> _Off, _Se _Last) const {
_STATIC_CALL_OPERATOR constexpr iter_difference_t<_It> operator()(
_It& _Where, iter_difference_t<_It> _Off, _Se _Last) _CONST_CALL_OPERATOR {
if constexpr (sized_sentinel_for<_Se, _It>) {
const iter_difference_t<_It> _Delta = _Last - _Where;
if ((_Off < 0 && _Off <= _Delta) || (_Off > 0 && _Off >= _Delta)) {
if constexpr (assignable_from<_It&, _Se>) {
_Where = static_cast<_Se&&>(_Last);
} else {
(*this)(_Where, _Delta);
operator()(_Where, _Delta);
}
return _Off - _Delta;
}
(*this)(_Where, _Off);
operator()(_Where, _Off);
return 0;
} else {
// performance note: develop unwrapping technology for (i, n, s)?
@ -3303,22 +3315,23 @@ namespace ranges {
public:
template <class _It, sentinel_for<_It> _Se>
requires (!sized_sentinel_for<_Se, _It>)
_NODISCARD constexpr iter_difference_t<_It> operator()(_It _First, _Se _Last) const
noexcept(noexcept(_Distance_unchecked(
_Get_unwrapped(_STD move(_First)), _Get_unwrapped(_STD move(_Last))))) /* strengthened */ {
_NODISCARD _STATIC_CALL_OPERATOR constexpr iter_difference_t<_It> operator()(_It _First,
_Se _Last) _CONST_CALL_OPERATOR noexcept(noexcept(_Distance_unchecked(_Get_unwrapped(_STD move(_First)),
_Get_unwrapped(_STD move(_Last))))) /* strengthened */ {
_Adl_verify_range(_First, _Last);
return _Distance_unchecked(_Unwrap_iter<_Se>(_STD move(_First)), _Unwrap_sent<_It>(_STD move(_Last)));
}
template <class _It, sized_sentinel_for<decay_t<_It>> _Se>
_NODISCARD constexpr iter_difference_t<decay_t<_It>> operator()(_It&& _First, const _Se _Last) const
_NODISCARD _STATIC_CALL_OPERATOR constexpr iter_difference_t<decay_t<_It>> operator()(
_It&& _First, const _Se _Last) _CONST_CALL_OPERATOR
noexcept(noexcept(_Last - static_cast<const decay_t<_It>&>(_First))) /* strengthened */ {
return _Last - static_cast<const decay_t<_It>&>(_First);
}
template <range _Rng>
_NODISCARD constexpr range_difference_t<_Rng> operator()(_Rng&& _Range) const
noexcept(_Nothrow_size<_Rng>) /* strengthened */ {
_NODISCARD _STATIC_CALL_OPERATOR constexpr range_difference_t<_Rng> operator()(
_Rng&& _Range) _CONST_CALL_OPERATOR noexcept(_Nothrow_size<_Rng>) /* strengthened */ {
if constexpr (sized_range<_Rng>) {
return static_cast<range_difference_t<_Rng>>(_RANGES size(_Range));
} else {
@ -3353,7 +3366,8 @@ namespace ranges {
class _Ssize_fn {
public:
template <class _Rng>
_NODISCARD constexpr auto operator()(_Rng&& _Range) const noexcept(noexcept(_RANGES size(_Range)))
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Rng&& _Range) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES size(_Range)))
requires requires { _RANGES size(_Range); }
{
using _Sty = _Make_signed_like_t<decltype(_RANGES size(_Range))>;
@ -3369,25 +3383,27 @@ namespace ranges {
class _Next_fn {
public:
template <input_or_output_iterator _It>
_NODISCARD constexpr _It operator()(_It _Where) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(_It _Where) _CONST_CALL_OPERATOR {
++_Where;
return _Where;
}
template <input_or_output_iterator _It>
_NODISCARD constexpr _It operator()(_It _Where, const iter_difference_t<_It> _Off) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(
_It _Where, const iter_difference_t<_It> _Off) _CONST_CALL_OPERATOR {
_RANGES advance(_Where, _Off);
return _Where;
}
template <input_or_output_iterator _It, sentinel_for<_It> _Se>
_NODISCARD constexpr _It operator()(_It _Where, _Se _Last) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(_It _Where, _Se _Last) _CONST_CALL_OPERATOR {
_RANGES advance(_Where, static_cast<_Se&&>(_Last));
return _Where;
}
template <input_or_output_iterator _It, sentinel_for<_It> _Se>
_NODISCARD constexpr _It operator()(_It _Where, const iter_difference_t<_It> _Off, _Se _Last) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(
_It _Where, const iter_difference_t<_It> _Off, _Se _Last) _CONST_CALL_OPERATOR {
_RANGES advance(_Where, _Off, static_cast<_Se&&>(_Last));
return _Where;
}
@ -3398,20 +3414,22 @@ namespace ranges {
class _Prev_fn {
public:
template <bidirectional_iterator _It>
_NODISCARD constexpr _It operator()(_It _Where) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(_It _Where) _CONST_CALL_OPERATOR {
--_Where;
return _Where;
}
template <bidirectional_iterator _It>
_NODISCARD constexpr _It operator()(_It _Where, const iter_difference_t<_It> _Off) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(
_It _Where, const iter_difference_t<_It> _Off) _CONST_CALL_OPERATOR {
_STL_ASSERT(_Off != _Min_possible_v<iter_difference_t<_It>>, "integer overflow");
_RANGES advance(_Where, -_Off);
return _Where;
}
template <bidirectional_iterator _It>
_NODISCARD constexpr _It operator()(_It _Where, const iter_difference_t<_It> _Off, _It _Last) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(
_It _Where, const iter_difference_t<_It> _Off, _It _Last) _CONST_CALL_OPERATOR {
_STL_ASSERT(_Off != _Min_possible_v<iter_difference_t<_It>>, "integer overflow");
_RANGES advance(_Where, -_Off, static_cast<_It&&>(_Last));
return _Where;
@ -4712,7 +4730,8 @@ namespace ranges {
public:
template <input_iterator _It, sentinel_for<_It> _Se, weakly_incrementable _Out>
requires indirectly_copyable<_It, _Out>
constexpr copy_result<_It, _Out> operator()(_It _First, _Se _Last, _Out _Result) const {
_STATIC_CALL_OPERATOR constexpr copy_result<_It, _Out> operator()(
_It _First, _Se _Last, _Out _Result) _CONST_CALL_OPERATOR {
_STD _Adl_verify_range(_First, _Last);
auto _UResult = _RANGES _Copy_unchecked(_RANGES _Unwrap_iter<_Se>(_STD move(_First)),
_RANGES _Unwrap_sent<_It>(_STD move(_Last)), _STD move(_Result));
@ -4722,7 +4741,8 @@ namespace ranges {
template <input_range _Rng, weakly_incrementable _Out>
requires indirectly_copyable<iterator_t<_Rng>, _Out>
constexpr copy_result<borrowed_iterator_t<_Rng>, _Out> operator()(_Rng&& _Range, _Out _Result) const {
_STATIC_CALL_OPERATOR constexpr copy_result<borrowed_iterator_t<_Rng>, _Out> operator()(
_Rng&& _Range, _Out _Result) _CONST_CALL_OPERATOR {
auto _First = _RANGES begin(_Range);
auto _UResult = _RANGES _Copy_unchecked(
_RANGES _Unwrap_range_iter<_Rng>(_STD move(_First)), _Uend(_Range), _STD move(_Result));
@ -5082,7 +5102,8 @@ namespace ranges {
class _Fill_n_fn {
public:
template <class _Ty, output_iterator<const _Ty&> _It>
constexpr _It operator()(_It _First, iter_difference_t<_It> _Count, const _Ty& _Value) const {
_STATIC_CALL_OPERATOR constexpr _It operator()(
_It _First, iter_difference_t<_It> _Count, const _Ty& _Value) _CONST_CALL_OPERATOR {
if (_Count > 0) {
auto _UFirst = _STD _Get_unwrapped_n(_STD move(_First), _Count);
if (!_STD is_constant_evaluated()) {
@ -5383,8 +5404,8 @@ namespace ranges {
template <input_iterator _It1, sentinel_for<_It1> _Se1, input_iterator _It2, sentinel_for<_It2> _Se2,
class _Pr = ranges::equal_to, class _Pj1 = identity, class _Pj2 = identity>
requires indirectly_comparable<_It1, _It2, _Pr, _Pj1, _Pj2>
_NODISCARD constexpr mismatch_result<_It1, _It2> operator()(_It1 _First1, _Se1 _Last1, _It2 _First2,
_Se2 _Last2, _Pr _Pred = {}, _Pj1 _Proj1 = {}, _Pj2 _Proj2 = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr mismatch_result<_It1, _It2> operator()(_It1 _First1, _Se1 _Last1,
_It2 _First2, _Se2 _Last2, _Pr _Pred = {}, _Pj1 _Proj1 = {}, _Pj2 _Proj2 = {}) _CONST_CALL_OPERATOR {
_STD _Adl_verify_range(_First1, _Last1);
_STD _Adl_verify_range(_First2, _Last2);
@ -5415,8 +5436,10 @@ namespace ranges {
template <input_range _Rng1, input_range _Rng2, class _Pr = ranges::equal_to, class _Pj1 = identity,
class _Pj2 = identity>
requires indirectly_comparable<iterator_t<_Rng1>, iterator_t<_Rng2>, _Pr, _Pj1, _Pj2>
_NODISCARD constexpr mismatch_result<borrowed_iterator_t<_Rng1>, borrowed_iterator_t<_Rng2>> operator()(
_Rng1&& _Range1, _Rng2&& _Range2, _Pr _Pred = {}, _Pj1 _Proj1 = {}, _Pj2 _Proj2 = {}) const {
_NODISCARD
_STATIC_CALL_OPERATOR constexpr mismatch_result<borrowed_iterator_t<_Rng1>, borrowed_iterator_t<_Rng2>>
operator()(_Rng1&& _Range1, _Rng2&& _Range2, _Pr _Pred = {}, _Pj1 _Proj1 = {},
_Pj2 _Proj2 = {}) _CONST_CALL_OPERATOR {
if constexpr (sized_range<_Rng1> && sized_range<_Rng2>) {
range_difference_t<_Rng1> _Count1 = _RANGES distance(_Range1);
const range_difference_t<_Rng2> _Count2 = _RANGES distance(_Range2);
@ -5897,7 +5920,8 @@ namespace ranges {
public:
template <input_iterator _It, sentinel_for<_It> _Se, class _Ty, class _Pj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<_It, _Pj>, const _Ty*>
_NODISCARD constexpr _It operator()(_It _First, _Se _Last, const _Ty& _Val, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(
_It _First, _Se _Last, const _Ty& _Val, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
_STD _Adl_verify_range(_First, _Last);
auto _UResult = _RANGES _Find_unchecked(_RANGES _Unwrap_iter<_Se>(_STD move(_First)),
_RANGES _Unwrap_sent<_It>(_STD move(_Last)), _Val, _STD _Pass_fn(_Proj));
@ -5908,8 +5932,8 @@ namespace ranges {
template <input_range _Rng, class _Ty, class _Pj = identity>
requires indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Rng>, _Pj>, const _Ty*>
_NODISCARD constexpr borrowed_iterator_t<_Rng> operator()(
_Rng&& _Range, const _Ty& _Val, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr borrowed_iterator_t<_Rng> operator()(
_Rng&& _Range, const _Ty& _Val, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
auto _First = _RANGES begin(_Range);
auto _UResult = _RANGES _Find_unchecked(
_RANGES _Unwrap_range_iter<_Rng>(_STD move(_First)), _Uend(_Range), _Val, _STD _Pass_fn(_Proj));
@ -6316,7 +6340,8 @@ namespace ranges {
public:
template <input_iterator _It, sentinel_for<_It> _Se, class _Pj = identity,
indirect_unary_predicate<projected<_It, _Pj>> _Pr>
_NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(
_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
_STD _Adl_verify_range(_First, _Last);
auto _UResult = _RANGES _Find_if_unchecked(_RANGES _Unwrap_iter<_Se>(_STD move(_First)),
_RANGES _Unwrap_sent<_It>(_STD move(_Last)), _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj));
@ -6327,7 +6352,8 @@ namespace ranges {
template <input_range _Rng, class _Pj = identity,
indirect_unary_predicate<projected<iterator_t<_Rng>, _Pj>> _Pr>
_NODISCARD constexpr borrowed_iterator_t<_Rng> operator()(_Rng&& _Range, _Pr _Pred, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr borrowed_iterator_t<_Rng> operator()(
_Rng&& _Range, _Pr _Pred, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
auto _First = _RANGES begin(_Range);
auto _UResult = _RANGES _Find_if_unchecked(_RANGES _Unwrap_range_iter<_Rng>(_STD move(_First)),
_Uend(_Range), _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj));
@ -6343,7 +6369,8 @@ namespace ranges {
public:
template <input_iterator _It, sentinel_for<_It> _Se, class _Pj = identity,
indirect_unary_predicate<projected<_It, _Pj>> _Pr>
_NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(
_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
_STD _Adl_verify_range(_First, _Last);
auto _UResult = _Find_if_not_unchecked(_RANGES _Unwrap_iter<_Se>(_STD move(_First)),
@ -6355,7 +6382,8 @@ namespace ranges {
template <input_range _Rng, class _Pj = identity,
indirect_unary_predicate<projected<iterator_t<_Rng>, _Pj>> _Pr>
_NODISCARD constexpr borrowed_iterator_t<_Rng> operator()(_Rng&& _Range, _Pr _Pred, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr borrowed_iterator_t<_Rng> operator()(
_Rng&& _Range, _Pr _Pred, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
auto _First = _RANGES begin(_Range);
auto _UResult = _Find_if_not_unchecked(_RANGES _Unwrap_range_iter<_Rng>(_STD move(_First)), _Uend(_Range),
@ -6388,7 +6416,8 @@ namespace ranges {
public:
template <forward_iterator _It, sentinel_for<_It> _Se, class _Pj = identity,
indirect_binary_predicate<projected<_It, _Pj>, projected<_It, _Pj>> _Pr = ranges::equal_to>
_NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(
_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
_STD _Adl_verify_range(_First, _Last);
auto _UResult = _Adjacent_find_unchecked(_RANGES _Unwrap_iter<_Se>(_STD move(_First)),
@ -6401,7 +6430,8 @@ namespace ranges {
template <forward_range _Rng, class _Pj = identity,
indirect_binary_predicate<projected<iterator_t<_Rng>, _Pj>, projected<iterator_t<_Rng>, _Pj>> _Pr =
ranges::equal_to>
_NODISCARD constexpr borrowed_iterator_t<_Rng> operator()(_Rng&& _Range, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr borrowed_iterator_t<_Rng> operator()(
_Rng&& _Range, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
auto _UResult =
_Adjacent_find_unchecked(_Ubegin(_Range), _Uend(_Range), _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj));
@ -6477,8 +6507,8 @@ namespace ranges {
template <forward_iterator _It1, sentinel_for<_It1> _Se1, forward_iterator _It2, sentinel_for<_It2> _Se2,
class _Pr = ranges::equal_to, class _Pj1 = identity, class _Pj2 = identity>
requires indirectly_comparable<_It1, _It2, _Pr, _Pj1, _Pj2>
_NODISCARD constexpr subrange<_It1> operator()(_It1 _First1, _Se1 _Last1, _It2 _First2, _Se2 _Last2,
_Pr _Pred = {}, _Pj1 _Proj1 = {}, _Pj2 _Proj2 = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr subrange<_It1> operator()(_It1 _First1, _Se1 _Last1, _It2 _First2,
_Se2 _Last2, _Pr _Pred = {}, _Pj1 _Proj1 = {}, _Pj2 _Proj2 = {}) _CONST_CALL_OPERATOR {
_STD _Adl_verify_range(_First1, _Last1);
_STD _Adl_verify_range(_First2, _Last2);
auto _UFirst1 = _RANGES _Unwrap_iter<_Se1>(_STD move(_First1));
@ -6502,8 +6532,8 @@ namespace ranges {
template <forward_range _Rng1, forward_range _Rng2, class _Pr = ranges::equal_to, class _Pj1 = identity,
class _Pj2 = identity>
requires indirectly_comparable<iterator_t<_Rng1>, iterator_t<_Rng2>, _Pr, _Pj1, _Pj2>
_NODISCARD constexpr borrowed_subrange_t<_Rng1> operator()(
_Rng1&& _Range1, _Rng2&& _Range2, _Pr _Pred = {}, _Pj1 _Proj1 = {}, _Pj2 _Proj2 = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr borrowed_subrange_t<_Rng1> operator()(
_Rng1&& _Range1, _Rng2&& _Range2, _Pr _Pred = {}, _Pj1 _Proj1 = {}, _Pj2 _Proj2 = {}) _CONST_CALL_OPERATOR {
if constexpr (sized_range<_Rng1> && sized_range<_Rng2>) {
const auto _Count1 = _RANGES distance(_Range1);
const auto _Count2 = _RANGES distance(_Range2);
@ -6684,7 +6714,8 @@ namespace ranges {
public:
template <forward_iterator _It, sentinel_for<_It> _Se, class _Pj = identity,
indirect_strict_weak_order<projected<_It, _Pj>> _Pr = ranges::less>
_NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(
_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
_STD _Adl_verify_range(_First, _Last);
_STD _Seek_wrapped(
_First, _RANGES _Max_element_unchecked(_RANGES _Unwrap_iter<_Se>(_STD move(_First)),
@ -6694,7 +6725,8 @@ namespace ranges {
template <forward_range _Rng, class _Pj = identity,
indirect_strict_weak_order<projected<iterator_t<_Rng>, _Pj>> _Pr = ranges::less>
_NODISCARD constexpr borrowed_iterator_t<_Rng> operator()(_Rng&& _Range, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr borrowed_iterator_t<_Rng> operator()(
_Rng&& _Range, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
auto _UResult = _RANGES _Max_element_unchecked(
_Ubegin(_Range), _Uend(_Range), _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj));
return _RANGES _Rewrap_iterator(_Range, _STD move(_UResult));
@ -6731,8 +6763,8 @@ namespace ranges {
public:
template <class _Ty, class _Pj = identity,
indirect_strict_weak_order<projected<const _Ty*, _Pj>> _Pr = ranges::less>
_NODISCARD constexpr const _Ty& operator()(
const _Ty& _Left, const _Ty& _Right, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr const _Ty& operator()(
const _Ty& _Left, const _Ty& _Right, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
if (_STD invoke(_Pred, _STD invoke(_Proj, _Left), _STD invoke(_Proj, _Right))) {
return _Right;
} else {
@ -6742,7 +6774,8 @@ namespace ranges {
template <copyable _Ty, class _Pj = identity,
indirect_strict_weak_order<projected<const _Ty*, _Pj>> _Pr = ranges::less>
_NODISCARD constexpr _Ty operator()(initializer_list<_Ty> _Range, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _Ty operator()(
initializer_list<_Ty> _Range, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
const auto _First = _Range.begin();
const auto _Last = _Range.end();
_STL_ASSERT(_First != _Last,
@ -6753,7 +6786,8 @@ namespace ranges {
template <input_range _Rng, class _Pj = identity,
indirect_strict_weak_order<projected<iterator_t<_Rng>, _Pj>> _Pr = ranges::less>
requires indirectly_copyable_storable<iterator_t<_Rng>, range_value_t<_Rng>*>
_NODISCARD constexpr range_value_t<_Rng> operator()(_Rng&& _Range, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr range_value_t<_Rng> operator()(
_Rng&& _Range, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
auto _UFirst = _Ubegin(_Range);
auto _ULast = _Uend(_Range);
_STL_ASSERT(
@ -6878,7 +6912,8 @@ namespace ranges {
public:
template <forward_iterator _It, sentinel_for<_It> _Se, class _Pj = identity,
indirect_strict_weak_order<projected<_It, _Pj>> _Pr = ranges::less>
_NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _It operator()(
_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
_STD _Adl_verify_range(_First, _Last);
_STD _Seek_wrapped(
_First, _RANGES _Min_element_unchecked(_RANGES _Unwrap_iter<_Se>(_STD move(_First)),
@ -6888,7 +6923,8 @@ namespace ranges {
template <forward_range _Rng, class _Pj = identity,
indirect_strict_weak_order<projected<iterator_t<_Rng>, _Pj>> _Pr = ranges::less>
_NODISCARD constexpr borrowed_iterator_t<_Rng> operator()(_Rng&& _Range, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr borrowed_iterator_t<_Rng> operator()(
_Rng&& _Range, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
auto _UResult = _RANGES _Min_element_unchecked(
_Ubegin(_Range), _Uend(_Range), _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj));
return _RANGES _Rewrap_iterator(_Range, _STD move(_UResult));
@ -6919,8 +6955,8 @@ namespace ranges {
public:
template <class _Ty, class _Pj = identity,
indirect_strict_weak_order<projected<const _Ty*, _Pj>> _Pr = ranges::less>
_NODISCARD constexpr const _Ty& operator()(
const _Ty& _Left, const _Ty& _Right, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr const _Ty& operator()(
const _Ty& _Left, const _Ty& _Right, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
if (_STD invoke(_Pred, _STD invoke(_Proj, _Right), _STD invoke(_Proj, _Left))) {
return _Right;
} else {
@ -6930,7 +6966,8 @@ namespace ranges {
template <copyable _Ty, class _Pj = identity,
indirect_strict_weak_order<projected<const _Ty*, _Pj>> _Pr = ranges::less>
_NODISCARD constexpr _Ty operator()(initializer_list<_Ty> _Range, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr _Ty operator()(
initializer_list<_Ty> _Range, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
const auto _First = _Range.begin();
const auto _Last = _Range.end();
_STL_ASSERT(_First != _Last,
@ -6941,7 +6978,8 @@ namespace ranges {
template <input_range _Rng, class _Pj = identity,
indirect_strict_weak_order<projected<iterator_t<_Rng>, _Pj>> _Pr = ranges::less>
requires indirectly_copyable_storable<iterator_t<_Rng>, range_value_t<_Rng>*>
_NODISCARD constexpr range_value_t<_Rng> operator()(_Rng&& _Range, _Pr _Pred = {}, _Pj _Proj = {}) const {
_NODISCARD _STATIC_CALL_OPERATOR constexpr range_value_t<_Rng> operator()(
_Rng&& _Range, _Pr _Pred = {}, _Pj _Proj = {}) _CONST_CALL_OPERATOR {
auto _UFirst = _Ubegin(_Range);
auto _ULast = _Uend(_Range);
_STL_ASSERT(

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

@ -823,6 +823,7 @@
// warning: constexpr if is a C++17 extension [-Wc++17-extensions]
// warning: explicit(bool) is a C++20 extension [-Wc++20-extensions]
// warning: declaring overloaded 'operator()' as 'static' is a C++23 extension [-Wc++23-extensions]
// warning: ignoring __declspec(allocator) because the function return type '%s' is not a pointer or reference type
// [-Wignored-attributes]
// warning: '#pragma float_control' is not supported on this target - ignored [-Wignored-pragmas]
@ -835,6 +836,7 @@
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \
_Pragma("clang diagnostic ignored \"-Wc++20-extensions\"") \
_Pragma("clang diagnostic ignored \"-Wc++23-extensions\"") \
_Pragma("clang diagnostic ignored \"-Wignored-attributes\"") \
_Pragma("clang diagnostic ignored \"-Wignored-pragmas\"") \
_Pragma("clang diagnostic ignored \"-Wuser-defined-literals\"") \
@ -2024,5 +2026,13 @@ compiler option, or define _ALLOW_RTCc_IN_STL to suppress this error.
#define _STL_INTERNAL_STATIC_ASSERT(...)
#endif // ^^^ !defined(_ENABLE_STL_INTERNAL_CHECK) ^^^
#ifdef __cpp_static_call_operator
#define _STATIC_CALL_OPERATOR static
#define _CONST_CALL_OPERATOR
#else // ^^^ defined(__cpp_static_call_operator) / !defined(__cpp_static_call_operator) vvv
#define _STATIC_CALL_OPERATOR
#define _CONST_CALL_OPERATOR const
#endif // ^^^ !defined(__cpp_static_call_operator) ^^^
#endif // _STL_COMPILER_PREPROCESSOR
#endif // _YVALS_CORE_H_