From 9966fccb38262d7609918901ba6b8ee2afe8f67d Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Fri, 20 Oct 2023 15:43:44 -0700 Subject: [PATCH] Turn niebloids into function objects (#4098) --- stl/inc/algorithm | 527 +++++++++++++++------------------------------- stl/inc/memory | 88 +++----- stl/inc/numeric | 6 +- stl/inc/ranges | 12 +- stl/inc/xutility | 121 +++-------- 5 files changed, 245 insertions(+), 509 deletions(-) diff --git a/stl/inc/algorithm b/stl/inc/algorithm index de393a1ec9..925c5fcfb0 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -318,10 +318,8 @@ namespace ranges { _EXPORT_STD template using for_each_result = in_fun_result<_In, _Fun>; - class _For_each_fn : private _Not_quite_object { + class _For_each_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirectly_unary_invocable> _Fn> constexpr for_each_result<_It, _Fn> operator()(_It _First, _Se _Last, _Fn _Func, _Pj _Proj = {}) const { @@ -363,15 +361,13 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _For_each_fn for_each{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _For_each_fn for_each; _EXPORT_STD template using for_each_n_result = in_fun_result<_In, _Fun>; - class _For_each_n_fn : private _Not_quite_object { + class _For_each_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template > _Fn> constexpr for_each_n_result<_It, _Fn> operator()( _It _First, iter_difference_t<_It> _Count, _Fn _Func, _Pj _Proj = {}) const { @@ -390,7 +386,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _For_each_n_fn for_each_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _For_each_n_fn for_each_n; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -457,10 +453,8 @@ _NODISCARD _FwdIt adjacent_find(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt #ifdef __cpp_lib_concepts namespace ranges { - class _Count_fn : private _Not_quite_object { + class _Count_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, class _Pj = identity> requires indirect_binary_predicate, const _Ty*> _NODISCARD constexpr iter_difference_t<_It> operator()( @@ -511,7 +505,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Count_fn count{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Count_fn count; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -538,10 +532,8 @@ _NODISCARD _Iter_diff_t<_FwdIt> count_if(_ExPo&& _Exec, _FwdIt _First, _FwdIt _L #ifdef __cpp_lib_concepts namespace ranges { - class _Count_if_fn : private _Not_quite_object { + class _Count_if_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> _NODISCARD constexpr iter_difference_t<_It> operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const { @@ -575,7 +567,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Count_if_fn count_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Count_if_fn count_if; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -692,7 +684,7 @@ namespace ranges { return true; } - class _Equal_fn : private _Not_quite_object { + class _Equal_fn { private: template _NODISCARD static constexpr bool _Equal_4( @@ -718,8 +710,6 @@ namespace ranges { } public: - using _Not_quite_object::_Not_quite_object; - template _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> @@ -767,7 +757,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Equal_fn equal{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Equal_fn equal; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -867,10 +857,8 @@ _NODISCARD _CONSTEXPR20 bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _Fw #ifdef __cpp_lib_concepts namespace ranges { - class _Is_permutation_fn : private _Not_quite_object { + class _Is_permutation_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, forward_iterator _It2, sentinel_for<_It2> _Se2, class _Pj1 = identity, class _Pj2 = identity, indirect_equivalence_relation, projected<_It2, _Pj2>> _Pr = ranges::equal_to> @@ -1135,7 +1123,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Is_permutation_fn is_permutation{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_permutation_fn is_permutation; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -1160,10 +1148,8 @@ _NODISCARD bool all_of(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept #ifdef __cpp_lib_concepts namespace ranges { - class _All_of_fn : private _Not_quite_object { + class _All_of_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> _NODISCARD constexpr bool operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const { @@ -1196,7 +1182,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _All_of_fn all_of{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _All_of_fn all_of; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -1222,10 +1208,8 @@ _NODISCARD bool any_of(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept #ifdef __cpp_lib_concepts namespace ranges { - class _Any_of_fn : private _Not_quite_object { + class _Any_of_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> _NODISCARD constexpr bool operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const { @@ -1258,7 +1242,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Any_of_fn any_of{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Any_of_fn any_of; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -1284,10 +1268,8 @@ _NODISCARD bool none_of(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcep #ifdef __cpp_lib_concepts namespace ranges { - class _None_of_fn : private _Not_quite_object { + class _None_of_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> _NODISCARD constexpr bool operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const { @@ -1320,13 +1302,11 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _None_of_fn none_of{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _None_of_fn none_of; #if _HAS_CXX23 - class _Contains_fn : private _Not_quite_object { + class _Contains_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, class _Pj = identity> requires indirect_binary_predicate, const _Ty*> _NODISCARD constexpr bool operator()(_It _First, _Se _Last, const _Ty& _Val, _Pj _Proj = {}) const { @@ -1345,12 +1325,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Contains_fn contains{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Contains_fn contains; - class _Contains_subrange_fn : private _Not_quite_object { + class _Contains_subrange_fn { public: - using _Not_quite_object::_Not_quite_object; - template _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> @@ -1383,16 +1361,14 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Contains_subrange_fn contains_subrange{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Contains_subrange_fn contains_subrange; #endif // _HAS_CXX23 _EXPORT_STD template using copy_n_result = in_out_result<_In, _Out>; - class _Copy_n_fn : private _Not_quite_object { + class _Copy_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template requires indirectly_copyable<_It, _Out> constexpr copy_n_result<_It, _Out> operator()(_It _First, iter_difference_t<_It> _Count, _Out _Result) const { @@ -1415,15 +1391,13 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Copy_n_fn copy_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Copy_n_fn copy_n; _EXPORT_STD template using copy_backward_result = in_out_result<_In, _Out>; - class _Copy_backward_fn : private _Not_quite_object { + class _Copy_backward_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, bidirectional_iterator _It2> requires indirectly_copyable<_It1, _It2> constexpr copy_backward_result<_It1, _It2> operator()(_It1 _First, _Se1 _Last, _It2 _Result) const { @@ -1444,7 +1418,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Copy_backward_fn copy_backward{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Copy_backward_fn copy_backward; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -1481,10 +1455,8 @@ namespace ranges { _EXPORT_STD template using copy_if_result = in_out_result<_In, _Out>; - class _Copy_if_fn : private _Not_quite_object { + class _Copy_if_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out, class _Pj = identity, indirect_unary_predicate> _Pr> requires indirectly_copyable<_It, _Out> @@ -1529,7 +1501,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Copy_if_fn copy_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Copy_if_fn copy_if; _EXPORT_STD template using move_result = in_out_result<_In, _Out>; @@ -1552,10 +1524,8 @@ namespace ranges { return {_STD move(_First), _STD move(_Result)}; } - class _Move_fn : private _Not_quite_object { + class _Move_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out> requires indirectly_movable<_It, _Out> constexpr move_result<_It, _Out> operator()(_It _First, _Se _Last, _Out _Result) const { @@ -1579,7 +1549,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Move_fn move{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Move_fn move; _EXPORT_STD template using move_backward_result = in_out_result<_In, _Out>; @@ -1601,10 +1571,8 @@ namespace ranges { return _Result; } - class _Move_backward_fn : private _Not_quite_object { + class _Move_backward_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, bidirectional_iterator _It2> requires indirectly_movable<_It1, _It2> constexpr move_backward_result<_It1, _It2> operator()(_It1 _First, _Se1 _Last, _It2 _Result) const { @@ -1625,7 +1593,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Move_backward_fn move_backward{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Move_backward_fn move_backward; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -1671,10 +1639,8 @@ namespace ranges { _EXPORT_STD template using partition_copy_result = in_out_out_result<_In, _Out1, _Out2>; - class _Partition_copy_fn : private _Not_quite_object { + class _Partition_copy_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out1, weakly_incrementable _Out2, class _Pj = identity, indirect_unary_predicate> _Pr> requires indirectly_copyable<_It, _Out1> && indirectly_copyable<_It, _Out2> @@ -1730,7 +1696,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Partition_copy_fn partition_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Partition_copy_fn partition_copy; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -1768,10 +1734,8 @@ _NODISCARD bool is_partitioned(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) #ifdef __cpp_lib_concepts namespace ranges { - class _Is_partitioned_fn : private _Not_quite_object { + class _Is_partitioned_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> _NODISCARD constexpr bool operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const { @@ -1814,7 +1778,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Is_partitioned_fn is_partitioned{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_partitioned_fn is_partitioned; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -1844,10 +1808,8 @@ _NODISCARD _CONSTEXPR20 _FwdIt partition_point(_FwdIt _First, _FwdIt _Last, _Pr #ifdef __cpp_lib_concepts namespace ranges { - class _Partition_point_fn : private _Not_quite_object { + class _Partition_point_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> _NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const { @@ -1936,7 +1898,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Partition_point_fn partition_point{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Partition_point_fn partition_point; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -2129,10 +2091,8 @@ _NODISCARD _FwdIt search_n(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Las #ifdef __cpp_lib_concepts namespace ranges { - class _Search_n_fn : private _Not_quite_object { + class _Search_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, class _Pr = ranges::equal_to, class _Pj = identity> requires indirectly_comparable<_It, const _Ty*, _Pr, _Pj> @@ -2284,13 +2244,11 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Search_n_fn search_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Search_n_fn search_n; #if _HAS_CXX23 - class _Starts_with_fn : private _Not_quite_object { + class _Starts_with_fn { public: - using _Not_quite_object::_Not_quite_object; - template _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> @@ -2345,12 +2303,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Starts_with_fn starts_with{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Starts_with_fn starts_with; - class _Ends_with_fn : private _Not_quite_object { + class _Ends_with_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, input_iterator _It2, sentinel_for<_It2> _Se2, class _Pr = ranges::equal_to, class _Pj1 = identity, class _Pj2 = identity> requires (forward_iterator<_It1> || sized_sentinel_for<_Se1, _It1>) @@ -2568,7 +2524,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Ends_with_fn ends_with{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Ends_with_fn ends_with; template class _Flipped { @@ -2603,10 +2559,8 @@ namespace ranges { _EXPORT_STD template using fold_left_first_with_iter_result = in_value_result<_It, _Ty>; - class _Fold_left_with_iter_fn : private _Not_quite_object { + class _Fold_left_with_iter_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, _Indirectly_binary_left_foldable<_Ty, _It> _Fn> _NODISCARD constexpr auto operator()(_It _First, _Se _Last, _Ty _Init, _Fn _Func) const { _Adl_verify_range(_First, _Last); @@ -2647,12 +2601,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Fold_left_with_iter_fn fold_left_with_iter{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Fold_left_with_iter_fn fold_left_with_iter; - class _Fold_left_fn : private _Not_quite_object { + class _Fold_left_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, _Indirectly_binary_left_foldable<_Ty, _It> _Fn> _NODISCARD constexpr auto operator()(_It _First, _Se _Last, _Ty _Init, _Fn _Func) const { return _RANGES fold_left_with_iter(_STD move(_First), _Last, _STD move(_Init), _Pass_fn(_Func)).value; @@ -2664,12 +2616,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Fold_left_fn fold_left{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Fold_left_fn fold_left; - class _Fold_left_first_with_iter_fn : private _Not_quite_object { + class _Fold_left_first_with_iter_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, _Indirectly_binary_left_foldable, _It> _Fn> requires constructible_from, iter_reference_t<_It>> @@ -2714,13 +2664,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Fold_left_first_with_iter_fn fold_left_first_with_iter{ - _Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Fold_left_first_with_iter_fn fold_left_first_with_iter; - class _Fold_left_first_fn : private _Not_quite_object { + class _Fold_left_first_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, _Indirectly_binary_left_foldable, _It> _Fn> requires constructible_from, iter_reference_t<_It>> @@ -2735,7 +2682,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Fold_left_first_fn fold_left_first{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Fold_left_first_fn fold_left_first; template _NODISCARD constexpr auto _Fold_right_unchecked(_It _First, _Se _Last, _Ty _Init, _Fn _Func) { @@ -2756,10 +2703,8 @@ namespace ranges { } } - class _Fold_right_fn : private _Not_quite_object { + class _Fold_right_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, _Indirectly_binary_right_foldable<_Ty, _It> _Fn> _NODISCARD constexpr auto operator()(_It _First, _Se _Last, _Ty _Init, _Fn _Func) const { @@ -2774,12 +2719,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Fold_right_fn fold_right{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Fold_right_fn fold_right; - class _Fold_right_last_fn : private _Not_quite_object { + class _Fold_right_last_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, _Indirectly_binary_right_foldable, _It> _Fn> requires constructible_from, iter_reference_t<_It>> @@ -2815,12 +2758,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Fold_right_last_fn fold_right_last{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Fold_right_last_fn fold_right_last; - class _Find_last_fn : private _Not_quite_object { + class _Find_last_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, class _Pj = identity> requires indirect_binary_predicate, const _Ty*> _NODISCARD constexpr subrange<_It> operator()(_It _First, _Se _Last, const _Ty& _Value, _Pj _Proj = {}) const { @@ -2914,13 +2855,11 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Find_last_fn find_last{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Find_last_fn find_last; template - class _Find_last_if_fn : private _Not_quite_object { + class _Find_last_if_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> _NODISCARD constexpr subrange<_It> operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const { @@ -2997,8 +2936,8 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Find_last_if_fn find_last_if{_Not_quite_object::_Construct_tag{}}; - _EXPORT_STD inline constexpr _Find_last_if_fn find_last_if_not{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Find_last_if_fn find_last_if; + _EXPORT_STD inline constexpr _Find_last_if_fn find_last_if_not; #endif // _HAS_CXX23 } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -3105,7 +3044,7 @@ _NODISCARD _FwdIt1 find_end(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _Fwd #ifdef __cpp_lib_concepts namespace ranges { - class _Find_end_fn : private _Not_quite_object { + class _Find_end_fn { private: template _NODISCARD static constexpr subrange<_It1> _Random_access_sized_ranges(_It1 _First1, @@ -3208,8 +3147,6 @@ namespace ranges { } public: - using _Not_quite_object::_Not_quite_object; - template _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> @@ -3262,7 +3199,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Find_end_fn find_end{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Find_end_fn find_end; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -3309,10 +3246,8 @@ _NODISCARD _FwdIt1 find_first_of(_ExPo&& _Exec, const _FwdIt1 _First1, const _Fw #ifdef __cpp_lib_concepts namespace ranges { - class _Find_first_of_fn : private _Not_quite_object { + class _Find_first_of_fn { public: - using _Not_quite_object::_Not_quite_object; - template _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> @@ -3365,15 +3300,13 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Find_first_of_fn find_first_of{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Find_first_of_fn find_first_of; _EXPORT_STD template using swap_ranges_result = in_in_result<_In1, _In2>; - class _Swap_ranges_fn : private _Not_quite_object { + class _Swap_ranges_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, input_iterator _It2, sentinel_for<_It2> _Se2> requires indirectly_swappable<_It1, _It2> constexpr swap_ranges_result<_It1, _It2> operator()( @@ -3457,7 +3390,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Swap_ranges_fn swap_ranges{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Swap_ranges_fn swap_ranges; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -3542,10 +3475,8 @@ namespace ranges { _EXPORT_STD template using binary_transform_result = in_in_out_result<_In1, _In2, _Out>; - class _Transform_fn : private _Not_quite_object { + class _Transform_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out, copy_constructible _Fn, class _Pj = identity> requires indirectly_writable<_Out, indirect_result_t<_Fn&, projected<_It, _Pj>>> @@ -3639,7 +3570,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Transform_fn transform{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Transform_fn transform; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -3664,10 +3595,8 @@ void replace(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, const _Ty& _Oldval, #ifdef __cpp_lib_concepts namespace ranges { - class _Replace_fn : private _Not_quite_object { + class _Replace_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty1, class _Ty2, class _Pj = identity> requires indirectly_writable<_It, const _Ty2&> && indirect_binary_predicate, const _Ty1*> @@ -3714,7 +3643,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Replace_fn replace{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Replace_fn replace; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -3738,10 +3667,8 @@ void replace_if(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, _Pr _Pred, const _Ty #ifdef __cpp_lib_concepts namespace ranges { - class _Replace_if_fn : private _Not_quite_object { + class _Replace_if_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, class _Pj = identity, indirect_unary_predicate> _Pr> requires indirectly_writable<_It, const _Ty&> @@ -3787,7 +3714,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Replace_if_fn replace_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Replace_if_fn replace_if; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -3827,10 +3754,8 @@ namespace ranges { _EXPORT_STD template using replace_copy_result = in_out_result<_In, _Out>; - class _Replace_copy_fn : private _Not_quite_object { + class _Replace_copy_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty1, class _Ty2, output_iterator _Out, class _Pj = identity> requires indirectly_copyable<_It, _Out> @@ -3881,7 +3806,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Replace_copy_fn replace_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Replace_copy_fn replace_copy; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -3922,10 +3847,8 @@ namespace ranges { _EXPORT_STD template using replace_copy_if_result = in_out_result<_In, _Out>; - class _Replace_copy_if_fn : private _Not_quite_object { + class _Replace_copy_if_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, output_iterator _Out, class _Pj = identity, indirect_unary_predicate> _Pr> requires indirectly_copyable<_It, _Out> @@ -3975,12 +3898,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Replace_copy_if_fn replace_copy_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Replace_copy_if_fn replace_copy_if; - class _Fill_fn : private _Not_quite_object { + class _Fill_fn { public: - using _Not_quite_object::_Not_quite_object; - template _It, sentinel_for<_It> _Se> constexpr _It operator()(_It _First, _Se _Last, const _Ty& _Value) const { _Adl_verify_range(_First, _Last); @@ -4020,12 +3941,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Fill_fn fill{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Fill_fn fill; - class _Generate_fn : private _Not_quite_object { + class _Generate_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, copy_constructible _Fn> requires invocable<_Fn&> && indirectly_writable<_Out, invoke_result_t<_Fn&>> constexpr _Out operator()(_Out _First, _Se _Last, _Fn _Gen) const { @@ -4061,12 +3980,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Generate_fn generate{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Generate_fn generate; - class _Generate_n_fn : private _Not_quite_object { + class _Generate_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template requires invocable<_Fn&> && indirectly_writable<_Out, invoke_result_t<_Fn&>> constexpr _Out operator()(_Out _First, iter_difference_t<_Out> _Count, _Fn _Gen) const { @@ -4084,7 +4001,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Generate_n_fn generate_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Generate_n_fn generate_n; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -4202,10 +4119,8 @@ _NODISCARD_REMOVE_ALG _FwdIt remove_if(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Las #ifdef __cpp_lib_concepts namespace ranges { - class _Remove_fn : private _Not_quite_object { + class _Remove_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, class _Pj = identity> requires indirect_binary_predicate, const _Ty*> _NODISCARD_REMOVE_ALG constexpr subrange<_It> operator()( @@ -4253,12 +4168,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Remove_fn remove{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Remove_fn remove; - class _Remove_if_fn : private _Not_quite_object { + class _Remove_if_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> _NODISCARD_REMOVE_ALG constexpr subrange<_It> operator()( @@ -4306,15 +4219,13 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Remove_if_fn remove_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Remove_if_fn remove_if; _EXPORT_STD template using remove_copy_result = in_out_result<_In, _Out>; - class _Remove_copy_fn : private _Not_quite_object { + class _Remove_copy_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out, class _Ty, class _Pj = identity> requires indirectly_copyable<_It, _Out> && indirect_binary_predicate, const _Ty*> @@ -4366,15 +4277,13 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Remove_copy_fn remove_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Remove_copy_fn remove_copy; _EXPORT_STD template using remove_copy_if_result = in_out_result<_In, _Out>; - class _Remove_copy_if_fn : private _Not_quite_object { + class _Remove_copy_if_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out, class _Pj = identity, indirect_unary_predicate> _Pr> requires indirectly_copyable<_It, _Out> @@ -4426,7 +4335,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Remove_copy_if_fn remove_copy_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Remove_copy_if_fn remove_copy_if; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -4480,10 +4389,8 @@ _NODISCARD_UNIQUE_ALG _FwdIt unique(_ExPo&&, _FwdIt _First, _FwdIt _Last) noexce #ifdef __cpp_lib_concepts namespace ranges { - class _Unique_fn : private _Not_quite_object { + class _Unique_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_equivalence_relation> _Pr = ranges::equal_to> _NODISCARD_UNIQUE_ALG constexpr subrange<_It> operator()( @@ -4541,7 +4448,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Unique_fn unique{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Unique_fn unique; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -4646,10 +4553,8 @@ namespace ranges { concept _Can_reread_or_store = forward_iterator<_It> || _Is_input_with_value_type<_Out, iter_value_t<_It>> || indirectly_copyable_storable<_It, _Out>; - class _Unique_copy_fn : private _Not_quite_object { + class _Unique_copy_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out, class _Pj = identity, indirect_equivalence_relation> _Pr = ranges::equal_to> requires indirectly_copyable<_It, _Out> && _Can_reread_or_store<_It, _Out> @@ -4737,7 +4642,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Unique_copy_fn unique_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Unique_copy_fn unique_copy; // concept-constrained for strict enforcement as it is used by several algorithms template @@ -4775,10 +4680,8 @@ namespace ranges { } } - class _Reverse_fn : private _Not_quite_object { + class _Reverse_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se> requires permutable<_It> constexpr _It operator()(_It _First, _Se _Last) const { @@ -4799,7 +4702,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Reverse_fn reverse{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Reverse_fn reverse; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -4864,10 +4767,8 @@ namespace ranges { _EXPORT_STD template using reverse_copy_result = in_out_result<_In, _Out>; - class _Reverse_copy_fn : private _Not_quite_object { + class _Reverse_copy_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out> requires indirectly_copyable<_It, _Out> constexpr reverse_copy_result<_It, _Out> operator()(_It _First, _Se _Last, _Out _Result) const { @@ -4937,7 +4838,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Reverse_copy_fn reverse_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Reverse_copy_fn reverse_copy; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -5021,10 +4922,8 @@ namespace ranges { } } - class _Rotate_fn : private _Not_quite_object { + class _Rotate_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se> constexpr subrange<_It> operator()(_It _First, _It _Mid, _Se _Last) const { _Adl_verify_range(_First, _Mid); @@ -5047,7 +4946,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Rotate_fn rotate{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Rotate_fn rotate; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -5080,10 +4979,8 @@ namespace ranges { _EXPORT_STD template using rotate_copy_result = in_out_result<_In, _Out>; - class _Rotate_copy_fn : private _Not_quite_object { + class _Rotate_copy_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out> requires indirectly_copyable<_It, _Out> constexpr rotate_copy_result<_It, _Out> operator()(_It _First, _It _Mid, _Se _Last, _Out _Result) const { @@ -5124,7 +5021,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Rotate_copy_fn rotate_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Rotate_copy_fn rotate_copy; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -5288,10 +5185,8 @@ concept uniform_random_bit_generator = invocable<_Ty&> // clang-format on namespace ranges { - class _Sample_fn : private _Not_quite_object { + class _Sample_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out, class _Urng> requires (forward_iterator<_It> || random_access_iterator<_Out>) && indirectly_copyable<_It, _Out> && uniform_random_bit_generator> @@ -5386,7 +5281,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Sample_fn sample{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Sample_fn sample; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -5422,10 +5317,8 @@ void shuffle(_RanIt _First, _RanIt _Last, _Urng&& _Func) { // shuffle [_First, _ #ifdef __cpp_lib_concepts namespace ranges { - class _Shuffle_fn : private _Not_quite_object { + class _Shuffle_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Urng> requires permutable<_It> && uniform_random_bit_generator> _It operator()(_It _First, _Se _Last, _Urng&& _Func) const { @@ -5474,7 +5367,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Shuffle_fn shuffle{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Shuffle_fn shuffle; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -5636,10 +5529,8 @@ _FwdIt shift_right(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Iter_diff_t<_FwdIt> _P #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 namespace ranges { - class _Shift_left_fn : private _Not_quite_object { + class _Shift_left_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se> constexpr subrange<_It> operator()(_It _First, const _Se _Last, iter_difference_t<_It> _Pos_to_shift) const { _STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4950 [alg.shift]/1)"); @@ -5699,12 +5590,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Shift_left_fn shift_left{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Shift_left_fn shift_left; - class _Shift_right_fn : private _Not_quite_object { + class _Shift_right_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se> constexpr subrange<_It> operator()(_It _First, const _Se _Last, iter_difference_t<_It> _Pos_to_shift) const { _Adl_verify_range(_First, _Last); @@ -5858,7 +5747,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Shift_right_fn shift_right{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Shift_right_fn shift_right; } // namespace ranges #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) @@ -5926,10 +5815,8 @@ _FwdIt partition(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept #ifdef __cpp_lib_concepts namespace ranges { - class _Partition_fn : private _Not_quite_object { + class _Partition_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> constexpr subrange<_It> operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const { @@ -6002,7 +5889,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Partition_fn partition{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Partition_fn partition; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -6213,10 +6100,8 @@ namespace ranges { return _RANGES _Rotate_unchecked(_STD move(_First), _STD move(_Mid), _STD move(_Last)).begin(); } - class _Stable_partition_fn : private _Not_quite_object { + class _Stable_partition_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> requires permutable<_It> @@ -6372,7 +6257,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Stable_partition_fn stable_partition{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Stable_partition_fn stable_partition; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -6433,10 +6318,8 @@ namespace ranges { *(_First + _Hole) = _STD forward<_Ty>(_Val); // drop _Val into final hole } - class _Push_heap_fn : private _Not_quite_object { + class _Push_heap_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -6479,7 +6362,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Push_heap_fn push_heap{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Push_heap_fn push_heap; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -6612,10 +6495,8 @@ namespace ranges { _RANGES _Pop_heap_hole_unchecked(_STD move(_First), _Last, _Last, _STD move(_Val), _Pred, _Proj, _Proj); } - class _Pop_heap_fn : private _Not_quite_object { + class _Pop_heap_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -6641,7 +6522,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Pop_heap_fn pop_heap{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Pop_heap_fn pop_heap; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -6686,10 +6567,8 @@ namespace ranges { } } - class _Make_heap_fn : private _Not_quite_object { + class _Make_heap_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -6715,7 +6594,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Make_heap_fn make_heap{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Make_heap_fn make_heap; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -6810,10 +6689,8 @@ namespace ranges { return _First + _Off; } - class _Is_heap_fn : private _Not_quite_object { + class _Is_heap_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr bool operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -6836,12 +6713,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Is_heap_fn is_heap{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_heap_fn is_heap; - class _Is_heap_until_fn : private _Not_quite_object { + class _Is_heap_until_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -6863,7 +6738,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Is_heap_until_fn is_heap_until{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_heap_until_fn is_heap_until; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -6906,10 +6781,8 @@ namespace ranges { } } - class _Sort_heap_fn : private _Not_quite_object { + class _Sort_heap_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -6935,7 +6808,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Sort_heap_fn sort_heap{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Sort_heap_fn sort_heap; template _NODISCARD constexpr _It _Lower_bound_unchecked( @@ -6960,10 +6833,8 @@ namespace ranges { return _First; } - class _Lower_bound_fn : private _Not_quite_object { + class _Lower_bound_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr _It operator()( @@ -6988,7 +6859,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Lower_bound_fn lower_bound{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Lower_bound_fn lower_bound; template _NODISCARD constexpr _It _Upper_bound_unchecked( @@ -7013,10 +6884,8 @@ namespace ranges { return _First; } - class _Upper_bound_fn : private _Not_quite_object { + class _Upper_bound_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr _It operator()( @@ -7041,7 +6910,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Upper_bound_fn upper_bound{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Upper_bound_fn upper_bound; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -7090,10 +6959,8 @@ _NODISCARD _CONSTEXPR20 pair<_FwdIt, _FwdIt> equal_range(_FwdIt _First, _FwdIt _ #ifdef __cpp_lib_concepts namespace ranges { - class _Equal_range_fn : private _Not_quite_object { + class _Equal_range_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr subrange<_It> operator()( @@ -7147,7 +7014,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Equal_range_fn equal_range{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Equal_range_fn equal_range; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -7169,10 +7036,8 @@ _NODISCARD _CONSTEXPR20 bool binary_search(_FwdIt _First, _FwdIt _Last, const _T #ifdef __cpp_lib_concepts namespace ranges { - class _Binary_search_fn : private _Not_quite_object { + class _Binary_search_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Ty, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr bool operator()( @@ -7196,7 +7061,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Binary_search_fn binary_search{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Binary_search_fn binary_search; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -7296,10 +7161,8 @@ namespace ranges { _EXPORT_STD template using merge_result = in_in_out_result<_In1, _In2, _Out>; - class _Merge_fn : private _Not_quite_object { + class _Merge_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, input_iterator _It2, sentinel_for<_It2> _Se2, weakly_incrementable _Out, class _Pr = ranges::less, class _Pj1 = identity, class _Pj2 = identity> requires mergeable<_It1, _It2, _Out, _Pr, _Pj1, _Pj2> @@ -7366,7 +7229,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Merge_fn merge{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Merge_fn merge; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -7855,10 +7718,8 @@ namespace ranges { } } - class _Inplace_merge_fn : private _Not_quite_object { + class _Inplace_merge_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> _It operator()(_It _First, _It _Mid, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -7955,7 +7816,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Inplace_merge_fn inplace_merge{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Inplace_merge_fn inplace_merge; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -8286,10 +8147,8 @@ namespace ranges { } } - class _Sort_fn : private _Not_quite_object { + class _Sort_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -8353,7 +8212,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Sort_fn sort{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Sort_fn sort; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -8552,10 +8411,8 @@ void stable_sort(_ExPo&& _Exec, _BidIt _First, _BidIt _Last) noexcept /* termina #ifdef __cpp_lib_concepts namespace ranges { - class _Stable_sort_fn : private _Not_quite_object { + class _Stable_sort_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -8799,7 +8656,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Stable_sort_fn stable_sort{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Stable_sort_fn stable_sort; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -8852,10 +8709,8 @@ void partial_sort(_ExPo&&, _RanIt _First, _RanIt _Mid, _RanIt _Last) noexcept /* #ifdef __cpp_lib_concepts namespace ranges { - class _Partial_sort_fn : private _Not_quite_object { + class _Partial_sort_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> constexpr _It operator()(_It _First, _It _Mid, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -8920,7 +8775,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Partial_sort_fn partial_sort{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Partial_sort_fn partial_sort; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -8989,10 +8844,8 @@ namespace ranges { _EXPORT_STD template using partial_sort_copy_result = in_out_result<_In, _Out>; - class _Partial_sort_copy_fn : private _Not_quite_object { + class _Partial_sort_copy_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, random_access_iterator _It2, sentinel_for<_It2> _Se2, class _Pr = ranges::less, class _Pj1 = identity, class _Pj2 = identity> requires indirectly_copyable<_It1, _It2> && sortable<_It2, _Pr, _Pj2> @@ -9068,7 +8921,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Partial_sort_copy_fn partial_sort_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Partial_sort_copy_fn partial_sort_copy; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -9124,10 +8977,8 @@ void nth_element(_ExPo&&, _RanIt _First, _RanIt _Nth, _RanIt _Last) noexcept /* #ifdef __cpp_lib_concepts namespace ranges { - class _Nth_element_fn : private _Not_quite_object { + class _Nth_element_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> constexpr _It operator()(_It _First, _It _Nth, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -9192,7 +9043,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Nth_element_fn nth_element{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Nth_element_fn nth_element; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -9250,10 +9101,8 @@ _NODISCARD bool includes(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Firs #ifdef __cpp_lib_concepts namespace ranges { - class _Includes_fn : private _Not_quite_object { + class _Includes_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, input_iterator _It2, sentinel_for<_It2> _Se2, class _Pj1 = identity, class _Pj2 = identity, indirect_strict_weak_order, projected<_It2, _Pj2>> _Pr = ranges::less> @@ -9316,7 +9165,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Includes_fn includes{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Includes_fn includes; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -9388,10 +9237,8 @@ namespace ranges { _EXPORT_STD template using set_union_result = in_in_out_result<_In1, _In2, _Out>; - class _Set_union_fn : private _Not_quite_object { + class _Set_union_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, input_iterator _It2, sentinel_for<_It2> _Se2, weakly_incrementable _Out, class _Pr = ranges::less, class _Pj1 = identity, class _Pj2 = identity> requires mergeable<_It1, _It2, _Out, _Pr, _Pj1, _Pj2> @@ -9455,7 +9302,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Set_union_fn set_union{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Set_union_fn set_union; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -9515,10 +9362,8 @@ namespace ranges { _EXPORT_STD template using set_intersection_result = in_in_out_result<_In1, _In2, _Out>; - class _Set_intersection_fn : private _Not_quite_object { + class _Set_intersection_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, input_iterator _It2, sentinel_for<_It2> _Se2, weakly_incrementable _Out, class _Pr = ranges::less, class _Pj1 = identity, class _Pj2 = identity> requires mergeable<_It1, _It2, _Out, _Pr, _Pj1, _Pj2> @@ -9588,7 +9433,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Set_intersection_fn set_intersection{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Set_intersection_fn set_intersection; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -9649,10 +9494,8 @@ namespace ranges { _EXPORT_STD template using set_difference_result = in_out_result<_In, _Out>; - class _Set_difference_fn : private _Not_quite_object { + class _Set_difference_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, input_iterator _It2, sentinel_for<_It2> _Se2, weakly_incrementable _Out, class _Pr = ranges::less, class _Pj1 = identity, class _Pj2 = identity> requires mergeable<_It1, _It2, _Out, _Pr, _Pj1, _Pj2> @@ -9718,7 +9561,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Set_difference_fn set_difference{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Set_difference_fn set_difference; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -9793,10 +9636,8 @@ namespace ranges { _EXPORT_STD template using set_symmetric_difference_result = in_in_out_result<_In1, _In2, _Out>; - class _Set_symmetric_difference_fn : private _Not_quite_object { + class _Set_symmetric_difference_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, input_iterator _It2, sentinel_for<_It2> _Se2, weakly_incrementable _Out, class _Pr = ranges::less, class _Pj1 = identity, class _Pj2 = identity> requires mergeable<_It1, _It2, _Out, _Pr, _Pj1, _Pj2> @@ -9870,8 +9711,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Set_symmetric_difference_fn set_symmetric_difference{ - _Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Set_symmetric_difference_fn set_symmetric_difference; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -9969,10 +9809,8 @@ namespace ranges { _EXPORT_STD template using minmax_element_result = min_max_result<_Ty>; - class _Minmax_element_fn : private _Not_quite_object { + class _Minmax_element_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr minmax_element_result<_It> operator()( @@ -10063,7 +9901,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Minmax_element_fn minmax_element{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Minmax_element_fn minmax_element; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -10110,10 +9948,8 @@ namespace ranges { _EXPORT_STD template using minmax_result = min_max_result<_Ty>; - class _Minmax_fn : private _Not_quite_object { + class _Minmax_fn { public: - using _Not_quite_object::_Not_quite_object; - template > _Pr = ranges::less> _NODISCARD constexpr minmax_result operator()(const _Ty& _Left _MSVC_LIFETIMEBOUND, @@ -10265,7 +10101,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Minmax_fn minmax{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Minmax_fn minmax; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -10311,10 +10147,8 @@ namespace ranges { _EXPORT_STD template using next_permutation_result = in_found_result<_In>; - class _Next_permutation_fn : private _Not_quite_object { + class _Next_permutation_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> constexpr next_permutation_result<_It> operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -10369,7 +10203,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Next_permutation_fn next_permutation{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Next_permutation_fn next_permutation; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -10415,10 +10249,8 @@ namespace ranges { _EXPORT_STD template using prev_permutation_result = in_found_result<_In>; - class _Prev_permutation_fn : private _Not_quite_object { + class _Prev_permutation_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pr = ranges::less, class _Pj = identity> requires sortable<_It, _Pr, _Pj> constexpr prev_permutation_result<_It> operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -10473,7 +10305,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Prev_permutation_fn prev_permutation{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Prev_permutation_fn prev_permutation; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -10540,10 +10372,8 @@ _NODISCARD bool is_sorted(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last) noexcept / #ifdef __cpp_lib_concepts namespace ranges { - class _Is_sorted_fn : private _Not_quite_object { + class _Is_sorted_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr bool operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -10564,12 +10394,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Is_sorted_fn is_sorted{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_sorted_fn is_sorted; - class _Is_sorted_until_fn : private _Not_quite_object { + class _Is_sorted_until_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -10589,7 +10417,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Is_sorted_until_fn is_sorted_until{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_sorted_until_fn is_sorted_until; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -10629,10 +10457,8 @@ _NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, cons #ifdef __cpp_lib_concepts namespace ranges { - class _Clamp_fn : private _Not_quite_object { + class _Clamp_fn { public: - using _Not_quite_object::_Not_quite_object; - template > _Pr = ranges::less> _NODISCARD constexpr const _Ty& operator()( @@ -10655,12 +10481,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Clamp_fn clamp{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Clamp_fn clamp; - class _Lexicographical_compare_fn : private _Not_quite_object { + class _Lexicographical_compare_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se1, input_iterator _It2, sentinel_for<_It2> _Se2, class _Pj1 = identity, class _Pj2 = identity, indirect_strict_weak_order, projected<_It2, _Pj2>> _Pr = ranges::less> @@ -10733,8 +10557,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Lexicographical_compare_fn lexicographical_compare{ - _Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Lexicographical_compare_fn lexicographical_compare; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 diff --git a/stl/inc/memory b/stl/inc/memory index 48ec38fa61..caf9636b4a 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -52,10 +52,8 @@ namespace ranges { _EXPORT_STD template using uninitialized_copy_result = in_out_result<_In, _Out>; - class _Uninitialized_copy_fn : private _Not_quite_object { + class _Uninitialized_copy_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, _No_throw_forward_iterator _Out, _No_throw_sentinel_for<_Out> _OSe> requires constructible_from, iter_reference_t<_It>> @@ -120,7 +118,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Uninitialized_copy_fn uninitialized_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_copy_fn uninitialized_copy; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -170,10 +168,8 @@ namespace ranges { _EXPORT_STD template using uninitialized_copy_n_result = in_out_result<_In, _Out>; - class _Uninitialized_copy_n_fn : private _Not_quite_object { + class _Uninitialized_copy_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template _OSe> requires constructible_from, iter_reference_t<_It>> uninitialized_copy_n_result<_It, _Out> operator()( @@ -214,7 +210,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Uninitialized_copy_n_fn uninitialized_copy_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_copy_n_fn uninitialized_copy_n; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -243,10 +239,8 @@ _NoThrowFwdIt uninitialized_move(_ExPo&&, const _FwdIt _First, const _FwdIt _Las #ifdef __cpp_lib_concepts namespace ranges { - class _Uninitialized_move_fn : private _Not_quite_object { + class _Uninitialized_move_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, _No_throw_forward_iterator _Out, _No_throw_sentinel_for<_Out> _OSe> requires constructible_from, iter_rvalue_reference_t<_It>> @@ -275,7 +269,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Uninitialized_move_fn uninitialized_move{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_move_fn uninitialized_move; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -336,10 +330,8 @@ namespace ranges { _EXPORT_STD template using uninitialized_move_n_result = in_out_result<_In, _Out>; - class _Uninitialized_move_n_fn : private _Not_quite_object { + class _Uninitialized_move_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template _OSe> requires constructible_from, iter_rvalue_reference_t<_It>> uninitialized_move_n_result<_It, _Out> operator()( @@ -380,12 +372,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Uninitialized_move_n_fn uninitialized_move_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_move_n_fn uninitialized_move_n; - class _Uninitialized_fill_fn : private _Not_quite_object { + class _Uninitialized_fill_fn { public: - using _Not_quite_object::_Not_quite_object; - template <_No_throw_forward_iterator _It, _No_throw_sentinel_for<_It> _Se, class _Ty> requires constructible_from, const _Ty&> _It operator()(_It _First, _Se _Last, const _Ty& _Val) const { @@ -434,7 +424,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Uninitialized_fill_fn uninitialized_fill{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_fill_fn uninitialized_fill; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -489,10 +479,8 @@ _NoThrowFwdIt uninitialized_fill_n( #ifdef __cpp_lib_concepts namespace ranges { - class _Uninitialized_fill_n_fn : private _Not_quite_object { + class _Uninitialized_fill_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template <_No_throw_forward_iterator _It, class _Ty> requires constructible_from, const _Ty&> _It operator()(_It _First, iter_difference_t<_It> _Count, const _Ty& _Val) const { @@ -525,12 +513,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Uninitialized_fill_n_fn uninitialized_fill_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_fill_n_fn uninitialized_fill_n; - class _Construct_at_fn : private _Not_quite_object { + class _Construct_at_fn { public: - using _Not_quite_object::_Not_quite_object; - // clang-format off template requires requires(_Ty* _Ptr, _Types&&... _Args) { @@ -544,16 +530,14 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Construct_at_fn construct_at{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Construct_at_fn construct_at; template <_No_throw_input_iterator _It, _No_throw_sentinel_for<_It> _Se> requires destructible> _NODISCARD constexpr _It _Destroy_unchecked(_It _First, _Se _Last) noexcept; - class _Destroy_at_fn : private _Not_quite_object { + class _Destroy_at_fn { public: - using _Not_quite_object::_Not_quite_object; - template constexpr void operator()(_Ty* const _Location) const noexcept { if constexpr (is_array_v<_Ty>) { @@ -564,7 +548,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Destroy_at_fn destroy_at{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Destroy_at_fn destroy_at; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -595,10 +579,8 @@ namespace ranges { return _First; } - class _Destroy_fn : private _Not_quite_object { + class _Destroy_fn { public: - using _Not_quite_object::_Not_quite_object; - template <_No_throw_input_iterator _It, _No_throw_sentinel_for<_It> _Se> requires destructible> constexpr _It operator()(_It _First, _Se _Last) const noexcept { @@ -618,7 +600,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Destroy_fn destroy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Destroy_fn destroy; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -648,10 +630,8 @@ _NoThrowFwdIt destroy_n(_ExPo&& _Exec, _NoThrowFwdIt _First, _Diff _Count_raw) n #ifdef __cpp_lib_concepts namespace ranges { - class _Destroy_n_fn : private _Not_quite_object { + class _Destroy_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template <_No_throw_input_iterator _It> requires destructible> constexpr _It operator()(_It _First, const iter_difference_t<_It> _Count_raw) const noexcept { @@ -676,7 +656,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Destroy_n_fn destroy_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Destroy_n_fn destroy_n; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -701,10 +681,8 @@ void uninitialized_default_construct(_ExPo&& _Exec, _NoThrowFwdIt _First, _NoThr #ifdef __cpp_lib_concepts namespace ranges { - class _Uninitialized_default_construct_fn : private _Not_quite_object { + class _Uninitialized_default_construct_fn { public: - using _Not_quite_object::_Not_quite_object; - template <_No_throw_forward_iterator _It, _No_throw_sentinel_for<_It> _Se> requires default_initializable> _It operator()(_It _First, _Se _Last) const { @@ -747,8 +725,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Uninitialized_default_construct_fn uninitialized_default_construct{ - _Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_default_construct_fn uninitialized_default_construct; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -781,10 +758,8 @@ _NoThrowFwdIt uninitialized_default_construct_n( #ifdef __cpp_lib_concepts namespace ranges { - class _Uninitialized_default_construct_n_fn : private _Not_quite_object { + class _Uninitialized_default_construct_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template <_No_throw_forward_iterator _It> requires default_initializable> _It operator()(_It _First, iter_difference_t<_It> _Count) const { @@ -808,8 +783,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Uninitialized_default_construct_n_fn uninitialized_default_construct_n{ - _Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_default_construct_n_fn uninitialized_default_construct_n; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -837,10 +811,8 @@ void uninitialized_value_construct(_ExPo&& _Exec, _NoThrowFwdIt _First, _NoThrow #ifdef __cpp_lib_concepts namespace ranges { - class _Uninitialized_value_construct_fn : private _Not_quite_object { + class _Uninitialized_value_construct_fn { public: - using _Not_quite_object::_Not_quite_object; - template <_No_throw_forward_iterator _It, _No_throw_sentinel_for<_It> _Se> requires default_initializable> _It operator()(_It _First, _Se _Last) const { @@ -881,8 +853,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Uninitialized_value_construct_fn uninitialized_value_construct{ - _Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_value_construct_fn uninitialized_value_construct; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -904,10 +875,8 @@ _NoThrowFwdIt uninitialized_value_construct_n( #ifdef __cpp_lib_concepts namespace ranges { - class _Uninitialized_value_construct_n_fn : private _Not_quite_object { + class _Uninitialized_value_construct_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template <_No_throw_forward_iterator _It> requires default_initializable> _It operator()(_It _First, iter_difference_t<_It> _Count) const { @@ -931,8 +900,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Uninitialized_value_construct_n_fn uninitialized_value_construct_n{ - _Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_value_construct_n_fn uninitialized_value_construct_n; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 diff --git a/stl/inc/numeric b/stl/inc/numeric index ed8abfafe9..994e14d29b 100644 --- a/stl/inc/numeric +++ b/stl/inc/numeric @@ -530,10 +530,8 @@ namespace ranges { _EXPORT_STD template using iota_result = out_value_result<_Out, _Ty>; - class _Iota_fn : private _Not_quite_object { + class _Iota_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Ty> requires indirectly_writable<_It, const _Ty&> constexpr iota_result<_It, _Ty> operator()(_It _First, _Se _Last, _Ty _Val) const { @@ -565,7 +563,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Iota_fn iota{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Iota_fn iota; } // namespace ranges #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) diff --git a/stl/inc/ranges b/stl/inc/ranges index 42dc779d63..69a44d7e47 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -3644,6 +3644,10 @@ namespace ranges { return static_cast<_Ty&>(_Val); } + struct _Construct_tag { + explicit _Construct_tag() = default; + }; + _EXPORT_STD template requires view<_Vw> && input_range> class join_view; @@ -3653,7 +3657,7 @@ namespace ranges { private: struct _Cache_wrapper { template - constexpr _Cache_wrapper(_Not_quite_object::_Construct_tag, const _Iter& _It) noexcept( + constexpr _Cache_wrapper(_Construct_tag, const _Iter& _It) noexcept( noexcept(static_cast(*_It))) : _Val(*_It) {} @@ -3772,7 +3776,7 @@ namespace ranges { if constexpr (_Deref_is_glvalue) { return *_Get_outer(); } else { - return _Parent->_Inner._Emplace(_Not_quite_object::_Construct_tag{}, _Get_outer())._Val; + return _Parent->_Inner._Emplace(_Construct_tag{}, _Get_outer())._Val; } } @@ -4091,7 +4095,7 @@ namespace ranges { private: struct _Cache_wrapper { template - constexpr _Cache_wrapper(_Not_quite_object::_Construct_tag, const _Iter& _It) noexcept( + constexpr _Cache_wrapper(_Construct_tag, const _Iter& _It) noexcept( noexcept(static_cast(*_It))) : _Val(*_It) {} @@ -4224,7 +4228,7 @@ namespace ranges { if constexpr (_Deref_is_glvalue) { return _As_lvalue(*_Get_outer()); } else { - return _Parent->_Inner._Emplace(_Not_quite_object::_Construct_tag{}, _Get_outer())._Val; + return _Parent->_Inner._Emplace(_Construct_tag{}, _Get_outer())._Val; } } diff --git a/stl/inc/xutility b/stl/inc/xutility index 8af5fa3de1..aa972c04e5 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -3217,35 +3217,8 @@ namespace ranges { { _RANGES data(__r) } -> same_as>>; }; - class _Not_quite_object { + class _Advance_fn { public: - // Some overload sets in the library have the property that their constituent function templates are not visible - // to argument-dependent name lookup (ADL) and that they inhibit ADL when found via unqualified name lookup. - // This property allows these overload sets to be implemented as function objects. We derive such function - // objects from this type to remove some typical object-ish behaviors which helps users avoid depending on their - // non-specified object-ness. - - struct _Construct_tag { - explicit _Construct_tag() = default; - }; - - _Not_quite_object() = delete; - - constexpr explicit _Not_quite_object(_Construct_tag) noexcept {} - - _Not_quite_object(const _Not_quite_object&) = delete; - _Not_quite_object& operator=(const _Not_quite_object&) = delete; - - void operator&() const = delete; - - protected: - ~_Not_quite_object() = default; - }; - - class _Advance_fn : private _Not_quite_object { - public: - using _Not_quite_object::_Not_quite_object; - template constexpr void operator()(_It& _Where, iter_difference_t<_It> _Off) const { if constexpr (random_access_iterator<_It>) { @@ -3331,12 +3304,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Advance_fn advance{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Advance_fn advance; - class _Distance_fn : private _Not_quite_object { + class _Distance_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se> requires (!sized_sentinel_for<_Se, _It>) _NODISCARD constexpr iter_difference_t<_It> operator()(_It _First, _Se _Last) const @@ -3384,7 +3355,7 @@ namespace ranges { static constexpr bool _Nothrow_size<_Rng> = noexcept(_RANGES size(_STD declval<_Rng&>())); }; - _EXPORT_STD inline constexpr _Distance_fn distance{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Distance_fn distance; class _Ssize_fn { public: @@ -3402,10 +3373,8 @@ namespace ranges { _EXPORT_STD inline constexpr _Ssize_fn ssize; } - class _Next_fn : private _Not_quite_object { + class _Next_fn { public: - using _Not_quite_object::_Not_quite_object; - template _NODISCARD constexpr _It operator()(_It _Where) const { ++_Where; @@ -3431,12 +3400,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Next_fn next{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Next_fn next; - class _Prev_fn : private _Not_quite_object { + class _Prev_fn { public: - using _Not_quite_object::_Not_quite_object; - template _NODISCARD constexpr _It operator()(_It _Where) const { --_Where; @@ -3458,7 +3425,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Prev_fn prev{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Prev_fn prev; template _Se> _NODISCARD constexpr _It _Find_last_iterator( @@ -4754,10 +4721,8 @@ namespace ranges { return {_STD move(_First), _STD move(_Result)}; } - class _Copy_fn : private _Not_quite_object { + class _Copy_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, weakly_incrementable _Out> requires indirectly_copyable<_It, _Out> constexpr copy_result<_It, _Out> operator()(_It _First, _Se _Last, _Out _Result) const { @@ -4779,7 +4744,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Copy_fn copy{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Copy_fn copy; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -5127,10 +5092,8 @@ _FwdIt fill_n(_ExPo&&, _FwdIt _Dest, _Diff _Count_raw, const _Ty& _Val) noexcept #ifdef __cpp_lib_concepts namespace ranges { - class _Fill_n_fn : private _Not_quite_object { + class _Fill_n_fn { public: - using _Not_quite_object::_Not_quite_object; - template _It> constexpr _It operator()(_It _First, iter_difference_t<_It> _Count, const _Ty& _Value) const { if (_Count > 0) { @@ -5160,7 +5123,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Fill_n_fn fill_n{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Fill_n_fn fill_n; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -5431,10 +5394,8 @@ namespace ranges { return {_STD move(_First1), _STD move(_First2)}; } - class _Mismatch_fn : private _Not_quite_object { + class _Mismatch_fn { public: - using _Not_quite_object::_Not_quite_object; - // clang-format off template _Se1, input_iterator _It2, sentinel_for<_It2> _Se2, class _Pr = ranges::equal_to, class _Pj1 = identity, class _Pj2 = identity> @@ -5499,7 +5460,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Mismatch_fn mismatch{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Mismatch_fn mismatch; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -5947,10 +5908,8 @@ namespace ranges { return _First; } - class _Find_fn : private _Not_quite_object { + class _Find_fn { public: - using _Not_quite_object::_Not_quite_object; - // clang-format off template _Se, class _Ty, class _Pj = identity> requires indirect_binary_predicate, const _Ty*> @@ -5977,7 +5936,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Find_fn find{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Find_fn find; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -6370,10 +6329,8 @@ namespace ranges { return _First; } - class _Find_if_fn : private _Not_quite_object { + class _Find_if_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> _NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const { @@ -6397,12 +6354,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Find_if_fn find_if{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Find_if_fn find_if; - class _Find_if_not_fn : private _Not_quite_object { + class _Find_if_not_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_unary_predicate> _Pr> _NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred, _Pj _Proj = {}) const { @@ -6444,12 +6399,10 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Find_if_not_fn find_if_not{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Find_if_not_fn find_if_not; - class _Adjacent_find_fn : private _Not_quite_object { + class _Adjacent_find_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_binary_predicate, projected<_It, _Pj>> _Pr = ranges::equal_to> _NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -6495,7 +6448,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Adjacent_find_fn adjacent_find{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Adjacent_find_fn adjacent_find; // clang-format off template @@ -6537,10 +6490,8 @@ namespace ranges { return {true, _STD move(_First1)}; } - class _Search_fn : private _Not_quite_object { + class _Search_fn { public: - using _Not_quite_object::_Not_quite_object; - template _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> @@ -6636,7 +6587,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Search_fn search{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Search_fn search; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -6746,10 +6697,8 @@ namespace ranges { return _Found; } - class _Max_element_fn : private _Not_quite_object { + class _Max_element_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -6768,7 +6717,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Max_element_fn max_element{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Max_element_fn max_element; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -6794,10 +6743,8 @@ namespace ranges { sizeof(_It) <= 2 * sizeof(iter_value_t<_It>) && (is_trivially_copyable_v<_It> || !is_trivially_copyable_v>); - class _Max_fn : private _Not_quite_object { + class _Max_fn { public: - using _Not_quite_object::_Not_quite_object; - template > _Pr = ranges::less> _NODISCARD constexpr const _Ty& operator()( @@ -6843,7 +6790,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Max_fn max{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Max_fn max; } // namespace ranges #endif // defined(__cpp_lib_concepts) @@ -6942,10 +6889,8 @@ namespace ranges { return _Found; } - class _Min_element_fn : private _Not_quite_object { + class _Min_element_fn { public: - using _Not_quite_object::_Not_quite_object; - template _Se, class _Pj = identity, indirect_strict_weak_order> _Pr = ranges::less> _NODISCARD constexpr _It operator()(_It _First, _Se _Last, _Pr _Pred = {}, _Pj _Proj = {}) const { @@ -6964,7 +6909,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Min_element_fn min_element{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Min_element_fn min_element; } // namespace ranges #endif // defined(__cpp_lib_concepts) #endif // _HAS_CXX17 @@ -6984,10 +6929,8 @@ _NODISCARD constexpr _Ty(min)(initializer_list<_Ty> _Ilist) { #ifdef __cpp_lib_concepts namespace ranges { - class _Min_fn : private _Not_quite_object { + class _Min_fn { public: - using _Not_quite_object::_Not_quite_object; - template > _Pr = ranges::less> _NODISCARD constexpr const _Ty& operator()( @@ -7033,7 +6976,7 @@ namespace ranges { } }; - _EXPORT_STD inline constexpr _Min_fn min{_Not_quite_object::_Construct_tag {}}; + _EXPORT_STD inline constexpr _Min_fn min; } // namespace ranges #endif // defined(__cpp_lib_concepts)