diff --git a/stl/inc/algorithm b/stl/inc/algorithm index 5925f28aaeb..cb6147d51fa 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -38,13 +38,11 @@ _END_EXTERN_C #endif // _USE_STD_VECTOR_ALGORITHMS _STD_BEGIN -// COMMON SORT PARAMETERS _INLINE_VAR constexpr int _ISORT_MAX = 32; // maximum size for insertion sort template _INLINE_VAR constexpr auto _Isort_max = _Iter_diff_t<_It>{_ISORT_MAX}; -// STRUCT TEMPLATE _Optimistic_temporary_buffer template constexpr ptrdiff_t _Temporary_buffer_size(const _Diff _Value) noexcept { // convert an iterator difference_type to a ptrdiff_t for use in temporary buffers @@ -97,7 +95,6 @@ struct _Optimistic_temporary_buffer { // temporary storage with _alloca-like att #ifdef __cpp_lib_concepts namespace ranges { - // STRUCT TEMPLATE in_fun_result template struct in_fun_result { /* [[no_unique_address]] */ _In in; @@ -114,7 +111,6 @@ namespace ranges { } }; - // STRUCT TEMPLATE in_in_out_result template struct in_in_out_result { /* [[no_unique_address]] */ _In1 in1; @@ -133,7 +129,6 @@ namespace ranges { } }; - // STRUCT TEMPLATE in_out_out_result template struct in_out_out_result { /* [[no_unique_address]] */ _In in; @@ -152,7 +147,6 @@ namespace ranges { } }; - // STRUCT TEMPLATE min_max_result template struct min_max_result { /* [[no_unique_address]] */ _Ty min; @@ -169,7 +163,6 @@ namespace ranges { } }; - // STRUCT TEMPLATE in_found_result template struct in_found_result { /* [[no_unique_address]] */ _In in; @@ -186,7 +179,6 @@ namespace ranges { } }; - // FUNCTION TEMPLATE _Rewrap_subrange template _NODISCARD constexpr _Result _Rewrap_subrange(_Wrapped& _Val, subrange<_Unwrapped>&& _UResult) { // conditionally computes a wrapped subrange from a wrapped iterator or range and unwrapped subrange @@ -215,7 +207,6 @@ namespace ranges { } } - // FUNCTION TEMPLATE _Get_final_iterator_unwrapped template _Se> _NODISCARD constexpr auto _Get_final_iterator_unwrapped(const _Unwrapped_t<_Wrapped>& _UFirst, _Se&& _Last) { // find the iterator in [_UFirst, _Get_unwrapped(_Last)) which equals _Get_unwrapped(_Last) [possibly O(N)] @@ -261,7 +252,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE for_each template _CONSTEXPR20 _Fn for_each(_InIt _First, _InIt _Last, _Fn _Func) { // perform function for each element [_First, _Last) _Adl_verify_range(_First, _Last); @@ -278,7 +268,6 @@ _CONSTEXPR20 _Fn for_each(_InIt _First, _InIt _Last, _Fn _Func) { // perform fun template = 0> void for_each(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, _Fn _Func) noexcept; // terminates -// FUNCTION TEMPLATE for_each_n template _CONSTEXPR20 _InIt for_each_n(_InIt _First, const _Diff _Count_raw, _Fn _Func) { // perform function for each element [_First, _First + _Count) @@ -303,11 +292,9 @@ _FwdIt for_each_n(_ExPo&& _Exec, _FwdIt _First, _Diff _Count_raw, _Fn _Func) noe #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE for_each_result template using for_each_result = in_fun_result<_In, _Fun>; - // VARIABLE ranges::for_each class _For_each_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -355,11 +342,9 @@ namespace ranges { inline constexpr _For_each_fn for_each{_Not_quite_object::_Construct_tag{}}; - // ALIAS TEMPLATE for_each_n_result template using for_each_n_result = in_fun_result<_In, _Fun>; - // VARIABLE ranges::for_each_n class _For_each_n_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -387,12 +372,10 @@ namespace ranges { #endif // __cpp_lib_concepts #if _HAS_CXX17 -// PARALLEL FUNCTION TEMPLATE find_if template = 0> _NODISCARD _FwdIt find_if(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 -// FUNCTION TEMPLATE find_if_not template _NODISCARD _CONSTEXPR20 _InIt find_if_not(_InIt _First, const _InIt _Last, _Pr _Pred) { // find first element that satisfies !_Pred @@ -414,7 +397,6 @@ template _NODISCARD _CONSTEXPR20 _FwdIt adjacent_find(const _FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find first satisfying _Pred with successor @@ -452,7 +434,6 @@ _NODISCARD _FwdIt adjacent_find(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::adjacent_find class _Adjacent_find_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -504,7 +485,6 @@ namespace ranges { inline constexpr _Adjacent_find_fn adjacent_find{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::count class _Count_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -548,7 +528,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE count_if template _NODISCARD _CONSTEXPR20 _Iter_diff_t<_InIt> count_if(_InIt _First, _InIt _Last, _Pr _Pred) { // count elements satisfying _Pred @@ -573,7 +552,6 @@ _NODISCARD _Iter_diff_t<_FwdIt> count_if( #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::count_if class _Count_if_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -615,7 +593,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE mismatch template _NODISCARD _CONSTEXPR20 pair<_InIt1, _InIt2> mismatch(_InIt1 _First1, const _InIt1 _Last1, _InIt2 _First2, _Pr _Pred) { // return [_First1, _Last1)/[_First2, ...) mismatch @@ -713,7 +690,6 @@ _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch( #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::equal class _Equal_fn : private _Not_quite_object { private: template @@ -810,7 +786,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE is_permutation template _NODISCARD _CONSTEXPR20 bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Pr _Pred) { // test if [_First1, _Last1) == permuted [_First2, ...) @@ -919,7 +894,6 @@ namespace ranges { concept _Bidi_common_range = common_range<_Rng> && bidirectional_iterator>; // clang-format on - // VARIABLE ranges::is_permutation class _Is_permutation_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -1144,7 +1118,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE all_of template _NODISCARD _CONSTEXPR20 bool all_of(_InIt _First, _InIt _Last, _Pr _Pred) { // test if all elements satisfy _Pred _Adl_verify_range(_First, _Last); @@ -1166,7 +1139,6 @@ _NODISCARD bool all_of(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::all_of class _All_of_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -1207,7 +1179,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE any_of template _NODISCARD _CONSTEXPR20 bool any_of(const _InIt _First, const _InIt _Last, _Pr _Pred) { // test if any element satisfies _Pred @@ -1230,7 +1201,6 @@ _NODISCARD bool any_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pr #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::any_of class _Any_of_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -1271,7 +1241,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE none_of template _NODISCARD _CONSTEXPR20 bool none_of(const _InIt _First, const _InIt _Last, _Pr _Pred) { // test if no elements satisfy _Pred @@ -1294,7 +1263,6 @@ _NODISCARD bool none_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _P #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::none_of class _None_of_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -1333,11 +1301,9 @@ namespace ranges { inline constexpr _None_of_fn none_of{_Not_quite_object::_Construct_tag{}}; - // ALIAS TEMPLATE copy_n_result template using copy_n_result = in_out_result<_In, _Out>; - // VARIABLE ranges::copy_n class _Copy_n_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -1368,11 +1334,9 @@ namespace ranges { inline constexpr _Copy_n_fn copy_n{_Not_quite_object::_Construct_tag{}}; - // ALIAS TEMPLATE copy_backward_result template using copy_backward_result = in_out_result<_In, _Out>; - // VARIABLE ranges::copy_backward class _Copy_backward_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -1403,7 +1367,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE copy_if template _CONSTEXPR20 _OutIt copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred) { // copy each satisfying _Pred _Adl_verify_range(_First, _Last); @@ -1434,11 +1397,9 @@ _FwdIt2 copy_if(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _Pr _Pred #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE copy_if_result template using copy_if_result = in_out_result<_In, _Out>; - // VARIABLE ranges::copy_if class _Copy_if_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -1491,11 +1452,9 @@ namespace ranges { inline constexpr _Copy_if_fn copy_if{_Not_quite_object::_Construct_tag{}}; - // ALIAS TEMPLATE move_result template using move_result = in_out_result<_In, _Out>; - // VARIABLE ranges::move // clang-format off template _Se, weakly_incrementable _Out> requires indirectly_movable<_It, _Out> @@ -1549,11 +1508,9 @@ namespace ranges { inline constexpr _Move_fn move{_Not_quite_object::_Construct_tag{}}; - // ALIAS TEMPLATE move_backward_result template using move_backward_result = in_out_result<_In, _Out>; - // VARIABLE ranges::move_backward // clang-format off // concept-constrained for strict enforcement as it is used by several algorithms template @@ -1603,7 +1560,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE partition_copy template _CONSTEXPR20 pair<_OutIt1, _OutIt2> partition_copy( _InIt _First, _InIt _Last, _OutIt1 _Dest_true, _OutIt2 _Dest_false, _Pr _Pred) { @@ -1642,11 +1598,9 @@ pair<_FwdIt2, _FwdIt3> partition_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _F #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE partition_copy_result template using partition_copy_result = in_out_out_result<_In, _Out1, _Out2>; - // VARIABLE ranges::partition_copy class _Partition_copy_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -1712,7 +1666,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE is_partitioned template _NODISCARD _CONSTEXPR20 bool is_partitioned(const _InIt _First, const _InIt _Last, _Pr _Pred) { // test if [_First, _Last) partitioned by _Pred @@ -1746,7 +1699,6 @@ _NODISCARD bool is_partitioned(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::is_partitioned class _Is_partitioned_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -1797,7 +1749,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE partition_point template _NODISCARD _CONSTEXPR20 _FwdIt partition_point(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find beginning of false partition in [_First, _Last) @@ -1824,7 +1775,6 @@ _NODISCARD _CONSTEXPR20 _FwdIt partition_point(_FwdIt _First, _FwdIt _Last, _Pr #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::partition_point class _Partition_point_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -1921,7 +1871,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE _Equal_rev_pred_unchecked template _NODISCARD _CONSTEXPR20 bool _Equal_rev_pred_unchecked(_InIt1 _First1, _InIt2 _First2, const _InIt2 _Last2, _Pr _Pred) { // compare [_First1, ...) to [_First2, _Last2) @@ -1943,7 +1892,6 @@ _NODISCARD _CONSTEXPR20 bool _Equal_rev_pred_unchecked(_InIt1 _First1, _InIt2 _F return true; } -// FUNCTION TEMPLATE search template _NODISCARD _CONSTEXPR20 _FwdItHaystack search(_FwdItHaystack _First1, _FwdItHaystack _Last1, const _FwdItPat _First2, const _FwdItPat _Last2, _Pr _Pred) { // find first [_First2, _Last2) satisfying _Pred @@ -2018,7 +1966,6 @@ _NODISCARD _CONSTEXPR20 _FwdItHaystack search( #ifdef __cpp_lib_concepts namespace ranges { - // FUNCTION TEMPLATE _Equal_rev_pred // clang-format off template concept _Equal_rev_pred_can_memcmp = is_same_v<_Pj1, identity> && is_same_v<_Pj2, identity> @@ -2059,7 +2006,6 @@ namespace ranges { } // clang-format on - // VARIABLE ranges::search class _Search_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -2168,7 +2114,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE search_n template _NODISCARD _CONSTEXPR20 _FwdIt search_n( const _FwdIt _First, _FwdIt _Last, const _Diff _Count_raw, const _Ty& _Val, _Pr _Pred) { @@ -2263,7 +2208,6 @@ _NODISCARD _FwdIt search_n(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Las #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::search_n class _Search_n_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -2425,7 +2369,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE find_end template _NODISCARD _CONSTEXPR20 _FwdIt1 find_end( _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2, _Pr _Pred) { @@ -2528,7 +2471,6 @@ _NODISCARD _FwdIt1 find_end(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _Fwd #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::find_end class _Find_end_fn : private _Not_quite_object { private: template @@ -2692,7 +2634,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE find_first_of template _NODISCARD _CONSTEXPR20 _FwdIt1 find_first_of( _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2, _Pr _Pred) { @@ -2736,7 +2677,6 @@ _NODISCARD _FwdIt1 find_first_of(_ExPo&& _Exec, const _FwdIt1 _First1, const _Fw #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::find_first_of class _Find_first_of_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -2796,11 +2736,9 @@ namespace ranges { inline constexpr _Find_first_of_fn find_first_of{_Not_quite_object::_Construct_tag{}}; - // ALIAS TEMPLATE swap_ranges_result template using swap_ranges_result = in_in_result<_In1, _In2>; - // VARIABLE ranges::swap_ranges class _Swap_ranges_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -2893,7 +2831,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE swap_ranges template _CONSTEXPR20 _FwdIt2 swap_ranges(const _FwdIt1 _First1, const _FwdIt1 _Last1, _FwdIt2 _First2) { // swap [_First1, _Last1) with [_First2, ...) @@ -2914,7 +2851,6 @@ _FwdIt2 swap_ranges(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Dest) noe } #endif // _HAS_CXX17 -// FUNCTION TEMPLATE transform template _CONSTEXPR20 _OutIt transform(const _InIt _First, const _InIt _Last, _OutIt _Dest, _Fn _Func) { // transform [_First, _Last) with _Func @@ -2962,15 +2898,12 @@ _FwdIt3 transform(_ExPo&& _Exec, const _FwdIt1 _First1, const _FwdIt1 _Last1, co #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE unary_transform_result template using unary_transform_result = in_out_result<_In, _Out>; - // ALIAS TEMPLATE binary_transform_result template using binary_transform_result = in_in_out_result<_In1, _In2, _Out>; - // VARIABLE ranges::transform class _Transform_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3074,7 +3007,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE replace template _CONSTEXPR20 void replace(const _FwdIt _First, const _FwdIt _Last, const _Ty& _Oldval, const _Ty& _Newval) { // replace each matching _Oldval with _Newval @@ -3096,7 +3028,6 @@ void replace(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty& #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::replace class _Replace_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3152,7 +3083,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE replace_if template _CONSTEXPR20 void replace_if(const _FwdIt _First, const _FwdIt _Last, _Pr _Pred, const _Ty& _Val) { // replace each satisfying _Pred with _Val @@ -3173,7 +3103,6 @@ void replace_if(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, _Pr _Pred, const _Ty #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::replace_if class _Replace_if_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3228,7 +3157,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE replace_copy template _CONSTEXPR20 _OutIt replace_copy(_InIt _First, _InIt _Last, _OutIt _Dest, const _Ty& _Oldval, const _Ty& _Newval) { // copy replacing each matching _Oldval with _Newval @@ -3262,11 +3190,9 @@ _FwdIt2 replace_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, cons #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE replace_copy_result template using replace_copy_result = in_out_result<_In, _Out>; - // VARIABLE ranges::replace_copy class _Replace_copy_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3326,7 +3252,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE replace_copy_if template _CONSTEXPR20 _OutIt replace_copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred, const _Ty& _Val) { // copy replacing each satisfying _Pred with _Val @@ -3360,11 +3285,9 @@ _FwdIt2 replace_copy_if(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _ #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE replace_copy_if_result template using replace_copy_if_result = in_out_result<_In, _Out>; - // VARIABLE ranges::replace_copy_if class _Replace_copy_if_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3421,7 +3344,6 @@ namespace ranges { inline constexpr _Replace_copy_if_fn replace_copy_if{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::fill class _Fill_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3467,7 +3389,6 @@ namespace ranges { inline constexpr _Fill_fn fill{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::generate class _Generate_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3510,7 +3431,6 @@ namespace ranges { inline constexpr _Generate_fn generate{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::generate_n class _Generate_n_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3537,7 +3457,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE generate template _CONSTEXPR20 void generate(_FwdIt _First, _FwdIt _Last, _Fn _Func) { // replace [_First, _Last) with _Func() _Adl_verify_range(_First, _Last); @@ -3557,7 +3476,6 @@ void generate(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Fn _Func) noexcept /* termi } #endif // _HAS_CXX17 -// FUNCTION TEMPLATE generate_n template _CONSTEXPR20 _OutIt generate_n(_OutIt _Dest, const _Diff _Count_raw, _Fn _Func) { // replace [_Dest, _Dest + _Count) with _Func() @@ -3586,7 +3504,6 @@ _FwdIt generate_n(_ExPo&&, const _FwdIt _Dest, const _Diff _Count_raw, _Fn _Func } #endif // _HAS_CXX17 -// FUNCTION TEMPLATE remove_copy template _CONSTEXPR20 _OutIt remove_copy(_InIt _First, _InIt _Last, _OutIt _Dest, const _Ty& _Val) { // copy omitting each matching _Val @@ -3616,7 +3533,6 @@ _FwdIt2 remove_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, const } #endif // _HAS_CXX17 -// FUNCTION TEMPLATE remove_copy_if template _CONSTEXPR20 _OutIt remove_copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred) { // copy omitting each element satisfying _Pred @@ -3657,7 +3573,6 @@ _NODISCARD _FwdIt remove_if(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _P #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::remove class _Remove_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3711,7 +3626,6 @@ namespace ranges { inline constexpr _Remove_fn remove{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::remove_if class _Remove_if_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3764,11 +3678,9 @@ namespace ranges { inline constexpr _Remove_if_fn remove_if{_Not_quite_object::_Construct_tag{}}; - // ALIAS TEMPLATE remove_copy_result template using remove_copy_result = in_out_result<_In, _Out>; - // VARIABLE ranges::remove_copy class _Remove_copy_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3826,11 +3738,9 @@ namespace ranges { inline constexpr _Remove_copy_fn remove_copy{_Not_quite_object::_Construct_tag{}}; - // ALIAS TEMPLATE remove_copy_if_result template using remove_copy_if_result = in_out_result<_In, _Out>; - // VARIABLE ranges::remove_copy_if class _Remove_copy_if_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -3891,7 +3801,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE unique template _NODISCARD _CONSTEXPR20 _FwdIt unique(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // remove each satisfying _Pred with previous @@ -3940,7 +3849,6 @@ _NODISCARD _FwdIt unique(_ExPo&&, _FwdIt _First, _FwdIt _Last) noexcept /* termi #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::unique class _Unique_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -4005,7 +3913,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE unique_copy // clang-format off #ifdef __cpp_lib_concepts template @@ -4100,11 +4007,9 @@ _FwdIt2 unique_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest) noexc #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE unique_copy_result template using unique_copy_result = in_out_result<_In, _Out>; - // VARIABLE ranges::unique_copy // clang-format off template concept _Is_input_with_value_type = input_iterator<_It> && same_as, _Ty>; @@ -4207,7 +4112,6 @@ namespace ranges { inline constexpr _Unique_copy_fn unique_copy{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::reverse // clang-format off // concept-constrained for strict enforcement as it is used by several algorithms template @@ -4277,7 +4181,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE reverse_copy template _CONSTEXPR20 _OutIt reverse_copy(_BidIt _First, _BidIt _Last, _OutIt _Dest) { // copy reversing elements in [_First, _Last) @@ -4336,11 +4239,9 @@ _FwdIt reverse_copy(_ExPo&&, _BidIt _First, _BidIt _Last, _FwdIt _Dest) noexcept #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE reverse_copy_result template using reverse_copy_result = in_out_result<_In, _Out>; - // VARIABLE ranges::reverse_copy class _Reverse_copy_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -4426,7 +4327,6 @@ namespace ranges { #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::rotate template _NODISCARD constexpr subrange<_It> _Reverse_until_mid_unchecked(_It _First, const _It _Mid, _It _Last) { // reverse until either _First or _Last hits _Mid @@ -4535,7 +4435,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE rotate_copy template _CONSTEXPR20 _OutIt rotate_copy(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last, _OutIt _Dest) { // copy rotating [_First, _Last) @@ -4561,11 +4460,9 @@ _FwdIt2 rotate_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Mid, _FwdIt1 _Last, _FwdIt #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE rotate_copy_result template using rotate_copy_result = in_out_result<_In, _Out>; - // VARIABLE ranges::rotate_copy class _Rotate_copy_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -4618,7 +4515,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE sample template _SampleIt _Sample_reservoir_unchecked( _PopIt _First, const _PopIt _Last, const _SampleIt _Dest, const _Diff _Count, _RngFn& _RngFunc) { @@ -4704,7 +4600,6 @@ _SampleIt sample(_PopIt _First, _PopIt _Last, _SampleIt _Dest, _Diff _Count, } #ifdef __cpp_lib_concepts -// CONCEPT uniform_random_bit_generator // clang-format off template concept uniform_random_bit_generator = invocable<_Ty&> @@ -4719,7 +4614,6 @@ concept uniform_random_bit_generator = invocable<_Ty&> // clang-format on namespace ranges { - // VARIABLE ranges::sample class _Sample_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -4824,7 +4718,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE shuffle WITH URNG template void _Random_shuffle1(_RanIt _First, _RanIt _Last, _RngFn& _RngFunc) { // shuffle [_First, _Last) using random function _RngFunc @@ -4856,7 +4749,6 @@ void shuffle(_RanIt _First, _RanIt _Last, _Urng&& _Func) { // shuffle [_First, _ #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::shuffle class _Shuffle_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -4915,14 +4807,12 @@ namespace ranges { #endif // __cpp_lib_concepts #if _HAS_AUTO_PTR_ETC -// FUNCTION TEMPLATE random_shuffle WITH RANDOM FN template void random_shuffle(_RanIt _First, _RanIt _Last, _RngFn&& _RngFunc) { // shuffle [_First, _Last) using random function _RngFunc _Random_shuffle1(_First, _Last, _RngFunc); } -// STRUCT _Rand_urng_from_func struct _Rand_urng_from_func { // wrap rand() as a URNG using result_type = unsigned int; @@ -4939,7 +4829,6 @@ struct _Rand_urng_from_func { // wrap rand() as a URNG } }; -// FUNCTION TEMPLATE random_shuffle template void random_shuffle(_RanIt _First, _RanIt _Last) { // shuffle [_First, _Last) using rand() _Rand_urng_from_func _Func; @@ -4948,7 +4837,6 @@ void random_shuffle(_RanIt _First, _RanIt _Last) { // shuffle [_First, _Last) us #endif // _HAS_AUTO_PTR_ETC #if _HAS_CXX20 -// FUNCTION TEMPLATE shift_left template constexpr _FwdIt shift_left(_FwdIt _First, const _FwdIt _Last, _Iter_diff_t<_FwdIt> _Pos_to_shift) { // shift [_First, _Last) left by _Pos_to_shift @@ -4988,7 +4876,6 @@ _FwdIt shift_left(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Iter_diff_t<_FwdIt> _Po return _STD shift_left(_First, _Last, _Pos_to_shift); } -// FUNCTION TEMPLATE shift_right template constexpr _FwdIt shift_right(_FwdIt _First, const _FwdIt _Last, _Iter_diff_t<_FwdIt> _Pos_to_shift) { // shift [_First, _Last) right by _Pos_to_shift @@ -5069,7 +4956,6 @@ _FwdIt shift_right(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Iter_diff_t<_FwdIt> _P } #endif // _HAS_CXX20 -// FUNCTION TEMPLATE partition template _CONSTEXPR20 _FwdIt partition(_FwdIt _First, const _FwdIt _Last, _Pr _Pred) { // move elements satisfying _Pred to beginning of sequence @@ -5134,7 +5020,6 @@ _FwdIt partition(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) no #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::partition class _Partition_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -5217,7 +5102,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE stable_partition template _BidIt _Buffered_rotate_unchecked(const _BidIt _First, const _BidIt _Mid, const _BidIt _Last, const _Iter_diff_t<_BidIt> _Count1, const _Iter_diff_t<_BidIt> _Count2, _Iter_value_t<_BidIt>* const _Temp_ptr, @@ -5389,7 +5273,6 @@ _BidIt stable_partition(_ExPo&&, _BidIt _First, _BidIt _Last, _Pr _Pred) noexcep #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::stable_partition template _It _Buffered_rotate_common(const _It _First, const _It _Mid, const _It _Last, const iter_difference_t<_It> _Count1, const iter_difference_t<_It> _Count2, iter_value_t<_It>* const _Temp_ptr, const ptrdiff_t _Capacity) { @@ -5590,7 +5473,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE push_heap template _CONSTEXPR20 void _Push_heap_by_index( _RanIt _First, _Iter_diff_t<_RanIt> _Hole, _Iter_diff_t<_RanIt> _Top, _Ty&& _Val, _Pr _Pred) { @@ -5629,7 +5511,6 @@ _CONSTEXPR20 void push_heap(_RanIt _First, _RanIt _Last) { #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::push_heap // clang-format off template requires sortable<_It, _Pr, _Pj1> && indirectly_writable<_It, _Ty> @@ -5703,7 +5584,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE pop_heap template _CONSTEXPR20 void _Pop_heap_hole_by_index( _RanIt _First, _Iter_diff_t<_RanIt> _Hole, _Iter_diff_t<_RanIt> _Bottom, _Ty&& _Val, _Pr _Pred) { @@ -5770,7 +5650,6 @@ _CONSTEXPR20 void pop_heap(_RanIt _First, _RanIt _Last) { #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::pop_heap // clang-format off template requires sortable<_It, _Pr, _Pj1> && indirectly_writable<_It, _Ty> @@ -5875,7 +5754,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE make_heap template _CONSTEXPR20 void _Make_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { // make [_First, _Last) into a heap @@ -5902,7 +5780,6 @@ _CONSTEXPR20 void make_heap(_RanIt _First, _RanIt _Last) { // make [_First, _Las #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::make_heap // clang-format off template requires sortable<_It, _Pr, _Pj> @@ -5957,7 +5834,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATES is_heap AND is_heap_until template _CONSTEXPR20 _RanIt _Is_heap_until_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { // find extent of range that is a heap @@ -6024,7 +5900,6 @@ _NODISCARD bool is_heap(_ExPo&& _Exec, _RanIt _First, _RanIt _Last) noexcept /* #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::is_heap template _NODISCARD constexpr _It _Is_heap_until_unchecked( _It _First, const iter_difference_t<_It> _Size, _Pr _Pred, _Pj _Proj) { @@ -6077,7 +5952,6 @@ namespace ranges { inline constexpr _Is_heap_fn is_heap{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::is_heap_until class _Is_heap_until_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -6108,7 +5982,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE sort_heap template _CONSTEXPR20 void _Sort_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { // order heap by repeatedly popping @@ -6138,7 +6011,6 @@ _CONSTEXPR20 void sort_heap(_RanIt _First, _RanIt _Last) { // order heap by repe #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::sort_heap // clang-format off template requires sortable<_It, _Pr, _Pj> @@ -6185,7 +6057,6 @@ namespace ranges { inline constexpr _Sort_heap_fn sort_heap{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::lower_bound template _NODISCARD constexpr _It _Lower_bound_unchecked( _It _First, iter_difference_t<_It> _Count, const _Ty& _Val, _Pr _Pred, _Pj _Proj) { @@ -6243,7 +6114,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE upper_bound template _NODISCARD _CONSTEXPR20 _FwdIt upper_bound(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Pr _Pred) { // find first element that _Val is before @@ -6274,7 +6144,6 @@ _NODISCARD _CONSTEXPR20 _FwdIt upper_bound(_FwdIt _First, _FwdIt _Last, const _T #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::upper_bound template _NODISCARD constexpr _It _Upper_bound_unchecked( _It _First, iter_difference_t<_It> _Count, const _Ty& _Val, _Pr _Pred, _Pj _Proj) { @@ -6330,7 +6199,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE equal_range template _NODISCARD _CONSTEXPR20 pair<_FwdIt, _FwdIt> equal_range(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Pr _Pred) { // find range equivalent to _Val @@ -6376,7 +6244,6 @@ _NODISCARD _CONSTEXPR20 pair<_FwdIt, _FwdIt> equal_range(_FwdIt _First, _FwdIt _ #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::equal_range class _Equal_range_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -6438,7 +6305,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE binary_search template _NODISCARD _CONSTEXPR20 bool binary_search(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Pr _Pred) { // test if _Val equivalent to some element @@ -6457,7 +6323,6 @@ _NODISCARD _CONSTEXPR20 bool binary_search(_FwdIt _First, _FwdIt _Last, const _T #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::binary_search class _Binary_search_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -6489,7 +6354,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE merge _NODISCARD constexpr _Distance_unknown _Idl_dist_add(_Distance_unknown, _Distance_unknown) { return {}; } @@ -6581,11 +6445,9 @@ _FwdIt3 merge(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE merge_result template using merge_result = in_in_out_result<_In1, _In2, _Out>; - // VARIABLE ranges::merge class _Merge_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -6664,7 +6526,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE inplace_merge // The "usual invariants" for the inplace_merge helpers below are: // [_First, _Mid) and [_Mid, _Last) are sorted // _Pred(*_Mid, *_First) note: this means *_Mid is the "lowest" element @@ -6930,7 +6791,6 @@ void inplace_merge(_ExPo&&, _BidIt _First, _BidIt _Mid, _BidIt _Last) noexcept / #ifdef __cpp_lib_concepts namespace ranges { - // FUNCTION TEMPLATE _Is_sorted_until_unchecked // clang-format off template _Se, class _Pr, class _Pj> requires indirect_strict_weak_order<_Pr, projected<_It, _Pj>> @@ -6949,7 +6809,6 @@ namespace ranges { return _First; } - // VARIABLE ranges::inplace_merge template void _Rotate_one_right(_It _First, _It _Mid, _It _Last) { // exchanges the range [_First, _Mid) with [_Mid, _Last) @@ -7270,7 +7129,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE sort template _CONSTEXPR20 _BidIt _Insertion_sort_unchecked(const _BidIt _First, const _BidIt _Last, _Pr _Pred) { // insertion sort [_First, _Last) @@ -7606,7 +7464,6 @@ namespace ranges { } } - // VARIABLE ranges::sort class _Sort_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -7676,7 +7533,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE stable_sort template _Ty* _Uninitialized_merge_move(_FwdIt _First, const _FwdIt _Mid, const _FwdIt _Last, _Ty* const _Dest, _Pr _Pred) { // move merging ranges to uninitialized storage @@ -7873,7 +7729,6 @@ void stable_sort(_ExPo&& _Exec, _BidIt _First, _BidIt _Last) noexcept /* termina #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::stable_sort class _Stable_sort_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -8129,7 +7984,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE partial_sort template _CONSTEXPR20 void partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pred) { // order [_First, _Last) up to _Mid @@ -8177,7 +8031,6 @@ void partial_sort(_ExPo&&, _RanIt _First, _RanIt _Mid, _RanIt _Last) noexcept /* #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::partial_sort class _Partial_sort_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -8255,7 +8108,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE partial_sort_copy template _CONSTEXPR20 _RanIt partial_sort_copy(_InIt _First1, _InIt _Last1, _RanIt _First2, _RanIt _Last2, _Pr _Pred) { // copy [_First1, _Last1) into [_First2, _Last2) @@ -8315,11 +8167,9 @@ _RanIt partial_sort_copy(_ExPo&&, _FwdIt _First1, _FwdIt _Last1, _RanIt _First2, #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE partial_sort_copy_result template using partial_sort_copy_result = in_out_result<_In, _Out>; - // VARIABLE ranges::partial_sort_copy class _Partial_sort_copy_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -8410,7 +8260,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE nth_element template _CONSTEXPR20 void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last, _Pr _Pred) { // order Nth element @@ -8460,7 +8309,6 @@ void nth_element(_ExPo&&, _RanIt _First, _RanIt _Nth, _RanIt _Last) noexcept /* #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::nth_element class _Nth_element_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -8535,7 +8383,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE includes template _NODISCARD _CONSTEXPR20 bool includes(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _Pr _Pred) { // test if every element in sorted [_First2, _Last2) is in sorted [_First1, _Last1) @@ -8567,7 +8414,6 @@ _NODISCARD _CONSTEXPR20 bool includes(_InIt1 _First1, _InIt1 _Last1, _InIt2 _Fir } #if _HAS_CXX17 -// FUNCTION TEMPLATE includes template = 0> _NODISCARD bool includes(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) noexcept /* terminates */ { @@ -8590,7 +8436,6 @@ _NODISCARD bool includes(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Firs #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::includes class _Includes_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -8662,7 +8507,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE set_union template _CONSTEXPR20 _OutIt set_union(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred) { // OR sets [_First1, _Last1) and [_First2, _Last2) @@ -8725,11 +8569,9 @@ _FwdIt3 set_union(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Fw #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE set_union_result template using set_union_result = in_in_out_result<_In1, _In2, _Out>; - // VARIABLE ranges::set_union class _Set_union_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -8802,7 +8644,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE set_intersection template _CONSTEXPR20 _OutIt set_intersection( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred) { @@ -8853,11 +8694,9 @@ _FwdIt3 set_intersection(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE set_intersection_result template using set_intersection_result = in_in_out_result<_In1, _In2, _Out>; - // VARIABLE ranges::set_intersection class _Set_intersection_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -8937,7 +8776,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE set_difference template _CONSTEXPR20 _OutIt set_difference( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred) { @@ -8989,11 +8827,9 @@ _FwdIt3 set_difference(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _ #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE set_difference_result template using set_difference_result = in_out_result<_In, _Out>; - // VARIABLE ranges::set_difference class _Set_difference_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -9069,7 +8905,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE set_symmetric_difference template _CONSTEXPR20 _OutIt set_symmetric_difference( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred) { @@ -9135,11 +8970,9 @@ _FwdIt3 set_symmetric_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdI #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE set_symmetric_difference_result template using set_symmetric_difference_result = in_in_out_result<_In1, _In2, _Out>; - // VARIABLE ranges::set_symmetric_difference class _Set_symmetric_difference_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -9223,7 +9056,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE max_element template constexpr _FwdIt _Max_element_unchecked(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find largest element _FwdIt _Found = _First; @@ -9267,7 +9099,6 @@ _NODISCARD _FwdIt max_element(_ExPo&&, _FwdIt _First, _FwdIt _Last) noexcept /* #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::max_element template _NODISCARD constexpr _It _Max_element_unchecked(_It _First, const _Se _Last, _Pr _Pred, _Pj _Proj) { _STL_INTERNAL_STATIC_ASSERT(forward_iterator<_It>); @@ -9316,7 +9147,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE min_element template constexpr _FwdIt _Min_element_unchecked(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find smallest element _FwdIt _Found = _First; @@ -9360,7 +9190,6 @@ _NODISCARD _FwdIt min_element(_ExPo&&, _FwdIt _First, _FwdIt _Last) noexcept /* #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::min_element template _NODISCARD constexpr _It _Min_element_unchecked(_It _First, const _Se _Last, _Pr _Pred, _Pj _Proj) { _STL_INTERNAL_STATIC_ASSERT(forward_iterator<_It>); @@ -9409,7 +9238,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE minmax_element template constexpr pair<_FwdIt, _FwdIt> _Minmax_element_unchecked(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find smallest and largest elements @@ -9482,11 +9310,9 @@ _NODISCARD pair<_FwdIt, _FwdIt> minmax_element(_ExPo&&, _FwdIt _First, _FwdIt _L #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE minmax_element_result template using minmax_element_result = min_max_result<_Ty>; - // VARIABLE ranges::minmax_element template constexpr min_max_result<_It> _Minmax_element_unchecked(_It _First, const _Se _Last, _Pr _Pred, _Pj _Proj) { _STL_INTERNAL_STATIC_ASSERT(forward_iterator<_It>); @@ -9571,7 +9397,6 @@ namespace ranges { #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -// FUNCTION TEMPLATE max (for initializer_list) template _NODISCARD constexpr _Ty(max)(initializer_list<_Ty> _Ilist, _Pr _Pred) { // return leftmost/largest @@ -9587,7 +9412,6 @@ _NODISCARD constexpr _Ty(max)(initializer_list<_Ty> _Ilist) { #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::max // clang-format off template concept _Prefer_iterator_copies = // When we have a choice, should we copy iterators or copy elements? @@ -9651,7 +9475,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE min (for initializer_list) template _NODISCARD constexpr _Ty(min)(initializer_list<_Ty> _Ilist, _Pr _Pred) { // return leftmost/smallest @@ -9667,7 +9490,6 @@ _NODISCARD constexpr _Ty(min)(initializer_list<_Ty> _Ilist) { #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::min class _Min_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -9723,7 +9545,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE minmax template _NODISCARD constexpr pair minmax(const _Ty& _Left, const _Ty& _Right, _Pr _Pred) noexcept( noexcept(_DEBUG_LT_PRED(_Pred, _Right, _Left))) /* strengthened */ { @@ -9762,11 +9583,9 @@ _NODISCARD constexpr pair<_Ty, _Ty> minmax(initializer_list<_Ty> _Ilist) { #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE minmax_result template using minmax_result = min_max_result<_Ty>; - // VARIABLE ranges::minmax class _Minmax_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -9858,7 +9677,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE next_permutation template _CONSTEXPR20 bool next_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred) { // permute and test for pure ascending @@ -9898,11 +9716,9 @@ _CONSTEXPR20 bool next_permutation(_BidIt _First, _BidIt _Last) { #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE next_permutation_result template using next_permutation_result = in_found_result<_In>; - // VARIABLE ranges::next_permutation class _Next_permutation_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -9969,7 +9785,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE prev_permutation template _CONSTEXPR20 bool prev_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred) { // reverse permute and test for pure descending @@ -10009,11 +9824,9 @@ _CONSTEXPR20 bool prev_permutation(_BidIt _First, _BidIt _Last) { #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE prev_permutation_result template using prev_permutation_result = in_found_result<_In>; - // VARIABLE ranges::prev_permutation class _Prev_permutation_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -10080,7 +9893,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATES is_sorted AND is_sorted_until template _NODISCARD _CONSTEXPR20 _FwdIt is_sorted_until(const _FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find extent of range that is ordered by predicate @@ -10144,7 +9956,6 @@ _NODISCARD bool is_sorted(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last) noexcept / #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::is_sorted class _Is_sorted_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -10170,7 +9981,6 @@ namespace ranges { inline constexpr _Is_sorted_fn is_sorted{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::is_sorted_until class _Is_sorted_until_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -10200,7 +10010,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE clamp template _NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, const _Ty& _Max_val, _Pr _Pred) { // returns _Val constrained to [_Min_val, _Max_val] @@ -10230,7 +10039,6 @@ _NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, cons #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::clamp class _Clamp_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -10257,7 +10065,6 @@ namespace ranges { inline constexpr _Clamp_fn clamp{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::lexicographical_compare class _Lexicographical_compare_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; diff --git a/stl/inc/any b/stl/inc/any index 4e62d1b618d..64b0c106e26 100644 --- a/stl/inc/any +++ b/stl/inc/any @@ -31,7 +31,6 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN -// CLASS bad_any_cast class bad_any_cast : public bad_cast { // thrown by failed any_cast public: _NODISCARD virtual const char* __CLR_OR_THIS_CALL what() const noexcept override { @@ -108,7 +107,6 @@ template inline constexpr _Any_small_RTTI _Any_small_RTTI_obj = { &_Any_small_RTTI::_Destroy_impl<_Ty>, &_Any_small_RTTI::_Copy_impl<_Ty>, &_Any_small_RTTI::_Move_impl<_Ty>}; -// CLASS any class any { // storage for any (CopyConstructible) type public: // Construction and destruction [any.cons] diff --git a/stl/inc/array b/stl/inc/array index ef04a8ba5b9..c417a1826b4 100644 --- a/stl/inc/array +++ b/stl/inc/array @@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE _Array_const_iterator #if _ITERATOR_DEBUG_LEVEL != 0 struct _Iterator_base12_compatible { // TRANSITION, for binary compatibility _Container_proxy* _Myproxy{}; @@ -327,7 +326,6 @@ struct pointer_traits<_Array_const_iterator<_Ty, _Size>> { }; #endif // _HAS_CXX20 -// CLASS TEMPLATE _Array_iterator template class _Array_iterator : public _Array_const_iterator<_Ty, _Size> { public: @@ -433,7 +431,6 @@ struct pointer_traits<_Array_iterator<_Ty, _Size>> { }; #endif // _HAS_CXX20 -// CLASS TEMPLATE array template class array { // fixed size array of values public: @@ -850,7 +847,6 @@ _NODISCARD _CONSTEXPR20 bool operator>=(const array<_Ty, _Size>& _Left, const ar #endif // ^^^ !defined(__cpp_lib_concepts) ^^^ #if _HAS_CXX20 -// FUNCTION TEMPLATE to_array template _NODISCARD constexpr array, _Size> _To_array_lvalue_impl( _Ty (&_Array)[_Size], index_sequence<_Idx...>) { @@ -882,7 +878,6 @@ _NODISCARD constexpr array, _Size> to_array(_Ty(&&_Array)[_Size } #endif // _HAS_CXX20 -// TUPLE INTERFACE TO array template _NODISCARD constexpr _Ty& get(array<_Ty, _Size>& _Arr) noexcept { static_assert(_Idx < _Size, "array index out of bounds"); diff --git a/stl/inc/atomic b/stl/inc/atomic index 7442c8fa6c7..b9040148186 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -49,7 +49,6 @@ _STL_DISABLE_CLANG_WARNINGS #endif // _DEBUG #endif // _INVALID_MEMORY_ORDER -// MACRO _STD_COMPARE_EXCHANGE_128 #ifdef _WIN64 #if _STD_ATOMIC_ALWAYS_USE_CMPXCHG16B == 1 #define _STD_COMPARE_EXCHANGE_128 _InterlockedCompareExchange128 @@ -67,7 +66,6 @@ extern "C" _NODISCARD char __stdcall __std_atomic_has_cmpxchg16b() noexcept; #endif // _STD_ATOMIC_ALWAYS_USE_CMPXCHG16B == 1 #endif // _WIN64 -// MACRO _ATOMIC_HAS_DCAS // Controls whether atomic::is_always_lock_free triggers for sizeof(void *) or 2 * sizeof(void *) #if _STD_ATOMIC_ALWAYS_USE_CMPXCHG16B == 1 || !defined(_M_X64) || defined(_M_ARM64EC) #define _ATOMIC_HAS_DCAS 1 @@ -75,7 +73,6 @@ extern "C" _NODISCARD char __stdcall __std_atomic_has_cmpxchg16b() noexcept; #define _ATOMIC_HAS_DCAS 0 #endif // _STD_ATOMIC_ALWAYS_USE_CMPXCHG16B == 1 || !defined(_M_X64) || defined(_M_ARM64EC) -// MACRO _ATOMIC_CHOOSE_INTRINSIC #if defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC)) #define _ATOMIC_CHOOSE_INTRINSIC(_Order, _Result, _Intrinsic, ...) \ _Check_memory_order(_Order); \ @@ -103,7 +100,6 @@ extern "C" _NODISCARD char __stdcall __std_atomic_has_cmpxchg16b() noexcept; } #endif // hardware -// LOCK-FREE PROPERTY #define ATOMIC_BOOL_LOCK_FREE 2 #define ATOMIC_CHAR_LOCK_FREE 2 #ifdef __cpp_lib_char8_t @@ -131,7 +127,6 @@ _END_EXTERN_C #endif _STD_BEGIN -// STRUCT TEMPLATE _Storage_for #if _CMPXCHG_MASK_OUT_PADDING_BITS struct _Form_mask_t {}; _INLINE_VAR constexpr _Form_mask_t _Form_mask{}; @@ -168,7 +163,6 @@ inline constexpr bool _Might_have_non_value_bits = !has_unique_object_representations_v<_Ty> && !is_floating_point_v<_Ty>; #endif // _CMPXCHG_MASK_OUT_PADDING_BITS -// FENCES extern "C" inline void atomic_thread_fence(const memory_order _Order) noexcept { if (_Order == memory_order_relaxed) { return; @@ -201,13 +195,11 @@ extern "C" inline void atomic_signal_fence(const memory_order _Order) noexcept { } } -// FUNCTION TEMPLATE kill_dependency template _Ty kill_dependency(_Ty _Arg) noexcept { // "magic" template that kills dependency ordering when called return _Arg; } -// FUNCTION _Check_memory_order inline void _Check_memory_order(const memory_order _Order) noexcept { // check that _Order is a valid memory_order if (static_cast(_Order) > static_cast(memory_order_seq_cst)) { @@ -215,7 +207,6 @@ inline void _Check_memory_order(const memory_order _Order) noexcept { } } -// FUNCTION _Check_store_memory_order inline void _Check_store_memory_order(const memory_order _Order) noexcept { switch (_Order) { case memory_order_relaxed: @@ -232,7 +223,6 @@ inline void _Check_store_memory_order(const memory_order _Order) noexcept { } } -// FUNCTION _Check_load_memory_order inline void _Check_load_memory_order(const memory_order _Order) noexcept { switch (_Order) { case memory_order_relaxed: @@ -249,7 +239,6 @@ inline void _Check_load_memory_order(const memory_order _Order) noexcept { } } -// FUNCTION _Combine_cas_memory_orders _NODISCARD inline memory_order _Combine_cas_memory_orders( const memory_order _Success, const memory_order _Failure) noexcept { // Finds upper bound of a compare/exchange memory order @@ -282,7 +271,6 @@ _NODISCARD inline memory_order _Combine_cas_memory_orders( return _Combined_memory_orders[static_cast(_Success)][static_cast(_Failure)]; } -// FUNCTION TEMPLATE _Atomic_reinterpret_as template _NODISCARD _Integral _Atomic_reinterpret_as(const _Ty& _Source) noexcept { // interprets _Source as the supplied integral type @@ -298,7 +286,6 @@ _NODISCARD _Integral _Atomic_reinterpret_as(const _Ty& _Source) noexcept { } } -// FUNCTION _Load_barrier inline void _Load_barrier(const memory_order _Order) noexcept { // implement memory barrier for atomic load functions switch (_Order) { case memory_order_relaxed: @@ -324,7 +311,6 @@ struct _Atomic_padded { }; #else // ^^^ don't break ABI / break ABI vvv -// STRUCT TEMPLATE _Atomic_storage_traits template struct _Atomic_storage_traits { // properties for how _Ty is stored in an atomic static constexpr size_t _Storage_size = sizeof(_Ty) == 1 ? 1 @@ -346,7 +332,6 @@ struct _Atomic_storage_traits<_Ty&> { // properties for how _Ty is stored in an static constexpr bool _Uses_padding = false; }; -// STRUCT TEMPLATE _Atomic_padded template ::_Uses_padding> struct _Atomic_padded { // aggregate to allow explicit constexpr zeroing of padding alignas(_Atomic_storage_traits<_Ty>::_Storage_size) mutable _Ty _Value; @@ -377,7 +362,6 @@ struct _Atomic_storage_types<_Ty&> { using _Spinlock = _Smtx_t*; // POINTER TO mutex }; -// STRUCT TEMPLATE _Atomic_storage #if 1 // TRANSITION, ABI template )> #else // ^^^ don't break ABI / break ABI vvv @@ -1325,7 +1309,6 @@ struct _Atomic_storage<_Ty&, 16> { // lock-free using 16-byte intrinsics }; #endif // _WIN64 -// STRUCT TEMPLATE _Atomic_integral template struct _Atomic_integral; // not defined @@ -1659,7 +1642,6 @@ _INLINE_VAR constexpr bool _Deprecate_non_lock_free_volatile = true; template _CXX20_DEPRECATE_VOLATILE _INLINE_VAR constexpr bool _Deprecate_non_lock_free_volatile<_Ty, false> = true; -// STRUCT TEMPLATE _Atomic_integral_facade template struct _Atomic_integral_facade : _Atomic_integral<_Ty> { // provides operator overloads and other support for atomic integral specializations @@ -1793,7 +1775,6 @@ struct _Atomic_integral_facade : _Atomic_integral<_Ty> { } }; -// STRUCT TEMPLATE _Atomic_integral_facade template struct _Atomic_integral_facade<_Ty&> : _Atomic_integral<_Ty&> { // provides operator overloads and other support for atomic integral specializations @@ -1989,7 +1970,6 @@ struct _Atomic_floating<_Ty&> : _Atomic_storage<_Ty&> { }; #endif // _HAS_CXX20 -// STRUCT TEMPLATE _Atomic_pointer template struct _Atomic_pointer : _Atomic_storage<_Ty> { using _Base = _Atomic_storage<_Ty>; @@ -2092,7 +2072,6 @@ struct _Atomic_pointer : _Atomic_storage<_Ty> { }; -// STRUCT TEMPLATE _Atomic_pointer template struct _Atomic_pointer<_Ty&> : _Atomic_storage<_Ty&> { using _Base = _Atomic_storage<_Ty&>; @@ -2153,7 +2132,6 @@ struct _Atomic_pointer<_Ty&> : _Atomic_storage<_Ty&> { }; -// STRUCT TEMPLATE atomic #define ATOMIC_VAR_INIT(_Value) \ { _Value } @@ -2466,7 +2444,6 @@ private: }; #endif // _HAS_CXX20 -// NONMEMBER OPERATIONS ON ATOMIC TYPES template _NODISCARD bool atomic_is_lock_free(const volatile atomic<_Ty>* _Mem) noexcept { return _Mem->is_lock_free(); @@ -2777,7 +2754,6 @@ void atomic_notify_all(atomic<_Ty>* const _Mem) noexcept /* strengthened */ { } #endif // _HAS_CXX20 -// ATOMIC TYPEDEFS using atomic_bool = atomic; using atomic_char = atomic; @@ -2840,7 +2816,6 @@ using atomic_signed_lock_free = atomic_intptr_t; using atomic_unsigned_lock_free = atomic_uintptr_t; #endif // _HAS_CXX20 -// STRUCT atomic_flag #define ATOMIC_FLAG_INIT \ {} struct atomic_flag { // flag with test-and-set semantics @@ -2906,7 +2881,6 @@ struct atomic_flag { // flag with test-and-set semantics }; -// atomic_flag NONMEMBERS #if _HAS_CXX20 _NODISCARD inline bool atomic_flag_test(const volatile atomic_flag* const _Flag) noexcept { return _Flag->test(); diff --git a/stl/inc/bitset b/stl/inc/bitset index e8e74b7317c..27a2cd2bc2b 100644 --- a/stl/inc/bitset +++ b/stl/inc/bitset @@ -19,7 +19,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE bitset template class bitset { // store fixed-length sequence of Boolean elements public: @@ -28,7 +27,6 @@ public: using _Ty = conditional_t<_Bits <= sizeof(unsigned long) * CHAR_BIT, unsigned long, unsigned long long>; #pragma warning(pop) - // CLASS reference class reference { // proxy for an element friend bitset<_Bits>; @@ -508,7 +506,6 @@ basic_ostream<_Elem, _Tr>& operator<<(basic_ostream<_Elem, _Tr>& _Ostr, const bi return _Ostr << _Right.template to_string<_Elem, _Tr, allocator<_Elem>>(_Elem0, _Elem1); } -// TEMPLATE operator>> template basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, bitset<_Bits>& _Right) { using _Istr_t = basic_istream<_Elem, _Tr>; @@ -556,7 +553,6 @@ basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, bitset<_ return _Istr; } -// STRUCT TEMPLATE SPECIALIZATION hash template struct hash> { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bitset<_Bits> _ARGUMENT_TYPE_NAME; diff --git a/stl/inc/charconv b/stl/inc/charconv index 4b33f78ff5a..b123b3aae56 100644 --- a/stl/inc/charconv +++ b/stl/inc/charconv @@ -33,7 +33,6 @@ inline constexpr char _Charconv_digits[] = {'0', '1', '2', '3', '4', '5', '6', ' 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; static_assert(_STD size(_Charconv_digits) == 36); -// FUNCTION to_chars (INTEGER TO STRING) template _NODISCARD to_chars_result _Integer_to_chars( char* _First, char* const _Last, const _RawTy _Raw_value, const int _Base) noexcept { @@ -205,7 +204,6 @@ inline to_chars_result to_chars(char* const _First, char* const _Last, const uns to_chars_result to_chars(char* _First, char* _Last, bool _Value, int _Base = 10) = delete; -// STRUCT from_chars_result struct from_chars_result { const char* ptr; errc ec; @@ -214,7 +212,6 @@ struct from_chars_result { #endif // _HAS_CXX20 }; -// FUNCTION from_chars (STRING TO INTEGER) _NODISCARD inline unsigned char _Digit_from_char(const char _Ch) noexcept { // convert ['0', '9'] ['A', 'Z'] ['a', 'z'] to [0, 35], everything else to 255 static constexpr unsigned char _Digit_from_byte[] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, @@ -1643,9 +1640,6 @@ _NODISCARD errc _Convert_hexadecimal_string_to_floating_type( // ^^^^^^^^^^ DERIVED FROM corecrt_internal_strtox.h ^^^^^^^^^^ - -// FUNCTION from_chars (STRING TO FLOATING-POINT) - // C11 6.4.2.1 "General" // digit: one of // 0 1 2 3 4 5 6 7 8 9 @@ -2060,7 +2054,6 @@ inline from_chars_result from_chars(const char* const _First, const char* const return _Result; } -// FUNCTION to_chars (FLOATING-POINT TO STRING) template _NODISCARD to_chars_result _Floating_to_chars_hex_precision( char* _First, char* const _Last, const _Floating _Value, int _Precision) noexcept { diff --git a/stl/inc/chrono b/stl/inc/chrono index accfa24ad56..ef874f59087 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -50,14 +50,12 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN namespace chrono { - // STRUCT TEMPLATE treat_as_floating_point template struct treat_as_floating_point : is_floating_point<_Rep> {}; // tests for floating-point type template _INLINE_VAR constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value; - // STRUCT TEMPLATE duration_values template struct duration_values { // gets arithmetic properties of a type _NODISCARD static constexpr _Rep zero() noexcept { @@ -92,11 +90,9 @@ namespace chrono { inline constexpr bool is_clock_v = _Is_clock_v<_Clock>; #endif // _HAS_CXX20 - // CLASS TEMPLATE duration template > class duration; - // VARIABLE TEMPLATE _Is_duration_v template _INLINE_VAR constexpr bool _Is_duration_v = _Is_specialization_v<_Ty, duration>; @@ -286,11 +282,9 @@ template _INLINE_VAR constexpr bool _Is_trivially_swappable_v> = _Is_trivially_swappable_v<_Duration>; -// STRUCT TEMPLATE _Lcm (LEAST COMMON MULTIPLE) template struct _Lcm : integral_constant::value) * _Bx> {}; // compute LCM of _Ax and _Bx -// STRUCT TEMPLATE common_type SPECIALIZATIONS template struct common_type<_CHRONO duration<_Rep1, _Period1>, _CHRONO duration<_Rep2, _Period2>> { // common type of two durations @@ -305,7 +299,6 @@ struct common_type<_CHRONO time_point<_Clock, _Duration1>, }; namespace chrono { - // duration ARITHMETIC template _NODISCARD constexpr common_type_t, duration<_Rep2, _Period2>> operator+(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( @@ -390,7 +383,6 @@ namespace chrono { return _CD(_CD(_Left).count() % _CD(_Right).count()); } - // duration COMPARISONS template _NODISCARD constexpr bool operator==(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( @@ -450,7 +442,6 @@ namespace chrono { } #endif // defined(__cpp_lib_concepts) - // FUNCTION TEMPLATE duration_cast template , int> _Enabled> _NODISCARD constexpr _To duration_cast(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { @@ -481,7 +472,6 @@ namespace chrono { } } - // FUNCTION TEMPLATE floor template , int> = 0> _NODISCARD constexpr _To floor(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { @@ -495,7 +485,6 @@ namespace chrono { return _Casted; } - // FUNCTION TEMPLATE ceil template , int> = 0> _NODISCARD constexpr _To ceil(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { @@ -509,7 +498,6 @@ namespace chrono { return _Casted; } - // FUNCTION TEMPLATE round template constexpr bool _Is_even(_Rep _Val) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ { // Tests whether _Val is even @@ -533,7 +521,6 @@ namespace chrono { return _Ceiled; } - // FUNCTION TEMPLATE abs template ::is_signed, int> = 0> _NODISCARD constexpr duration<_Rep, _Period> abs(const duration<_Rep, _Period> _Dur) noexcept( is_arithmetic_v<_Rep>) /* strengthened */ { @@ -541,7 +528,6 @@ namespace chrono { return _Dur < duration<_Rep, _Period>::zero() ? duration<_Rep, _Period>::zero() - _Dur : _Dur; } - // duration TYPES using nanoseconds = duration; using microseconds = duration; using milliseconds = duration; @@ -555,7 +541,6 @@ namespace chrono { using months = duration>>; #endif // _HAS_CXX20 - // time_point ARITHMETIC template _NODISCARD constexpr time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>> operator+(const time_point<_Clock, _Duration>& _Left, const duration<_Rep, _Period>& _Right) noexcept( @@ -586,7 +571,6 @@ namespace chrono { return _Left.time_since_epoch() - _Right.time_since_epoch(); } - // time_point COMPARISONS template _NODISCARD constexpr bool operator==(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( @@ -640,7 +624,6 @@ namespace chrono { } #endif // defined(__cpp_lib_concepts) - // FUNCTION TEMPLATE time_point_cast template , int> = 0> _NODISCARD constexpr time_point<_Clock, _To> time_point_cast(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { @@ -648,7 +631,6 @@ namespace chrono { return time_point<_Clock, _To>(_CHRONO duration_cast<_To>(_Time.time_since_epoch())); } - // FUNCTION TEMPLATE floor (for time_point instances) template , int> = 0> _NODISCARD constexpr time_point<_Clock, _To> floor(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { @@ -656,7 +638,6 @@ namespace chrono { return time_point<_Clock, _To>(_CHRONO floor<_To>(_Time.time_since_epoch())); } - // FUNCTION TEMPLATE ceil (for time_point instances) template , int> = 0> _NODISCARD constexpr time_point<_Clock, _To> ceil(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { @@ -664,7 +645,6 @@ namespace chrono { return time_point<_Clock, _To>(_CHRONO ceil<_To>(_Time.time_since_epoch())); } - // FUNCTION TEMPLATE round (for time_point instances) template && !treat_as_floating_point_v, int> = 0> _NODISCARD constexpr time_point<_Clock, _To> round(const time_point<_Clock, _Duration>& _Time) noexcept( @@ -673,7 +653,6 @@ namespace chrono { return time_point<_Clock, _To>(_CHRONO round<_To>(_Time.time_since_epoch())); } - // CLOCKS struct system_clock { // wraps GetSystemTimePreciseAsFileTime/GetSystemTimeAsFileTime using rep = long long; using period = ratio<1, 10'000'000>; // 100 nanoseconds @@ -695,7 +674,6 @@ namespace chrono { }; #if _HAS_CXX20 - // sys_time ALIASES template using sys_time = time_point; using sys_seconds = sys_time; @@ -2257,7 +2235,6 @@ namespace chrono { // [time.zone.info] - // STRUCT sys_info struct sys_info { sys_seconds begin; sys_seconds end; @@ -2266,7 +2243,6 @@ namespace chrono { string abbrev; }; - // STRUCT local_info struct local_info { static constexpr int unique = 0; static constexpr int nonexistent = 1; @@ -2277,7 +2253,6 @@ namespace chrono { sys_info second; }; - // CLASS nonexistent_local_time class nonexistent_local_time : public runtime_error { public: template @@ -2296,7 +2271,6 @@ namespace chrono { #endif // ^^^ workaround ^^^ }; - // CLASS ambiguous_local_time class ambiguous_local_time : public runtime_error { public: template @@ -2317,10 +2291,8 @@ namespace chrono { // [time.zone.timezone] - // ENUM CLASS choose enum class choose { earliest, latest }; - // CLASS time_zone class time_zone { public: explicit time_zone(string_view _Name_) : _Name(_Name_) {} @@ -2484,7 +2456,6 @@ namespace chrono { // [time.zone.leap] - // CLASS leap_second class leap_second { public: leap_second(const leap_second&) = default; @@ -2578,7 +2549,6 @@ namespace chrono { // [time.zone.link] - // CLASS time_zone_link class time_zone_link { public: explicit time_zone_link(string_view _Name_, string_view _Target_) : _Name(_Name_), _Target(_Target_) {} @@ -2631,7 +2601,6 @@ namespace chrono { return _Result == _Vec.end() ? nullptr : &*_Result; } - // STRUCT tzdb struct tzdb { string version; vector zones; @@ -2765,7 +2734,6 @@ namespace chrono { return _STD move(_Icu_version) + "." + _STD to_string(_Num_leap_seconds); } - // CLASS tzdb_list class tzdb_list { private: using _ListType = forward_list>; @@ -2875,7 +2843,6 @@ namespace chrono { inline atomic _Global_tzdb_list; - // FUNCTION get_tzdb_list _NODISCARD inline tzdb_list& get_tzdb_list() { auto* _Tzdb_ptr = _Global_tzdb_list.load(); if (_Tzdb_ptr != nullptr) { @@ -2909,22 +2876,18 @@ namespace chrono { return *_Tzdb_ptr; } - // FUNCTION get_tzdb _NODISCARD inline const tzdb& get_tzdb() { return _CHRONO get_tzdb_list().front(); } - // FUNCTION locate_zone _NODISCARD inline const time_zone* locate_zone(string_view _Tz_name) { return _CHRONO get_tzdb().locate_zone(_Tz_name); } - // FUNCTION current_zone _NODISCARD inline const time_zone* current_zone() { return _CHRONO get_tzdb().current_zone(); } - // FUNCTION reload_tzdb inline const tzdb& reload_tzdb() { _TRY_BEGIN return _CHRONO get_tzdb_list()._Reload(); @@ -2937,7 +2900,6 @@ namespace chrono { _CATCH_END } - // FUNCTION remote_version _NODISCARD inline string remote_version() { const auto& _Tzdb = _CHRONO get_tzdb(); const auto& _Version = _Tzdb.version; @@ -2947,11 +2909,9 @@ namespace chrono { // [time.zone.zonedtraits] - // STRUCT TEMPLATE zoned_traits template struct zoned_traits {}; - // STRUCT zoned_traits template <> struct zoned_traits { _NODISCARD static const time_zone* default_zone() { @@ -2965,7 +2925,6 @@ namespace chrono { // [time.zone.zonedtime] - // CLASS TEMPLATE zoned_time template class zoned_time { private: @@ -3148,13 +3107,11 @@ namespace chrono { using utc_time = time_point; using utc_seconds = utc_time; - // STRUCT leap_second_info struct leap_second_info { bool is_leap_second; seconds elapsed; }; - // FUNCTION TEMPLATE get_leap_second_info template _NODISCARD leap_second_info get_leap_second_info(const utc_time<_Duration>& _Time) { const utc_seconds _Time_floor = _CHRONO floor(_Time); @@ -3228,7 +3185,6 @@ namespace chrono { } } - // CLASS utc_clock class utc_clock { public: using rep = system_clock::rep; @@ -3279,7 +3235,6 @@ namespace chrono { using tai_time = time_point; using tai_seconds = tai_time; - // CLASS tai_clock class tai_clock { public: using rep = system_clock::rep; @@ -3315,7 +3270,6 @@ namespace chrono { using gps_time = time_point; using gps_seconds = gps_time; - // CLASS gps_clock class gps_clock { public: using rep = system_clock::rep; @@ -3353,7 +3307,6 @@ namespace filesystem { } // namespace filesystem namespace chrono { - // ALIAS file_clock using file_clock = filesystem::_File_time_clock; template @@ -3422,7 +3375,6 @@ namespace chrono { #if _HAS_CXX20 // [time.clock.conv] - // STRUCT TEMPLATE clock_time_conversion template struct clock_time_conversion {}; @@ -3610,7 +3562,6 @@ namespace chrono { template inline constexpr auto _Clock_cast_choice = _Choose_clock_cast<_DestClock, _SourceClock, _Duration>(); - // FUNCTION TEMPLATE clock_cast template != _Clock_cast_strategy::_None, int> = 0> _NODISCARD auto clock_cast(const time_point<_SourceClock, _Duration>& _Time) { @@ -5005,7 +4956,6 @@ namespace chrono { } }; - // FUNCTION TEMPLATE from_stream template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, duration<_Rep, _Period>& _Duration, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, @@ -5193,7 +5143,6 @@ namespace chrono { minutes* _Offset; }; - // FUNCTION TEMPLATE parse template &>(), _STD declval(), _STD declval<_Parsable&>()))>> @@ -6539,7 +6488,6 @@ namespace chrono { #endif // __cpp_lib_format -// HELPERS template _NODISCARD bool _To_xtime_10_day_clamped(_CSTD xtime& _Xt, const _CHRONO duration<_Rep, _Period>& _Rel_time) noexcept( is_arithmetic_v<_Rep>) { @@ -6564,7 +6512,6 @@ _NODISCARD bool _To_xtime_10_day_clamped(_CSTD xtime& _Xt, const _CHRONO duratio return _Clamped; } -// duration LITERALS inline namespace literals { inline namespace chrono_literals { _NODISCARD constexpr _CHRONO hours operator"" h(unsigned long long _Val) noexcept /* strengthened */ { diff --git a/stl/inc/cmath b/stl/inc/cmath index afcee6200d4..67232bdbfa4 100644 --- a/stl/inc/cmath +++ b/stl/inc/cmath @@ -561,13 +561,11 @@ using _Common_float_type_t = conditional_t || is_sa double>>; // find type for two-argument math function _STD_END -// FUNCTION TEMPLATE frexp template , int> = 0> double frexp(_Ty _Value, _Out_ int* const _Exp) noexcept /* strengthened */ { return _CSTD frexp(static_cast(_Value), _Exp); } -// FUNCTION TEMPLATE fma template && _STD is_arithmetic_v<_Ty2> && _STD is_arithmetic_v<_Ty3>, int> = 0> _NODISCARD _STD _Common_float_type_t<_Ty1, _STD _Common_float_type_t<_Ty2, _Ty3>> fma( @@ -582,7 +580,6 @@ _NODISCARD _STD _Common_float_type_t<_Ty1, _STD _Common_float_type_t<_Ty2, _Ty3> } } -// FUNCTION TEMPLATE remquo template && _STD is_arithmetic_v<_Ty2>, int> = 0> _STD _Common_float_type_t<_Ty1, _Ty2> remquo(_Ty1 _Left, _Ty2 _Right, int* _Pquo) noexcept /* strengthened */ { using _Common = _STD _Common_float_type_t<_Ty1, _Ty2>; @@ -956,325 +953,261 @@ _NODISCARD _CRT_SATELLITE_2 float __stdcall __std_smf_hypot3f(float, float, floa _END_EXTERN_C _STD_BEGIN -// FUNCTION assoc_laguerre _NODISCARD inline double assoc_laguerre(const unsigned int _Degree, const unsigned int _Order, const double _Value) { return __std_smf_assoc_laguerre(_Degree, _Order, _Value); } -// FUNCTION assoc_laguerref _NODISCARD inline float assoc_laguerref(const unsigned int _Degree, const unsigned int _Order, const float _Value) { return __std_smf_assoc_laguerref(_Degree, _Order, _Value); } -// FUNCTION assoc_laguerrel _NODISCARD inline long double assoc_laguerrel( const unsigned int _Degree, const unsigned int _Order, const long double _Value) { return __std_smf_assoc_laguerre(_Degree, _Order, static_cast(_Value)); } -// FUNCTION assoc_legendre _NODISCARD inline double assoc_legendre(const unsigned int _Degree, const unsigned int _Order, const double _Value) { return __std_smf_assoc_legendre(_Degree, _Order, _Value); } -// FUNCTION assoc_legendref _NODISCARD inline float assoc_legendref(const unsigned int _Degree, const unsigned int _Order, const float _Value) { return __std_smf_assoc_legendref(_Degree, _Order, _Value); } -// FUNCTION assoc_legendrel _NODISCARD inline long double assoc_legendrel( const unsigned int _Degree, const unsigned int _Order, const long double _Value) { return __std_smf_assoc_legendre(_Degree, _Order, static_cast(_Value)); } -// FUNCTION beta _NODISCARD inline double beta(const double _Arg1, const double _Arg2) { return __std_smf_beta(_Arg1, _Arg2); } -// FUNCTION betaf _NODISCARD inline float betaf(const float _Arg1, const float _Arg2) { return __std_smf_betaf(_Arg1, _Arg2); } -// FUNCTION betal _NODISCARD inline long double betal(const long double _Arg1, const long double _Arg2) { return __std_smf_beta(static_cast(_Arg1), static_cast(_Arg2)); } -// FUNCTION comp_ellint_1 _NODISCARD inline double comp_ellint_1(const double _Arg) { return __std_smf_comp_ellint_1(_Arg); } -// FUNCTION comp_ellint_1f _NODISCARD inline float comp_ellint_1f(const float _Arg) { return __std_smf_comp_ellint_1f(_Arg); } -// FUNCTION comp_ellint_1l _NODISCARD inline long double comp_ellint_1l(const long double _Arg) { return __std_smf_comp_ellint_1(static_cast(_Arg)); } -// FUNCTION comp_ellint_2 _NODISCARD inline double comp_ellint_2(const double _Arg) { return __std_smf_comp_ellint_2(_Arg); } -// FUNCTION comp_ellint_2f _NODISCARD inline float comp_ellint_2f(const float _Arg) { return __std_smf_comp_ellint_2f(_Arg); } -// FUNCTION comp_ellint_2l _NODISCARD inline long double comp_ellint_2l(const long double _Arg) { return __std_smf_comp_ellint_2(static_cast(_Arg)); } -// FUNCTION comp_ellint_3 _NODISCARD inline double comp_ellint_3(const double _Arg1, const double _Arg2) { return __std_smf_comp_ellint_3(_Arg1, _Arg2); } -// FUNCTION comp_ellint_3f _NODISCARD inline float comp_ellint_3f(const float _Arg1, const float _Arg2) { return __std_smf_comp_ellint_3f(_Arg1, _Arg2); } -// FUNCTION comp_ellint_3l _NODISCARD inline long double comp_ellint_3l(const long double _Arg1, const long double _Arg2) { return __std_smf_comp_ellint_3(static_cast(_Arg1), static_cast(_Arg2)); } -// FUNCTION cyl_bessel_i _NODISCARD inline double cyl_bessel_i(const double _Arg1, const double _Arg2) { return __std_smf_cyl_bessel_i(_Arg1, _Arg2); } -// FUNCTION cyl_bessel_if _NODISCARD inline float cyl_bessel_if(const float _Arg1, const float _Arg2) { return __std_smf_cyl_bessel_if(_Arg1, _Arg2); } -// FUNCTION cyl_bessel_il _NODISCARD inline long double cyl_bessel_il(const long double _Arg1, const long double _Arg2) { return __std_smf_cyl_bessel_i(static_cast(_Arg1), static_cast(_Arg2)); } -// FUNCTION cyl_bessel_j _NODISCARD inline double cyl_bessel_j(const double _Arg1, const double _Arg2) { return __std_smf_cyl_bessel_j(_Arg1, _Arg2); } -// FUNCTION cyl_bessel_jf _NODISCARD inline float cyl_bessel_jf(const float _Arg1, const float _Arg2) { return __std_smf_cyl_bessel_jf(_Arg1, _Arg2); } -// FUNCTION cyl_bessel_jl _NODISCARD inline long double cyl_bessel_jl(const long double _Arg1, const long double _Arg2) { return __std_smf_cyl_bessel_j(static_cast(_Arg1), static_cast(_Arg2)); } -// FUNCTION cyl_bessel_k _NODISCARD inline double cyl_bessel_k(const double _Arg1, const double _Arg2) { return __std_smf_cyl_bessel_k(_Arg1, _Arg2); } -// FUNCTION cyl_bessel_kf _NODISCARD inline float cyl_bessel_kf(const float _Arg1, const float _Arg2) { return __std_smf_cyl_bessel_kf(_Arg1, _Arg2); } -// FUNCTION cyl_bessel_kl _NODISCARD inline long double cyl_bessel_kl(const long double _Arg1, const long double _Arg2) { return __std_smf_cyl_bessel_k(static_cast(_Arg1), static_cast(_Arg2)); } -// FUNCTION cyl_neumann _NODISCARD inline double cyl_neumann(const double _Arg1, const double _Arg2) { return __std_smf_cyl_neumann(_Arg1, _Arg2); } -// FUNCTION cyl_neumannf _NODISCARD inline float cyl_neumannf(const float _Arg1, const float _Arg2) { return __std_smf_cyl_neumannf(_Arg1, _Arg2); } -// FUNCTION cyl_neumannl _NODISCARD inline long double cyl_neumannl(const long double _Arg1, const long double _Arg2) { return __std_smf_cyl_neumann(static_cast(_Arg1), static_cast(_Arg2)); } -// FUNCTION ellint_1 _NODISCARD inline double ellint_1(const double _Arg1, const double _Arg2) { return __std_smf_ellint_1(_Arg1, _Arg2); } -// FUNCTION ellint_1f _NODISCARD inline float ellint_1f(const float _Arg1, const float _Arg2) { return __std_smf_ellint_1f(_Arg1, _Arg2); } -// FUNCTION ellint_1l _NODISCARD inline long double ellint_1l(const long double _Arg1, const long double _Arg2) { return __std_smf_ellint_1(static_cast(_Arg1), static_cast(_Arg2)); } -// FUNCTION ellint_2 _NODISCARD inline double ellint_2(const double _Arg1, const double _Arg2) { return __std_smf_ellint_2(_Arg1, _Arg2); } -// FUNCTION ellint_2f _NODISCARD inline float ellint_2f(const float _Arg1, const float _Arg2) { return __std_smf_ellint_2f(_Arg1, _Arg2); } -// FUNCTION ellint_2l _NODISCARD inline long double ellint_2l(const long double _Arg1, const long double _Arg2) { return __std_smf_ellint_2(static_cast(_Arg1), static_cast(_Arg2)); } -// FUNCTION ellint_3 _NODISCARD inline double ellint_3(const double _Arg1, const double _Arg2, const double _Arg3) { return __std_smf_ellint_3(_Arg1, _Arg2, _Arg3); } -// FUNCTION ellint_3f _NODISCARD inline float ellint_3f(const float _Arg1, const float _Arg2, const float _Arg3) { return __std_smf_ellint_3f(_Arg1, _Arg2, _Arg3); } -// FUNCTION ellint_3l _NODISCARD inline long double ellint_3l(const long double _Arg1, const long double _Arg2, const long double _Arg3) { return __std_smf_ellint_3(static_cast(_Arg1), static_cast(_Arg2), static_cast(_Arg3)); } -// FUNCTION expint _NODISCARD inline double expint(const double _Arg) { return __std_smf_expint(_Arg); } -// FUNCTION expintf _NODISCARD inline float expintf(const float _Arg) { return __std_smf_expintf(_Arg); } -// FUNCTION expintl _NODISCARD inline long double expintl(const long double _Arg) { return __std_smf_expint(static_cast(_Arg)); } -// FUNCTION hermite _NODISCARD inline double hermite(const unsigned int _Arg1, const double _Arg2) { return __std_smf_hermite(_Arg1, _Arg2); } -// FUNCTION hermitef _NODISCARD inline float hermitef(const unsigned int _Arg1, const float _Arg2) { return __std_smf_hermitef(_Arg1, _Arg2); } -// FUNCTION hermitel _NODISCARD inline long double hermitel(const unsigned int _Arg1, const long double _Arg2) { return __std_smf_hermite(_Arg1, static_cast(_Arg2)); } -// FUNCTION laguerre _NODISCARD inline double laguerre(const unsigned int _Arg1, const double _Arg2) { return __std_smf_laguerre(_Arg1, _Arg2); } -// FUNCTION laguerref _NODISCARD inline float laguerref(const unsigned int _Arg1, const float _Arg2) { return __std_smf_laguerref(_Arg1, _Arg2); } -// FUNCTION laguerrel _NODISCARD inline long double laguerrel(const unsigned int _Arg1, const long double _Arg2) { return __std_smf_laguerre(_Arg1, static_cast(_Arg2)); } -// FUNCTION legendre _NODISCARD inline double legendre(const unsigned int _Degree, const double _Value) { return __std_smf_legendre(_Degree, _Value); } -// FUNCTION legendref _NODISCARD inline float legendref(const unsigned int _Degree, const float _Value) { return __std_smf_legendref(_Degree, _Value); } -// FUNCTION legendrel _NODISCARD inline long double legendrel(const unsigned int _Degree, const long double _Value) { return __std_smf_legendre(_Degree, static_cast(_Value)); } -// FUNCTION riemann_zeta _NODISCARD inline double riemann_zeta(const double _Arg) { return __std_smf_riemann_zeta(_Arg); } -// FUNCTION riemann_zetaf _NODISCARD inline float riemann_zetaf(const float _Arg) { return __std_smf_riemann_zetaf(_Arg); } -// FUNCTION riemann_zetal _NODISCARD inline long double riemann_zetal(const long double _Arg) { return __std_smf_riemann_zeta(static_cast(_Arg)); } -// FUNCTION sph_bessel _NODISCARD inline double sph_bessel(const unsigned int _Arg1, const double _Arg2) { return __std_smf_sph_bessel(_Arg1, _Arg2); } -// FUNCTION sph_besself _NODISCARD inline float sph_besself(const unsigned int _Arg1, const float _Arg2) { return __std_smf_sph_besself(_Arg1, _Arg2); } -// FUNCTION sph_bessell _NODISCARD inline long double sph_bessell(const unsigned int _Arg1, const long double _Arg2) { return __std_smf_sph_bessel(_Arg1, static_cast(_Arg2)); } -// FUNCTION sph_legendre _NODISCARD inline double sph_legendre(const unsigned int _Arg1, const unsigned int _Arg2, const double _Theta) { return __std_smf_sph_legendre(_Arg1, _Arg2, _Theta); } -// FUNCTION sph_legendref _NODISCARD inline float sph_legendref(const unsigned int _Arg1, const unsigned int _Arg2, const float _Theta) { return __std_smf_sph_legendref(_Arg1, _Arg2, _Theta); } -// FUNCTION sph_legendrel _NODISCARD inline long double sph_legendrel( const unsigned int _Arg1, const unsigned int _Arg2, const long double _Theta) { return __std_smf_sph_legendre(_Arg1, _Arg2, static_cast(_Theta)); } -// FUNCTION sph_neumann _NODISCARD inline double sph_neumann(const unsigned int _Arg1, const double _Arg2) { return __std_smf_sph_neumann(_Arg1, _Arg2); } -// FUNCTION sph_neumannf _NODISCARD inline float sph_neumannf(const unsigned int _Arg1, const float _Arg2) { return __std_smf_sph_neumannf(_Arg1, _Arg2); } -// FUNCTION sph_neumannl _NODISCARD inline long double sph_neumannl(const unsigned int _Arg1, const long double _Arg2) { return __std_smf_sph_neumann(_Arg1, static_cast(_Arg2)); } -// FUNCTION hypot (3-argument overloads) _NODISCARD inline double hypot(const double _Dx, const double _Dy, const double _Dz) { return __std_smf_hypot3(_Dx, _Dy, _Dz); } @@ -1299,7 +1232,6 @@ _NODISCARD auto hypot(const _Ty1 _Dx, const _Ty2 _Dy, const _Ty3 _Dz) { } #if _HAS_CXX20 -// FUNCTION lerp template _NODISCARD constexpr _Ty _Common_lerp(const _Ty _ArgA, const _Ty _ArgB, const _Ty _ArgT) noexcept { // on a line intersecting {(0.0, _ArgA), (1.0, _ArgB)}, return the Y value for X == _ArgT diff --git a/stl/inc/codecvt b/stl/inc/codecvt index 0f713872300..aa6459c0569 100644 --- a/stl/inc/codecvt +++ b/stl/inc/codecvt @@ -29,7 +29,6 @@ enum _CXX17_DEPRECATE_CODECVT_HEADER codecvt_mode { consume_header = 4, generate using _Statype = _CSTD mbstate_t; _STL_DISABLE_DEPRECATED_WARNING -// CLASS TEMPLATE codecvt_utf8 template class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf8 : public codecvt<_Elem, char, _Statype> { // facet for converting between _Elem and UTF-8 byte sequences @@ -214,7 +213,6 @@ protected: } }; -// CLASS TEMPLATE codecvt_utf16 template class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf16 : public codecvt<_Elem, char, _Statype> { // facet for converting between _Elem and UTF-16 multibyte sequences @@ -422,7 +420,6 @@ protected: } }; -// CLASS codecvt_utf8_utf16 template class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf8_utf16 : public codecvt<_Elem, char, _Statype> { // facet for converting between UTF-16 _Elem and UTF-8 byte sequences diff --git a/stl/inc/compare b/stl/inc/compare index fda5e24f2d1..1f990673301 100644 --- a/stl/inc/compare +++ b/stl/inc/compare @@ -35,7 +35,6 @@ enum class _Compare_eq : _Compare_t { equal = 0, equivalent = equal }; enum class _Compare_ord : _Compare_t { less = -1, greater = 1 }; enum class _Compare_ncmp : _Compare_t { unordered = -128 }; -// CLASS partial_ordering struct partial_ordering { static const partial_ordering less; static const partial_ordering equivalent; @@ -102,7 +101,6 @@ inline constexpr partial_ordering partial_ordering::equivalent{static_cast<_Comp inline constexpr partial_ordering partial_ordering::greater{static_cast<_Compare_t>(_Compare_ord::greater)}; inline constexpr partial_ordering partial_ordering::unordered{static_cast<_Compare_t>(_Compare_ncmp::unordered)}; -// CLASS weak_ordering struct weak_ordering { static const weak_ordering less; static const weak_ordering equivalent; @@ -165,7 +163,6 @@ inline constexpr weak_ordering weak_ordering::less{static_cast<_Compare_t>(_Comp inline constexpr weak_ordering weak_ordering::equivalent{static_cast<_Compare_t>(_Compare_eq::equivalent)}; inline constexpr weak_ordering weak_ordering::greater{static_cast<_Compare_t>(_Compare_ord::greater)}; -// CLASS strong_ordering struct strong_ordering { static const strong_ordering less; static const strong_ordering equal; @@ -234,37 +231,30 @@ inline constexpr strong_ordering strong_ordering::equal{static_cast<_Compare_t>( inline constexpr strong_ordering strong_ordering::equivalent{static_cast<_Compare_t>(_Compare_eq::equivalent)}; inline constexpr strong_ordering strong_ordering::greater{static_cast<_Compare_t>(_Compare_ord::greater)}; -// FUNCTION is_eq _NODISCARD constexpr bool is_eq(const partial_ordering _Comp) noexcept { return _Comp == 0; } -// FUNCTION is_neq _NODISCARD constexpr bool is_neq(const partial_ordering _Comp) noexcept { return _Comp != 0; } -// FUNCTION is_lt _NODISCARD constexpr bool is_lt(const partial_ordering _Comp) noexcept { return _Comp < 0; } -// FUNCTION is_lteq _NODISCARD constexpr bool is_lteq(const partial_ordering _Comp) noexcept { return _Comp <= 0; } -// FUNCTION is_gt _NODISCARD constexpr bool is_gt(const partial_ordering _Comp) noexcept { return _Comp > 0; } -// FUNCTION is_gteq _NODISCARD constexpr bool is_gteq(const partial_ordering _Comp) noexcept { return _Comp >= 0; } -// ALIAS TEMPLATE common_comparison_category_t enum _Comparison_category : unsigned char { _Comparison_category_none = 1, _Comparison_category_partial = 2, @@ -342,7 +332,6 @@ struct compare_three_way { }; // clang-format on -// STRUCT _Synth_three_way struct _Synth_three_way { // clang-format off template @@ -367,13 +356,11 @@ struct _Synth_three_way { } }; -// ALIAS TEMPLATE _Synth_three_way_result template using _Synth_three_way_result = decltype(_Synth_three_way{}(_STD declval<_Ty1&>(), _STD declval<_Ty2&>())); // Note: The following CPOs are passing arguments as lvalues; see GH-1374. -// CUSTOMIZATION POINT OBJECT strong_order namespace _Strong_order { void strong_order(); // Block unqualified name lookup; see GH-1374. @@ -469,7 +456,6 @@ inline namespace _Cpos { inline constexpr _Strong_order::_Cpo strong_order; } -// CUSTOMIZATION POINT OBJECT weak_order namespace _Weak_order { void weak_order(); // Block unqualified name lookup; see GH-1374. @@ -590,7 +576,6 @@ inline namespace _Cpos { inline constexpr _Weak_order::_Cpo weak_order; } -// CUSTOMIZATION POINT OBJECT partial_order namespace _Partial_order { void partial_order(); // Block unqualified name lookup; see GH-1374. @@ -676,7 +661,6 @@ concept _Can_fallback_eq_lt = requires(_Ty1& _Left, _Ty2& _Right) { }; // clang-format on -// CUSTOMIZATION POINT OBJECT compare_strong_order_fallback namespace _Compare_strong_order_fallback { template concept _Can_strong_order = requires(_Ty1 & _Left, _Ty2 & _Right) { @@ -731,7 +715,6 @@ inline namespace _Cpos { inline constexpr _Compare_strong_order_fallback::_Cpo compare_strong_order_fallback; } -// CUSTOMIZATION POINT OBJECT compare_weak_order_fallback namespace _Compare_weak_order_fallback { template concept _Can_weak_order = requires(_Ty1& _Left, _Ty2& _Right) { @@ -786,7 +769,6 @@ inline namespace _Cpos { inline constexpr _Compare_weak_order_fallback::_Cpo compare_weak_order_fallback; } -// CUSTOMIZATION POINT OBJECT compare_partial_order_fallback namespace _Compare_partial_order_fallback { template concept _Can_partial_order = requires(_Ty1& _Left, _Ty2& _Right) { diff --git a/stl/inc/complex b/stl/inc/complex index bf222aead8c..c476a9cea86 100644 --- a/stl/inc/complex +++ b/stl/inc/complex @@ -54,7 +54,7 @@ struct _C_ldouble_complex { }; #endif // _C_COMPLEX_T -// COMPLEX _Val OFFSETS +// complex _Val offsets #define _RE 0 #define _IM 1 @@ -363,7 +363,6 @@ class complex; template <> class complex; -// CLASS TEMPLATE _Ctraits template class _Ctraits { public: @@ -499,7 +498,6 @@ public: } }; -// CLASS _Ctraits template <> class _Ctraits { public: @@ -643,7 +641,6 @@ public: } }; -// CLASS _Ctraits template <> class _Ctraits { public: @@ -782,7 +779,6 @@ public: } }; -// CLASS _Ctraits template <> class _Ctraits { public: @@ -918,14 +914,12 @@ public: } }; -// STRUCT TEMPLATE _Complex_value template struct _Complex_value { enum { _Re = 0, _Im = 1 }; _Ty _Val[2]; }; -// CLASS TEMPLATE _Complex_base template class _Complex_base : public _Valbase { public: @@ -1015,7 +1009,6 @@ protected: } }; -// CLASS complex template <> class complex : public _Complex_base { public: @@ -1107,7 +1100,6 @@ public: } }; -// CLASS complex template <> class complex : public _Complex_base { public: @@ -1199,7 +1191,6 @@ public: } }; -// CLASS complex template <> class complex : public _Complex_base { public: @@ -1291,7 +1282,6 @@ public: } }; -// CONSTRUCTORS FOR complex SPECIALIZATIONS constexpr complex::complex(const complex& _Right) : _Complex_base(static_cast<_Ty>(_Right.real()), static_cast<_Ty>(_Right.imag())) {} @@ -1310,7 +1300,6 @@ constexpr complex::complex(const complex& _Right) constexpr complex::complex(const complex& _Right) : _Complex_base(_Right.real(), _Right.imag()) {} -// CLASS TEMPLATE complex template class complex : public _Complex_base<_Ty, _Complex_value<_Ty>> { public: @@ -1402,7 +1391,6 @@ public: } }; -// FUNCTION TEMPLATE operator+ template _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Left); @@ -1424,7 +1412,6 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const _Ty& _Left, const complex<_ return _Tmp; } -// FUNCTION TEMPLATE operator- template _NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Left); @@ -1446,7 +1433,6 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const _Ty& _Left, const complex<_ return _Tmp; } -// FUNCTION TEMPLATE operator* template _NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Left); @@ -1469,7 +1455,6 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const _Ty& _Left, const complex<_ return _Tmp; } -// FUNCTION TEMPLATE operator/ template _NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Left); @@ -1492,19 +1477,16 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const _Ty& _Left, const complex<_ return _Tmp; } -// FUNCTION TEMPLATE UNARY operator+ template _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left) { return _Left; } -// FUNCTION TEMPLATE UNARY operator- template _NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left) { return complex<_Ty>(-_Left.real(), -_Left.imag()); } -// FUNCTION TEMPLATE operator== template _NODISCARD constexpr bool operator==(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { return _Left.real() == _Right.real() && _Left.imag() == _Right.imag(); @@ -1522,7 +1504,6 @@ _NODISCARD constexpr bool operator==(const _Ty& _Left, const complex<_Ty>& _Righ } #endif // !_HAS_CXX20 -// FUNCTION TEMPLATE operator!= #if !_HAS_CXX20 template _NODISCARD constexpr bool operator!=(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { @@ -1540,13 +1521,11 @@ _NODISCARD constexpr bool operator!=(const _Ty& _Left, const complex<_Ty>& _Righ } #endif // !_HAS_CXX20 -// FUNCTION TEMPLATE imag template _NODISCARD constexpr _Ty imag(const complex<_Ty>& _Left) { return _Left.imag(); } -// FUNCTION TEMPLATE real template _NODISCARD constexpr _Ty real(const complex<_Ty>& _Left) { return _Left.real(); @@ -1555,13 +1534,11 @@ _NODISCARD constexpr _Ty real(const complex<_Ty>& _Left) { template _NODISCARD complex<_Ty> sqrt(const complex<_Ty>& _Left); -// FUNCTION TEMPLATE abs template _NODISCARD _Ty abs(const complex<_Ty>& _Left) { return _Ctraits<_Ty>::hypot(_Left.real(), _Left.imag()); } -// FUNCTION TEMPLATE acos template _NODISCARD complex<_Ty> acos(const complex<_Ty>& _Left) { const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max()); @@ -1629,7 +1606,6 @@ _NODISCARD complex<_Ty> acos(const complex<_Ty>& _Left) { return complex<_Ty>(_Ux, _Vx); } -// FUNCTION TEMPLATE acosh template _NODISCARD complex<_Ty> acosh(const complex<_Ty>& _Left) { const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max()); @@ -1700,7 +1676,6 @@ _NODISCARD complex<_Ty> acosh(const complex<_Ty>& _Left) { return complex<_Ty>(_Ux, _Vx); } -// FUNCTION TEMPLATE asinh template _NODISCARD complex<_Ty> asinh(const complex<_Ty>& _Left) { const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max()); @@ -1766,7 +1741,6 @@ _NODISCARD complex<_Ty> asinh(const complex<_Ty>& _Left) { return complex<_Ty>(_Ux, _Vx); } -// FUNCTION TEMPLATE asin template _NODISCARD complex<_Ty> asin(const complex<_Ty>& _Left) { complex<_Ty> _Asinh = _STD asinh(complex<_Ty>(-imag(_Left), real(_Left))); @@ -1774,7 +1748,6 @@ _NODISCARD complex<_Ty> asin(const complex<_Ty>& _Left) { return complex<_Ty>(imag(_Asinh), -real(_Asinh)); } -// FUNCTION TEMPLATE atanh template _NODISCARD complex<_Ty> atanh(const complex<_Ty>& _Left) { const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max()); @@ -1827,7 +1800,6 @@ _NODISCARD complex<_Ty> atanh(const complex<_Ty>& _Left) { return complex<_Ty>(_Ux, _Vx); } -// FUNCTION TEMPLATE atan template _NODISCARD complex<_Ty> atan(const complex<_Ty>& _Left) { complex<_Ty> _Atanh = _STD atanh(complex<_Ty>(-imag(_Left), real(_Left))); @@ -1835,14 +1807,12 @@ _NODISCARD complex<_Ty> atan(const complex<_Ty>& _Left) { return complex<_Ty>(imag(_Atanh), -real(_Atanh)); } -// FUNCTION TEMPLATE cosh template _NODISCARD complex<_Ty> cosh(const complex<_Ty>& _Left) { return complex<_Ty>(_Ctraits<_Ty>::_Cosh(real(_Left), _Ctraits<_Ty>::cos(imag(_Left))), _Ctraits<_Ty>::_Sinh(real(_Left), _Ctraits<_Ty>::sin(imag(_Left)))); } -// FUNCTION TEMPLATE exp template _NODISCARD complex<_Ty> exp(const complex<_Ty>& _Left) { _Ty _Real(real(_Left)), _Imag(real(_Left)); @@ -1851,7 +1821,6 @@ _NODISCARD complex<_Ty> exp(const complex<_Ty>& _Left) { return complex<_Ty>(_Real, _Imag); } -// FUNCTION TEMPLATE _Fabs template _Ty _Fabs(const complex<_Ty>& _Left, int* _Pexp) { // Used by sqrt(), return magnitude and scale factor. // Returns a non-zero even integer in *_Pexp when _Left is finite @@ -1917,7 +1886,6 @@ _Ty _Fabs(const complex<_Ty>& _Left, int* _Pexp) { // Used by sqrt(), return mag } } -// FUNCTION TEMPLATE log template _NODISCARD _Ty _Log_abs(const complex<_Ty>& _Left) noexcept { // for double, long double, and non-floating-point types return static_cast<_Ty>( @@ -1935,7 +1903,6 @@ _NODISCARD complex<_Ty> log(const complex<_Ty>& _Left) { return complex<_Ty>(_Log_abs_v, _Theta); } -// FUNCTION TEMPLATE pow template complex<_Ty> _Pow(const _Ty& _Left, const _Ty& _Right) { if (0 <= _Left) { @@ -1980,14 +1947,12 @@ _NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const complex<_Ty>& _Righ } } -// FUNCTION TEMPLATE sinh template _NODISCARD complex<_Ty> sinh(const complex<_Ty>& _Left) { return complex<_Ty>(_Ctraits<_Ty>::_Sinh(real(_Left), _Ctraits<_Ty>::cos(imag(_Left))), _Ctraits<_Ty>::_Cosh(real(_Left), _Ctraits<_Ty>::sin(imag(_Left)))); } -// FUNCTION TEMPLATE sqrt template _NODISCARD complex<_Ty> sqrt(const complex<_Ty>& _Left) { int _Leftexp; @@ -2032,7 +1997,6 @@ _NODISCARD complex<_Ty> sqrt(const complex<_Ty>& _Left) { } } -// FUNCTION TEMPLATE tanh template _NODISCARD complex<_Ty> tanh(const complex<_Ty>& _Left) { _Ty _Tv = _Ctraits<_Ty>::tan(imag(_Left)); @@ -2055,19 +2019,16 @@ _NODISCARD complex<_Ty> tanh(const complex<_Ty>& _Left) { return complex<_Ty>((_Ctraits<_Ty>::sqrt(_Ty{1} + _Sv * _Sv)) * _Bv / _Dv, _Tv / _Dv); } -// FUNCTION TEMPLATE arg template _NODISCARD _Ty arg(const complex<_Ty>& _Left) { // return phase angle of complex as real return _Ctraits<_Ty>::atan2(imag(_Left), real(_Left)); } -// FUNCTION TEMPLATE conj template _NODISCARD _CONSTEXPR20 complex<_Ty> conj(const complex<_Ty>& _Left) { // return complex conjugate return complex<_Ty>(real(_Left), -imag(_Left)); } -// FUNCTION TEMPLATE proj template _NODISCARD complex<_Ty> proj(const complex<_Ty>& _Left) { // return complex projection if (_Ctraits<_Ty>::_Isinf(real(_Left)) || _Ctraits<_Ty>::_Isinf(imag(_Left))) { @@ -2078,26 +2039,22 @@ _NODISCARD complex<_Ty> proj(const complex<_Ty>& _Left) { // return complex proj return _Left; } -// FUNCTION TEMPLATE cos template _NODISCARD complex<_Ty> cos(const complex<_Ty>& _Left) { return complex<_Ty>(_Ctraits<_Ty>::_Cosh(imag(_Left), _Ctraits<_Ty>::cos(real(_Left))), -_Ctraits<_Ty>::_Sinh(imag(_Left), _Ctraits<_Ty>::sin(real(_Left)))); } -// FUNCTION TEMPLATE log10 template _NODISCARD complex<_Ty> log10(const complex<_Ty>& _Left) { return log(_Left) * static_cast<_Ty>(0.43429448190325182765112891891660508L); } -// FUNCTION TEMPLATE norm template _NODISCARD _CONSTEXPR20 _Ty norm(const complex<_Ty>& _Left) { // return squared magnitude return real(_Left) * real(_Left) + imag(_Left) * imag(_Left); } -// FUNCTION TEMPLATE polar template _NODISCARD complex<_Ty> polar(const _Ty& _Rho, const _Ty& _Theta) { // return _Rho * exp(i * _Theta) as complex return complex<_Ty>(_Rho * _Ctraits<_Ty>::cos(_Theta), _Rho * _Ctraits<_Ty>::sin(_Theta)); @@ -2108,21 +2065,18 @@ _NODISCARD complex<_Ty> polar(const _Ty& _Rho) { // return _Rho * exp(i * 0) as return complex<_Ty>(_Rho, _Ty{0}); } -// FUNCTION TEMPLATE sin template _NODISCARD complex<_Ty> sin(const complex<_Ty>& _Left) { return complex<_Ty>(_Ctraits<_Ty>::_Cosh(imag(_Left), _Ctraits<_Ty>::sin(real(_Left))), _Ctraits<_Ty>::_Sinh(imag(_Left), _Ctraits<_Ty>::cos(real(_Left)))); } -// FUNCTION TEMPLATE tan template _NODISCARD complex<_Ty> tan(const complex<_Ty>& _Left) { complex<_Ty> _Zv(tanh(complex<_Ty>(-imag(_Left), real(_Left)))); return complex<_Ty>(imag(_Zv), -real(_Zv)); } -// ADDITIONAL OVERLOADS template using _Upgrade_to_double = conditional_t, double, _Ty>; @@ -2177,7 +2131,6 @@ _NODISCARD complex<_Upgrade_to_double<_Ty>> proj(_Ty _Left) { return complex<_Upgraded>(_Val, 0); } -// FUNCTION TEMPLATE pow template _NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const complex<_Ty1>& _Left, const complex<_Ty2>& _Right) { using _Type = complex<_Common_float_type_t<_Ty1, _Ty2>>; @@ -2198,7 +2151,6 @@ _NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const _Ty1& _Left, cons return _STD pow(_Type(static_cast<_Promoted>(_Left)), _Type(_Right)); } -// FUNCTION TEMPLATE operator>> template basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, complex<_Ty>& _Right) { const ctype<_Elem>& _Ctype_fac = _STD use_facet>(_Istr.getloc()); @@ -2229,7 +2181,6 @@ basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, complex< return _Istr; } -// FUNCTION TEMPLATE operator<< template basic_ostream<_Elem, _Tr>& operator<<(basic_ostream<_Elem, _Tr>& _Ostr, const complex<_Ty>& _Right) { const ctype<_Elem>& _Ctype_fac = _STD use_facet>(_Ostr.getloc()); @@ -2243,7 +2194,6 @@ basic_ostream<_Elem, _Tr>& operator<<(basic_ostream<_Elem, _Tr>& _Ostr, const co return _Ostr << _Sstr.str(); } -// complex LITERALS inline namespace literals { inline namespace complex_literals { _NODISCARD constexpr complex operator""il(long double _Val) { diff --git a/stl/inc/concepts b/stl/inc/concepts index a9e548d2fd4..468a71034a8 100644 --- a/stl/inc/concepts +++ b/stl/inc/concepts @@ -24,7 +24,6 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN // clang-format off -// CONCEPT same_as template concept _Same_impl = // Must be a distinct concept to provide symmetric subsumption for same_as #ifdef __clang__ @@ -36,23 +35,19 @@ concept _Same_impl = // Must be a distinct concept to provide symmetric subsumpt template concept same_as = _Same_impl<_Ty1, _Ty2> && _Same_impl<_Ty2, _Ty1>; -// CONCEPT derived_from template concept derived_from = __is_base_of(_Base, _Derived) && __is_convertible_to(const volatile _Derived*, const volatile _Base*); -// CONCEPT convertible_to template concept convertible_to = __is_convertible_to(_From, _To) && requires(add_rvalue_reference_t<_From> (&_Fn)()) { static_cast<_To>(_Fn()); }; -// CONCEPT _Implicitly_convertible_to template concept _Implicitly_convertible_to = is_convertible_v<_From, _To>; -// CONCEPT common_reference_with template concept common_reference_with = requires { @@ -63,7 +58,6 @@ concept common_reference_with = && convertible_to<_Ty1, common_reference_t<_Ty1, _Ty2>> && convertible_to<_Ty2, common_reference_t<_Ty1, _Ty2>>; -// CONCEPT common_with template concept common_with = requires { @@ -77,23 +71,18 @@ concept common_with = && common_reference_with>, common_reference_t, add_lvalue_reference_t>>; -// CONCEPT integral template concept integral = is_integral_v<_Ty>; -// CONCEPT signed_integral template concept signed_integral = integral<_Ty> && static_cast<_Ty>(-1) < static_cast<_Ty>(0); -// CONCEPT unsigned_integral template concept unsigned_integral = integral<_Ty> && !signed_integral<_Ty>; -// CONCEPT floating_point template concept floating_point = is_floating_point_v<_Ty>; -// CONCEPT assignable_from template concept assignable_from = is_lvalue_reference_v<_LTy> && common_reference_with&, const remove_reference_t<_RTy>&> @@ -103,16 +92,13 @@ concept assignable_from = is_lvalue_reference_v<_LTy> // swappable and swappable_with are defined below, since they depend on move_constructible. -// CONCEPT destructible template concept destructible = __is_nothrow_destructible(_Ty); -// CONCEPT constructible_from template concept constructible_from = destructible<_Ty> && __is_constructible(_Ty, _ArgTys...); -// CONCEPT default_initializable template concept default_initializable = constructible_from<_Ty> && requires { @@ -120,16 +106,13 @@ concept default_initializable = constructible_from<_Ty> ::new (static_cast(nullptr)) _Ty; // is-default-initializable<_Ty> }; -// CONCEPT move_constructible template concept move_constructible = constructible_from<_Ty, _Ty> && convertible_to<_Ty, _Ty>; -// CONCEPT _Has_class_or_enum_type template concept _Has_class_or_enum_type = __is_class(remove_reference_t<_Ty>) || __is_enum(remove_reference_t<_Ty>) || __is_union(remove_reference_t<_Ty>); -// CUSTOMIZATION POINT OBJECT ranges::swap namespace ranges { namespace _Swap { template @@ -174,13 +157,11 @@ namespace ranges { } } // namespace ranges -// CONCEPT swappable template concept swappable = requires(_Ty& __x, _Ty& __y) { _RANGES swap(__x, __y); }; -// CONCEPT swappable_with template concept swappable_with = common_reference_with<_Ty1, _Ty2> && requires(_Ty1&& __t, _Ty2&& __u) { @@ -190,14 +171,12 @@ concept swappable_with = common_reference_with<_Ty1, _Ty2> _RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty1&&>(__t)); }; -// CONCEPT copy_constructible template concept copy_constructible = move_constructible<_Ty> && constructible_from<_Ty, _Ty&> && convertible_to<_Ty&, _Ty> && constructible_from<_Ty, const _Ty&> && convertible_to && constructible_from<_Ty, const _Ty> && convertible_to; -// CONCEPT _Boolean_testable template concept _Boolean_testable_impl = convertible_to<_Ty, bool>; @@ -207,7 +186,6 @@ concept _Boolean_testable = _Boolean_testable_impl<_Ty> { !static_cast<_Ty&&>(__t) } -> _Boolean_testable_impl; }; -// CONCEPT _Weakly_equality_comparable_with template concept _Half_equality_comparable = requires(const remove_reference_t<_Ty1>& __x, const remove_reference_t<_Ty2>& __y) { @@ -219,18 +197,15 @@ template concept _Weakly_equality_comparable_with = _Half_equality_comparable<_Ty1, _Ty2> && _Half_equality_comparable<_Ty2, _Ty1>; -// CONCEPT equality_comparable template concept equality_comparable = _Half_equality_comparable<_Ty, _Ty>; -// CONCEPT equality_comparable_with template concept equality_comparable_with = equality_comparable<_Ty1> && equality_comparable<_Ty2> && common_reference_with&, const remove_reference_t<_Ty2>&> && equality_comparable&, const remove_reference_t<_Ty2>&>> && _Weakly_equality_comparable_with<_Ty1, _Ty2>; -// CONCEPT _Partially_ordered_with template concept _Half_ordered = requires(const remove_reference_t<_Ty1>& __t, const remove_reference_t<_Ty2>& __u) { { __t < __u } -> _Boolean_testable; @@ -242,25 +217,21 @@ concept _Half_ordered = requires(const remove_reference_t<_Ty1>& __t, const remo template concept _Partially_ordered_with = _Half_ordered<_Ty1, _Ty2> && _Half_ordered<_Ty2, _Ty1>; -// CONCEPT totally_ordered template concept totally_ordered = equality_comparable<_Ty> && _Half_ordered<_Ty, _Ty>; -// CONCEPT totally_ordered_with template concept totally_ordered_with = totally_ordered<_Ty1> && totally_ordered<_Ty2> && equality_comparable_with<_Ty1, _Ty2> && totally_ordered&, const remove_reference_t<_Ty2>&>> && _Partially_ordered_with<_Ty1, _Ty2>; -// CONCEPT movable template concept movable = is_object_v<_Ty> && move_constructible<_Ty> && assignable_from<_Ty&, _Ty> && swappable<_Ty>; -// CONCEPT copyable template concept copyable = copy_constructible<_Ty> && movable<_Ty> @@ -268,30 +239,24 @@ concept copyable = copy_constructible<_Ty> && assignable_from<_Ty&, const _Ty&> && assignable_from<_Ty&, const _Ty>; -// CONCEPT semiregular template concept semiregular = copyable<_Ty> && default_initializable<_Ty>; -// CONCEPT regular template concept regular = semiregular<_Ty> && equality_comparable<_Ty>; -// CONCEPT invocable template concept invocable = requires(_FTy&& _Fn, _ArgTys&&... _Args) { _STD invoke(static_cast<_FTy&&>(_Fn), static_cast<_ArgTys&&>(_Args)...); }; -// CONCEPT regular_invocable template concept regular_invocable = invocable<_FTy, _ArgTys...>; -// CONCEPT predicate template concept predicate = regular_invocable<_FTy, _ArgTys...> && _Boolean_testable>; -// CONCEPT relation template concept relation = predicate<_FTy, _Ty1, _Ty1> @@ -299,17 +264,14 @@ concept relation = && predicate<_FTy, _Ty1, _Ty2> && predicate<_FTy, _Ty2, _Ty1>; -// CONCEPT equivalence_relation template concept equivalence_relation = relation<_FTy, _Ty1, _Ty2>; -// CONCEPT strict_weak_order template concept strict_weak_order = relation<_FTy, _Ty1, _Ty2>; // clang-format on -// STRUCT TEMPLATE _Choice_t template struct _Choice_t { _Ty _Strategy = _Ty{}; diff --git a/stl/inc/coroutine b/stl/inc/coroutine index a9f8f729737..9f99dad5284 100644 --- a/stl/inc/coroutine +++ b/stl/inc/coroutine @@ -35,7 +35,6 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN -// STRUCT TEMPLATE coroutine_traits template struct _Coroutine_traits {}; @@ -47,7 +46,6 @@ struct _Coroutine_traits<_Ret, void_t> { template struct coroutine_traits : _Coroutine_traits<_Ret> {}; -// STRUCT TEMPLATE coroutine_handle template struct coroutine_handle; @@ -197,10 +195,8 @@ struct hash> { } }; -// STRUCT noop_coroutine_promise struct noop_coroutine_promise {}; -// STRUCT coroutine_handle template <> struct coroutine_handle { friend coroutine_handle noop_coroutine() noexcept; @@ -235,16 +231,13 @@ private: void* _Ptr = __builtin_coro_noop(); }; -// ALIAS noop_coroutine_handle using noop_coroutine_handle = coroutine_handle; -// FUNCTION noop_coroutine _NODISCARD inline noop_coroutine_handle noop_coroutine() noexcept { // Returns a handle to a coroutine that has no observable effects when resumed or destroyed. return noop_coroutine_handle{}; } -// STRUCT suspend_never struct suspend_never { _NODISCARD constexpr bool await_ready() const noexcept { return true; @@ -254,7 +247,6 @@ struct suspend_never { constexpr void await_resume() const noexcept {} }; -// STRUCT suspend_always struct suspend_always { _NODISCARD constexpr bool await_ready() const noexcept { return false; diff --git a/stl/inc/cstddef b/stl/inc/cstddef index aa370f8ac36..2e346ffc161 100644 --- a/stl/inc/cstddef +++ b/stl/inc/cstddef @@ -25,7 +25,6 @@ using _CSTD size_t; using max_align_t = double; // most aligned type #ifdef __cpp_lib_byte - // ENUM CLASS byte enum class byte : unsigned char {}; template , int> = 0> diff --git a/stl/inc/cvt/ebcdic b/stl/inc/cvt/ebcdic index a2bd7020278..25354bde42f 100644 --- a/stl/inc/cvt/ebcdic +++ b/stl/inc/cvt/ebcdic @@ -22,7 +22,6 @@ namespace stdext { namespace cvt { using _Statype = _CSTD mbstate_t; - // CLASS TEMPLATE codecvt_ebcdic template class codecvt_ebcdic : public _STD diff --git a/stl/inc/cvt/euc_0208 b/stl/inc/cvt/euc_0208 index ecc1e5df927..3d69909aa99 100644 --- a/stl/inc/cvt/euc_0208 +++ b/stl/inc/cvt/euc_0208 @@ -22,7 +22,6 @@ namespace stdext { namespace cvt { using _Statype = _CSTD mbstate_t; - // CLASS TEMPLATE codecvt_euc_0208 template class codecvt_euc_0208 : public _STD codecvt<_Elem, char, _Statype> { // facet for converting between JIS-X0208 _Elem and EUC bytes diff --git a/stl/inc/cvt/jis_0208 b/stl/inc/cvt/jis_0208 index 9f5711fb749..7faae8d8d2c 100644 --- a/stl/inc/cvt/jis_0208 +++ b/stl/inc/cvt/jis_0208 @@ -24,7 +24,6 @@ namespace stdext { #define _ESC_CODE 0x1b - // CLASS TEMPLATE codecvt_jis_0208 template class codecvt_jis_0208 : public _STD codecvt<_Elem, char, _Statype> { // facet for converting between JIS-X0208 _Elem and JIS bytes diff --git a/stl/inc/cvt/one_one b/stl/inc/cvt/one_one index dbcd59e6b32..d19e518c55d 100644 --- a/stl/inc/cvt/one_one +++ b/stl/inc/cvt/one_one @@ -25,7 +25,6 @@ namespace stdext { using _Statype = _CSTD mbstate_t; _STL_DISABLE_DEPRECATED_WARNING - // CLASS TEMPLATE codecvt_one_one template class codecvt_one_one diff --git a/stl/inc/cvt/sjis_0208 b/stl/inc/cvt/sjis_0208 index d2b2d89ac07..b17a2a690cb 100644 --- a/stl/inc/cvt/sjis_0208 +++ b/stl/inc/cvt/sjis_0208 @@ -23,7 +23,6 @@ namespace stdext { using _Statype = _CSTD mbstate_t; - // CLASS TEMPLATE codecvt_sjis_0208 template class codecvt_sjis_0208 : public _STD codecvt<_Elem, char, _Statype> { // facet for converting between JIS-X0208 _Elem and EUC bytes diff --git a/stl/inc/cvt/utf16 b/stl/inc/cvt/utf16 index 7a53127b788..f7e79b4db47 100644 --- a/stl/inc/cvt/utf16 +++ b/stl/inc/cvt/utf16 @@ -24,7 +24,6 @@ namespace stdext { using _Statype = _CSTD mbstate_t; _STL_DISABLE_DEPRECATED_WARNING - // CLASS TEMPLATE codecvt_utf16 template class codecvt_utf16 : public _STD diff --git a/stl/inc/cvt/utf8 b/stl/inc/cvt/utf8 index d5c50aced94..27067c9d928 100644 --- a/stl/inc/cvt/utf8 +++ b/stl/inc/cvt/utf8 @@ -25,7 +25,6 @@ namespace stdext { using _Statype = _CSTD mbstate_t; _STL_DISABLE_DEPRECATED_WARNING - // CLASS TEMPLATE codecvt_utf8 template class codecvt_utf8 : public _STD diff --git a/stl/inc/cvt/utf8_utf16 b/stl/inc/cvt/utf8_utf16 index 7be19d42a8d..ac78d809afe 100644 --- a/stl/inc/cvt/utf8_utf16 +++ b/stl/inc/cvt/utf8_utf16 @@ -25,7 +25,6 @@ namespace stdext { using _Mbstatype = _CSTD mbstate_t; _STL_DISABLE_DEPRECATED_WARNING - // CLASS codecvt_utf8_utf16 template class codecvt_utf8_utf16 diff --git a/stl/inc/cvt/wbuffer b/stl/inc/cvt/wbuffer index 8235088764c..a32614e8f80 100644 --- a/stl/inc/cvt/wbuffer +++ b/stl/inc/cvt/wbuffer @@ -26,7 +26,6 @@ _STL_DISABLE_CLANG_WARNINGS namespace stdext { namespace cvt { - // CLASS TEMPLATE wbuffer_convert template > class wbuffer_convert : public _STD basic_streambuf<_Elem, _Traits> { // stream buffer associated with a codecvt facet diff --git a/stl/inc/cvt/wstring b/stl/inc/cvt/wstring index fbc3cc8dbc2..96b539b4eb1 100644 --- a/stl/inc/cvt/wstring +++ b/stl/inc/cvt/wstring @@ -23,7 +23,6 @@ _STL_DISABLE_CLANG_WARNINGS namespace stdext { namespace cvt { - // CLASS TEMPLATE wstring_convert template class wstring_convert { // converts between _Elem (wide) and char (byte) strings enum { _BUF_INC = 8, _BUF_MAX = 16 }; diff --git a/stl/inc/cvt/xjis b/stl/inc/cvt/xjis index e679097035c..62dcebbf89e 100644 --- a/stl/inc/cvt/xjis +++ b/stl/inc/cvt/xjis @@ -29,7 +29,6 @@ namespace stdext { #define _ESC_CODE 0x1b - // CLASS TEMPLATE codecvt_jis template class codecvt_jis : public _STD diff --git a/stl/inc/cvt/xone_byte b/stl/inc/cvt/xone_byte index 6afc18d39d2..731bbfe7ecc 100644 --- a/stl/inc/cvt/xone_byte +++ b/stl/inc/cvt/xone_byte @@ -23,7 +23,6 @@ namespace stdext { using _Statype = _CSTD mbstate_t; - // CLASS TEMPLATE _Cvt_one_byte template class _Cvt_one_byte : public _STD codecvt<_Elem, char, _Statype> { // facet for converting between _Elem and one-byte sequences diff --git a/stl/inc/cvt/xtwo_byte b/stl/inc/cvt/xtwo_byte index f77fc0dd9fa..af4a6ed7a03 100644 --- a/stl/inc/cvt/xtwo_byte +++ b/stl/inc/cvt/xtwo_byte @@ -23,7 +23,6 @@ namespace stdext { using _Statype = _CSTD mbstate_t; - // CLASS TEMPLATE _Cvt_two_byte template class _Cvt_two_byte : public _STD diff --git a/stl/inc/deque b/stl/inc/deque index 035ca98f837..89a22445cfc 100644 --- a/stl/inc/deque +++ b/stl/inc/deque @@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE _Deque_unchecked_const_iterator template class _Deque_unchecked_const_iterator { private: @@ -151,7 +150,6 @@ _NODISCARD _Deque_unchecked_const_iterator<_Mydeque> operator+( return _Next; } -// CLASS TEMPLATE _Deque_unchecked_iterator template class _Deque_unchecked_iterator : public _Deque_unchecked_const_iterator<_Mydeque> { private: @@ -237,7 +235,6 @@ _NODISCARD _Deque_unchecked_iterator<_Mydeque> operator+( return _Next; } -// CLASS TEMPLATE _Deque_const_iterator template class _Deque_const_iterator : public _Iterator_base12 { private: @@ -440,7 +437,6 @@ _NODISCARD _Deque_const_iterator<_Mydeque> operator+( return _Next; } -// CLASS TEMPLATE _Deque_iterator template class _Deque_iterator : public _Deque_const_iterator<_Mydeque> { private: @@ -530,7 +526,6 @@ _NODISCARD _Deque_iterator<_Mydeque> operator+( return _Next; } -// deque TYPE WRAPPERS template struct _Deque_iter_types { @@ -547,7 +542,6 @@ struct _Deque_simple_types : _Simple_types<_Ty> { using _Mapptr = _Ty**; }; -// CLASS TEMPLATE _Deque_val template class _Deque_val : public _Container_base12 { public: @@ -583,7 +577,6 @@ public: size_type _Mysize; // current length of sequence }; -// CLASS TEMPLATE deque template > class deque { private: diff --git a/stl/inc/exception b/stl/inc/exception index 5c9fdcd8cbf..02507966b34 100644 --- a/stl/inc/exception +++ b/stl/inc/exception @@ -62,7 +62,6 @@ _STD_END #else // _HAS_EXCEPTIONS -// CLASS exception _STDEXT_BEGIN class exception; _STDEXT_END @@ -119,7 +118,6 @@ protected: const char* _Ptr; // the message pointer }; -// CLASS bad_exception class bad_exception : public exception { // base of all bad exceptions public: __CLR_OR_THIS_CALL bad_exception(const char* _Message = "bad exception") noexcept : exception(_Message) {} @@ -132,7 +130,6 @@ protected: } }; -// CLASS bad_alloc class bad_alloc : public exception { // base of all bad allocation exceptions public: __CLR_OR_THIS_CALL bad_alloc() noexcept @@ -160,7 +157,6 @@ public: _STDEXT_END _STD_BEGIN -// DUMMY FUNCTION DECLARATIONS using terminate_handler = void(__cdecl*)(); inline terminate_handler __CRTDECL set_terminate(terminate_handler) noexcept { // register a terminate handler @@ -316,12 +312,10 @@ _NODISCARD exception_ptr make_exception_ptr(_Ex _Except) noexcept { return exception_ptr::_Copy_exception(_STD addressof(_Except), __GetExceptionInfo(_Except)); } -// FUNCTION _Throw_bad_array_new_length [[noreturn]] inline void _Throw_bad_array_new_length() { _THROW(bad_array_new_length{}); } -// CLASS nested_exception class nested_exception { // wrap an exception_ptr public: nested_exception() noexcept : _Exc(_STD current_exception()) {} @@ -346,7 +340,6 @@ private: exception_ptr _Exc; }; -// FUNCTION TEMPLATE throw_with_nested template struct _With_nested : _Uty, nested_exception { // glue user exception to nested_exception explicit _With_nested(_Ty&& _Arg) @@ -368,7 +361,6 @@ template } #ifdef _CPPRTTI -// FUNCTION TEMPLATE rethrow_if_nested template void _Rethrow_if_nested(const _Ty* _Ptr, true_type) { // use dynamic_cast const auto _Nested = dynamic_cast(_Ptr); diff --git a/stl/inc/execution b/stl/inc/execution index 5ee5c6b987b..aaf3eb4b8fd 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -70,7 +70,6 @@ constexpr size_t _Oversubscription_multiplier = 32; constexpr size_t _Oversubmission_multiplier = 4; constexpr size_t _Still_active = static_cast(-1); -// EXECUTION POLICIES namespace execution { class sequenced_policy { // indicates support for only sequential execution, and requests termination on exceptions @@ -138,7 +137,6 @@ template <> struct is_execution_policy : true_type {}; #endif // _HAS_CXX20 -// STRUCT _Parallelism_resources_exhausted struct _Parallelism_resources_exhausted : exception { _NODISCARD virtual const char* __CLR_OR_THIS_CALL what() const noexcept override { // return pointer to message string @@ -157,10 +155,8 @@ protected: _THROW(_Parallelism_resources_exhausted{}); } -// ENUM CLASS _Cancellation_status enum class _Cancellation_status : bool { _Running, _Canceled }; -// STRUCT _Cancellation_token struct _Cancellation_token { atomic<_Cancellation_status> _Is_canceled_impl{_Cancellation_status::_Running}; @@ -181,7 +177,6 @@ struct _Cancellation_token { } }; -// CLASS _Work_ptr class _Work_ptr { public: template , _Work_ptr>, int> = 0> @@ -222,14 +217,12 @@ private: __std_PTP_WORK _Ptp_work; }; -// FUNCTION TEMPLATE _Run_available_chunked_work template void _Run_available_chunked_work(_Work& _Operation) { while (_Operation._Process_chunk() == _Cancellation_status::_Running) { // process while there are chunks remaining } } -// FUNCTION TEMPLATE _Run_chunked_parallel_work template void _Run_chunked_parallel_work(const size_t _Hw_threads, _Work& _Operation) { // process chunks of _Operation on the thread pool @@ -239,7 +232,6 @@ void _Run_chunked_parallel_work(const size_t _Hw_threads, _Work& _Operation) { _Run_available_chunked_work(_Operation); } -// CHUNK CALCULATION FUNCTIONS // The parallel algorithms library below assumes that distance(first, last) fits into a size_t; // forward iterators must refer to objects in memory and therefore must meet this requirement. // @@ -249,7 +241,6 @@ void _Run_chunked_parallel_work(const size_t _Hw_threads, _Work& _Operation) { // This assumption should be localized to the chunk calculation functions; the rest of // the library assumes that chunk numbers can be static_cast into the difference_type domain. -// FUNCTION TEMPLATE _Get_chunked_work_chunk_count template constexpr size_t _Get_chunked_work_chunk_count(const size_t _Hw_threads, const _Diff _Count) { // get the number of chunks to break work into to parallelize @@ -258,7 +249,6 @@ constexpr size_t _Get_chunked_work_chunk_count(const size_t _Hw_threads, const _ return (_STD min) (_Hw_threads * _Oversubscription_multiplier, _Size_count); } -// FUNCTION TEMPLATE _Get_least2_chunked_work_chunk_count template constexpr size_t _Get_least2_chunked_work_chunk_count(const size_t _Hw_threads, const _Diff _Count) { // get the number of chunks to break work into to parallelize, assuming chunks must be of size 2 @@ -267,7 +257,6 @@ constexpr size_t _Get_least2_chunked_work_chunk_count(const size_t _Hw_threads, return _Get_chunked_work_chunk_count(_Hw_threads, _Size_count / 2); } -// STRUCT TEMPLATE _Parallelism_allocator struct _Parallelism_allocate_traits { __declspec(allocator) static void* _Allocate(const size_t _Bytes) { void* _Result = ::operator new(_Bytes, nothrow); @@ -358,7 +347,6 @@ struct _Generalized_sum_drop { // drop off point for GENERALIZED_SUM intermediat } }; -// VARIABLE TEMPLATE _Use_atomic_iterator template struct _Atomic_is_usually_lock_free : bool_constant::is_always_lock_free> { // deferred evaluation of atomic::is_always_lock_free @@ -368,7 +356,6 @@ template inline constexpr bool _Use_atomic_iterator = conjunction_v>, is_trivially_copyable<_FwdIt>, _Atomic_is_usually_lock_free<_FwdIt>>; -// STRUCT TEMPLATE _Parallel_choose_min_result template struct _Parallel_choose_min_result { // parallel results collector which uses atomic<_Ty> to choose the minimum value _Ty _Last; @@ -391,7 +378,6 @@ struct _Parallel_choose_min_result { // parallel results collector which uses at } }; -// STRUCT TEMPLATE _Parallel_choose_max_result template struct _Parallel_choose_max_result { // parallel results collector which uses atomic<_Ty> to choose the maximum value _Ty _Last; @@ -418,7 +404,6 @@ struct _Parallel_choose_max_result { // parallel results collector which uses at } }; -// STRUCT TEMPLATE _Parallel_choose_min_chunk template struct _Parallel_choose_min_chunk { // parallel results collector which uses atomic to choose the lowest chunk's result @@ -453,7 +438,6 @@ struct _Parallel_choose_min_chunk { } }; -// STRUCT TEMPLATE _Parallel_choose_max_chunk template struct _Parallel_choose_max_chunk { // parallel results collector which uses atomic to choose the highest chunk's result @@ -488,7 +472,6 @@ struct _Parallel_choose_max_chunk { } }; -// CLASS TEMPLATE _Work_stealing_deque template struct alignas(_Ty) alignas(size_t) alignas(_Atomic_counter_t) _Circular_buffer { // work stealing deque extent type static_assert(is_trivial_v<_Ty>, "Work stealing deques work only with trivial operations"); @@ -674,7 +657,6 @@ private: }; #pragma warning(pop) -// STRUCT TEMPLATE _Work_stealing_membership enum class _Steal_result { _Success, _Abort, _Done }; template @@ -732,7 +714,6 @@ struct _Work_stealing_membership { // thread-local "ticket" that team members us } }; -// STRUCT TEMPLATE _Work_stealing_team template struct _Work_stealing_team { // inter-thread communication for threads working on a single task using _Diff = typename _Ty::difference_type; @@ -776,7 +757,6 @@ struct _Work_stealing_team { // inter-thread communication for threads working o priority_queue, greater<>> _Available_queues; }; -// STRUCT TEMPLATE _Static_partition_key template struct _Static_partition_key { // "pointer" identifying a static partition size_t _Chunk_number; // In range [0, numeric_limits<_Diff>::max()] @@ -788,7 +768,6 @@ struct _Static_partition_key { // "pointer" identifying a static partition } }; -// STRUCT TEMPLATE _Static_partition_team template struct _Static_partition_team { // common data for all static partitioned ops atomic _Consumed_chunks; @@ -838,14 +817,12 @@ struct _Static_partition_team { // common data for all static partitioned ops } }; -// STRUCT TEMPLATE _Iterator_range template struct _Iterator_range { // record of a partition of work _FwdIt _First; _FwdIt _Last; }; -// STRUCT TEMPLATE _Static_partition_range template , bool = _Is_random_iter_v<_FwdIt>> struct _Static_partition_range; @@ -966,7 +943,6 @@ struct _Static_partition_range<_FwdIt, _Diff, false> { } }; -// STRUCT TEMPLATE _Static_partition_range_backward template , bool = _Is_random_iter_v<_BidIt>> struct _Static_partition_range_backward; @@ -1024,7 +1000,6 @@ struct _Static_partition_range_backward<_BidIt, _Diff, false> { } }; -// FUNCTION TEMPLATE _Distance_any template _Common_diff_t<_InIt1, _InIt2> _Distance_any(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2) { // get the distance from 2 ranges which should have identical lengths @@ -1037,7 +1012,6 @@ _Common_diff_t<_InIt1, _InIt2> _Distance_any(_InIt1 _First1, _InIt1 _Last1, _InI } } -// FUNCTION TEMPLATE _Distance_min template _Common_diff_t<_InIt1, _InIt2> _Distance_min(_InIt1 _First1, const _InIt1 _Last1, _InIt2 _First2, const _InIt2 _Last2) { // get min(distance(_First1, _Last1), distance(_First2, _Last2)) @@ -1068,7 +1042,6 @@ _Common_diff_t<_InIt1, _InIt2> _Distance_min(_InIt1 _First1, const _InIt1 _Last1 return _Result; } -// PARALLEL FUNCTION TEMPLATE all_of template struct _Static_partitioned_all_of_family2 { // all_of/any_of/none_of task scheduled on the system thread pool _Static_partition_team<_Iter_diff_t<_FwdIt>> _Team; @@ -1150,7 +1123,6 @@ _NODISCARD bool all_of(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept } } -// PARALLEL FUNCTION TEMPLATE any_of template /* = 0 */> _NODISCARD bool any_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // test if any element in [_First, _Last) satisfies _Pred with the indicated execution policy @@ -1165,7 +1137,6 @@ _NODISCARD bool any_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pr } } -// PARALLEL FUNCTION TEMPLATE none_of template /* = 0 */> _NODISCARD bool none_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // test if no element in [_First, _Last) satisfies _Pred with the indicated execution policy @@ -1180,7 +1151,6 @@ _NODISCARD bool none_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _P } } -// PARALLEL FUNCTION TEMPLATE for_each template void _For_each_ivdep(_FwdIt _First, const _FwdIt _Last, _Fn _Func) { // perform function for each element [_First, _Last) assuming independent loop bodies @@ -1251,7 +1221,6 @@ void for_each(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Fn _Func) noexcept /* termi } } -// PARALLEL FUNCTION TEMPLATE for_each_n template _FwdIt _For_each_n_ivdep(_FwdIt _First, _Diff _Count, _Fn _Func) { // perform function for each element [_First, _First + _Count) assuming independent loop bodies @@ -1300,7 +1269,6 @@ _FwdIt for_each_n(_ExPo&&, _FwdIt _First, const _Diff _Count_raw, _Fn _Func) noe return _First; } -// PARALLEL FUNCTION TEMPLATE find template using _Parallel_find_results = conditional_t<_Use_atomic_iterator<_FwdIt>, _Parallel_choose_min_result<_FwdIt>, _Parallel_choose_min_chunk<_FwdIt>>; @@ -1378,7 +1346,6 @@ _NODISCARD _FwdIt find(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, const _ return _First; } -// PARALLEL FUNCTION TEMPLATE find_if template /* = 0 */> _NODISCARD _FwdIt find_if(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // find first satisfying _Pred @@ -1392,7 +1359,6 @@ _NODISCARD _FwdIt find_if(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr return _First; } -// PARALLEL FUNCTION TEMPLATE find_if_not template /* = 0 */> _NODISCARD _FwdIt find_if_not(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // find first satisfying !_Pred @@ -1407,7 +1373,6 @@ _NODISCARD _FwdIt find_if_not(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, return _First; } -// PARALLEL FUNCTION TEMPLATE find_end template _Iter_diff_t<_FwdIt1> _Get_find_end_forward_partition_size( _FwdIt1 _First1, const _FwdIt1 _Last1, _FwdIt2 _First2, const _FwdIt2 _Last2) { @@ -1607,7 +1572,6 @@ _NODISCARD _FwdIt1 find_end(_ExPo&&, _FwdIt1 _First1, const _FwdIt1 _Last1, cons return _First1; } -// PARALLEL FUNCTION TEMPLATE find_first_of template /* = 0 */> _NODISCARD _FwdIt1 find_first_of(_ExPo&& _Exec, const _FwdIt1 _First1, _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2, _Pr _Pred) noexcept /* terminates */ { @@ -1630,7 +1594,6 @@ _NODISCARD _FwdIt1 find_first_of(_ExPo&& _Exec, const _FwdIt1 _First1, _FwdIt1 _ return _Last1; } -// PARALLEL FUNCTION TEMPLATE adjacent_find template struct _Static_partitioned_adjacent_find2 { _Static_partition_team<_Iter_diff_t<_FwdIt>> _Team; @@ -1703,7 +1666,6 @@ _NODISCARD _FwdIt adjacent_find(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) return _Last; } -// PARALLEL FUNCTION TEMPLATES count AND count_if template struct _Static_partitioned_count_if2 { using _Diff = _Iter_diff_t<_FwdIt>; @@ -1779,7 +1741,6 @@ _NODISCARD _Iter_diff_t<_FwdIt> count(_ExPo&& _Exec, const _FwdIt _First, const [&_Val](auto&& _Iter_val) { return _STD forward(_Iter_val) == _Val; }); } -// PARALLEL FUNCTION TEMPLATE mismatch template >&& _Is_random_iter_v<_FwdIt2>, bool = _Use_atomic_iterator<_Unwrapped_t>&& _Is_random_iter_v<_FwdIt1>> @@ -1976,7 +1937,6 @@ _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch( return {_First1, _First2}; } -// PARALLEL FUNCTION TEMPLATE equal template struct _Static_partitioned_equal2 { using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2>; @@ -2091,7 +2051,6 @@ _NODISCARD bool equal(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, cons return _STD equal(_UFirst1, _ULast1, _UFirst2, _ULast2, _Pass_fn(_Pred)); } -// PARALLEL FUNCTION TEMPLATE search template struct _Static_partitioned_search2 { _Static_partition_team<_Iter_diff_t<_FwdItHaystack>> _Team; @@ -2211,7 +2170,6 @@ _NODISCARD _FwdItHaystack search(_ExPo&&, const _FwdItHaystack _First1, _FwdItHa return _Last1; } -// PARALLEL FUNCTION TEMPLATE search_n template struct _Static_partitioned_search_n2 { _Static_partition_team<_Iter_diff_t<_FwdIt>> _Team; @@ -2309,7 +2267,6 @@ _NODISCARD _FwdIt search_n(_ExPo&&, const _FwdIt _First, _FwdIt _Last, const _Di return _Last; } -// PARALLEL FUNCTION TEMPLATE transform template struct _Static_partitioned_unary_transform2 { using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2>; @@ -2466,7 +2423,6 @@ _FwdIt3 transform(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _F } #pragma warning(pop) -// PARALLEL FUNCTION TEMPLATE replace template /* = 0 */> void replace(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty& _Oldval, const _Ty& _Newval) noexcept /* terminates */ { @@ -2479,7 +2435,6 @@ void replace(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty& }); } -// PARALLEL FUNCTION TEMPLATE replace_if template /* = 0 */> void replace_if(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred, const _Ty& _Val) noexcept /* terminates */ { @@ -2493,7 +2448,6 @@ void replace_if(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, _Pr _Pre }); } -// PARALLEL FUNCTION TEMPLATES remove AND remove_if template _FwdIt _Remove_move_if_unchecked(_FwdIt _First, const _FwdIt _Last, _FwdIt _Dest, _Pr _Pred) { // move omitting each element satisfying _Pred @@ -2640,7 +2594,6 @@ _NODISCARD _FwdIt remove(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, [&_Val](auto&& _Lhs) { return _STD forward(_Lhs) == _Val; }); } -// PARALLEL FUNCTION TEMPLATE sort template struct _Sort_work_item_impl { // data describing an individual sort work item using difference_type = _Diff; @@ -2780,7 +2733,6 @@ void sort(_ExPo&&, const _RanIt _First, const _RanIt _Last, _Pr _Pred) noexcept _Sort_unchecked(_UFirst, _ULast, _Ideal, _Pass_fn(_Pred)); } -// PARALLEL FUNCTION TEMPLATE stable_sort template struct _Static_partitioned_temporary_buffer2 { _Optimistic_temporary_buffer<_Ty>& _Temp_buf; @@ -3043,7 +2995,6 @@ void stable_sort(_ExPo&&, const _BidIt _First, const _BidIt _Last, _Pr _Pred) no _Stable_sort_unchecked(_UFirst, _ULast, _Count, _Temp_buf._Data, _Temp_buf._Capacity, _Pass_fn(_Pred)); } -// PARALLEL FUNCTION TEMPLATE is_sorted_until template struct _Static_partitioned_is_sorted_until { _Static_partition_team<_Iter_diff_t<_FwdIt>> _Team; @@ -3119,7 +3070,6 @@ _NODISCARD _FwdIt is_sorted_until(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pre return _First; } -// PARALLEL FUNCTION TEMPLATE is_partitioned inline constexpr unsigned char _Contains_counterexample = 0; inline constexpr unsigned char _Contains_true = 1; inline constexpr unsigned char _Contains_false = 2; @@ -3272,7 +3222,6 @@ _NODISCARD bool is_partitioned(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, return _STD is_partitioned(_UFirst, _ULast, _Pass_fn(_Pred)); } -// PARALLEL FUNCTION TEMPLATE is_heap_until template struct _Static_partitioned_is_heap_until { using _Diff = _Iter_diff_t<_RanIt>; @@ -3346,7 +3295,6 @@ _NODISCARD _RanIt is_heap_until(_ExPo&&, _RanIt _First, _RanIt _Last, _Pr _Pred) return _First; } -// PARALLEL FUNCTION TEMPLATE partition template pair<_FwdIt, _Iter_diff_t<_FwdIt>> _Partition_with_count_unchecked(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // move elements satisfying _Pred to front and track how many elements satisfy _Pred @@ -3594,7 +3542,6 @@ _FwdIt partition(_ExPo&&, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept return _First; } -// PARALLEL FUNCTION TEMPLATE set_intersection inline constexpr unsigned char _Local_available = 1; inline constexpr unsigned char _Sum_available = 2; @@ -3939,7 +3886,6 @@ _FwdIt3 set_intersection(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Firs return _Dest; } -// PARALLEL FUNCTION TEMPLATE set_difference struct _Set_difference_per_chunk { template _Common_diff_t<_RanIt1, _RanIt2, _RanIt3> _Update_dest( @@ -4029,7 +3975,6 @@ _FwdIt3 set_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2 return _Dest; } -// PARALLEL FUNCTION TEMPLATE reduce template _Ty _Reduce_move_unchecked(_InIt _First, const _InIt _Last, _Ty _Val, _BinOp _Reduce_op) { // return reduction, choose optimization @@ -4134,7 +4079,6 @@ _NODISCARD _Ty reduce(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Ty _Val return _STD reduce(_UFirst, _ULast, _STD move(_Val), _Pass_fn(_Reduce_op)); } -// PARALLEL FUNCTION TEMPLATE transform_reduce template struct _Static_partitioned_transform_reduce_binary2 { // transform-reduction task scheduled on the system thread pool using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2>; @@ -4333,7 +4277,6 @@ _NODISCARD _Ty transform_reduce(_ExPo&&, const _FwdIt _First, const _FwdIt _Last return _STD transform_reduce(_UFirst, _ULast, _STD move(_Val), _Pass_fn(_Reduce_op), _Pass_fn(_Transform_op)); } -// PARALLEL FUNCTION TEMPLATE exclusive_scan struct _No_init_tag { explicit _No_init_tag() = default; }; // tag to indicate that no initial value is to be used @@ -4480,7 +4423,6 @@ _FwdIt2 exclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdI return _Dest; } -// PARALLEL FUNCTION TEMPLATE inclusive_scan template _FwdIt2 _Inclusive_scan_per_chunk( _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _Ty& _Val, _No_init_tag) { @@ -4668,7 +4610,6 @@ _FwdIt2 inclusive_scan(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _B return _Dest; } -// PARALLEL FUNCTION TEMPLATE transform_exclusive_scan template _FwdIt2 _Transform_exclusive_scan_per_chunk( _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op, _Ty& _Val) { @@ -4814,7 +4755,6 @@ _FwdIt2 transform_exclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _L return _Dest; } -// PARALLEL FUNCTION TEMPLATE transform_inclusive_scan template _FwdIt2 _Transform_inclusive_scan_per_chunk(_FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op, _Ty& _Val, _No_init_tag) { @@ -5011,7 +4951,6 @@ _FwdIt2 transform_inclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _L return _Dest; } -// PARALLEL FUNCTION TEMPLATE adjacent_difference template struct _Static_partitioned_adjacent_difference2 { using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2>; diff --git a/stl/inc/experimental/coroutine b/stl/inc/experimental/coroutine index 062973090ba..ed2b37665a6 100644 --- a/stl/inc/experimental/coroutine +++ b/stl/inc/experimental/coroutine @@ -61,11 +61,9 @@ namespace experimental { using promise_type = typename _Ret::promise_type; }; - // STRUCT TEMPLATE coroutine_traits template struct coroutine_traits : _Coroutine_traits_sfinae<_Ret> {}; - // STRUCT TEMPLATE coroutine_handle template struct coroutine_handle; @@ -192,7 +190,6 @@ namespace experimental { } - // STRUCT suspend_if struct suspend_if { bool _Ready; @@ -207,7 +204,6 @@ namespace experimental { void await_resume() noexcept {} }; - // STRUCT suspend_always struct suspend_always { bool await_ready() noexcept { return false; @@ -218,7 +214,6 @@ namespace experimental { void await_resume() noexcept {} }; - // STRUCT suspend_never struct suspend_never { bool await_ready() noexcept { return true; diff --git a/stl/inc/experimental/deque b/stl/inc/experimental/deque index 3b0bf2eb361..d9452eeef2d 100644 --- a/stl/inc/experimental/deque +++ b/stl/inc/experimental/deque @@ -22,13 +22,11 @@ _STD_BEGIN namespace experimental { inline namespace fundamentals_v2 { - // FUNCTION TEMPLATE erase_if template _DEPRECATE_EXPERIMENTAL_ERASE void erase_if(deque<_Ty, _Alloc>& _Cont, _Pr _Pred) { _Erase_remove_if(_Cont, _Pass_fn(_Pred)); } - // FUNCTION TEMPLATE erase template _DEPRECATE_EXPERIMENTAL_ERASE void erase(deque<_Ty, _Alloc>& _Cont, const _Uty& _Val) { _Erase_remove(_Cont, _Val); diff --git a/stl/inc/experimental/filesystem b/stl/inc/experimental/filesystem index caea6224a2d..c305ce17f4f 100644 --- a/stl/inc/experimental/filesystem +++ b/stl/inc/experimental/filesystem @@ -62,7 +62,6 @@ using _Pchar = wchar_t; // UTF16 struct _Char8_t; // flag for UTF8 -// ENUM file_type enum class file_type { // names for file types not_found = -1, none, @@ -76,7 +75,6 @@ enum class file_type { // names for file types unknown }; -// ENUM copy_options enum class copy_options { // names for copy options none = 0, skip_existing = 1, @@ -93,13 +91,11 @@ enum class copy_options { // names for copy options _BITMASK_OPS(copy_options) -// ENUM directory_options enum class directory_options { // names for directory options none = 0, follow_directory_symlink }; -// ENUM perms enum class perms { // names for permissions none = 0, owner_read = 0400, // S_IRUSR @@ -127,7 +123,6 @@ enum class perms { // names for permissions _BITMASK_OPS(perms) -// CLASS file_status class file_status { // stores file status public: explicit file_status(file_type _Ftype = file_type::none, perms _Prms = perms::unknown) noexcept @@ -160,14 +155,12 @@ private: perms _Myperms; }; -// STRUCT space_info struct space_info { // space information for a file uintmax_t capacity; uintmax_t free; uintmax_t available; }; -// SYSTEM SUPPORT FUNCTIONS // wide filenames _FS_DLL void* __CLRCALL_PURE_OR_CDECL _Open_dir(wchar_t (&)[_MAX_FILESYS_NAME], const wchar_t*, int&, file_type&); _FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Read_dir(wchar_t (&)[_MAX_FILESYS_NAME], void*, file_type&); @@ -197,7 +190,6 @@ _FS_DLL int __CLRCALL_PURE_OR_CDECL _Unlink(const wchar_t*); _FS_DLL int __CLRCALL_PURE_OR_CDECL _Copy_file(const wchar_t*, const wchar_t*); _FS_DLL int __CLRCALL_PURE_OR_CDECL _Chmod(const wchar_t*, perms); -// STRUCT TEMPLATE _Path_cvt template , class _Outalloc = allocator<_Outchar>> struct _Path_cvt { // converts among {char, wchar_t, UTF8, char16_t, char32_t} paths @@ -435,7 +427,6 @@ struct _Path_cvt class _Path_iterator { public: @@ -731,7 +721,6 @@ private: size_t _Myoff; // current offset in full path }; -// CLASS path AND FRIENDS class path { // stores a pathname public: using value_type = _Pchar; @@ -743,8 +732,6 @@ public: path(const path& _Right) : _Mystr(_Right._Mystr) {} - // ARBITRARY SOURCE CONSTRUCT - template , int> = 0> path(_InIt _First, _InIt _Last) { using _Valty = _Iter_value_t<_InIt>; @@ -771,8 +758,6 @@ public: *this /= _Path_cvt<_Elem, value_type>::_Cvt(_Str_out, _Str.c_str(), _Str.size()); } - // ARBITRARY SOURCE CONSTRUCT, WITH LOCALE - template , int> = 0> path(_InIt _First, _InIt _Last, const locale& _Loc) { using _Valty = _Iter_value_t<_InIt>; @@ -808,7 +793,6 @@ public: ~path() noexcept {} - // ARBITRARY SOURCE ASSIGN path& operator=(const path& _Right) { _Mystr = _Right._Mystr; return *this; @@ -839,7 +823,6 @@ public: return *this = path(_Str); } - // ARBITRARY SOURCE APPEND path& operator/=(const path& _Path) { // append copy return append(_Path._Mystr); } @@ -886,7 +869,6 @@ public: return *this; } - // ARBITRARY SOURCE CONCATENATE path& operator+=(const path& _Path) { // concatenate copy return concat(_Path._Mystr); } @@ -935,7 +917,6 @@ public: return *this; } - // PATH MODIFIERS void clear() noexcept { // clear the stored string _Mystr.clear(); } @@ -987,7 +968,6 @@ public: _Mystr.swap(_Right._Mystr); } - // NATIVE FORMAT OBSERVERS _NODISCARD const string_type& native() const noexcept { return _Mystr; } @@ -1036,8 +1016,6 @@ public: } #endif // 0 - // GENERIC FORMAT OBSERVERS - string_type _Make_generic() const { // copy and convert any '\' to '/' string_type _Str = _Mystr; _STD replace(_Str.begin(), _Str.end(), _FS_BSLASH, _FS_SLASH); @@ -1086,7 +1064,6 @@ public: } #endif // 0 - // PATH COMPARISON _NODISCARD int compare(const path& _Path) const noexcept { // compare native() to _Path.native() return _Mystr.compare(_Path._Mystr); } @@ -1099,7 +1076,6 @@ public: return _Mystr.compare(_Ptr); } - // PATH DECOMPOSITION _NODISCARD path root_name() const { return path(_Mystr.substr(0, _Prefix_end())); } @@ -1202,7 +1178,6 @@ public: return !is_absolute(); } - // PATH ITERATOR SUPPORT using iterator = _Path_iterator; using const_iterator = iterator; @@ -1298,7 +1273,6 @@ basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, return _Istr; } -// FUNCTION TEMPLATE u8path template , int> = 0> _NODISCARD path u8path(_InIt _First, _InIt _Last) { // make path from [_First, _Last) UTF8, given iterators string _Str(_First, _Last); @@ -1323,7 +1297,6 @@ _NODISCARD path u8path(const basic_string& _Str) { // mak return path(_Path_cvt<_Char8_t, _Pchar>::_Cvt(_Str_out, _Str.c_str(), _Str.size())); } -// CLASS filesystem_error AND FRIENDS class filesystem_error : public system_error { // base of all filesystem-error exceptions public: explicit filesystem_error( @@ -1376,7 +1349,6 @@ protected: _THROW(filesystem_error{_Message}); // centralize construction of temporary string } -// CLASS directory_entry AND FRIENDS class directory_entry { // represents a directory entry public: using string_type = _FSPFX path::string_type; @@ -1625,7 +1597,6 @@ _NODISCARD inline directory_iterator end(const directory_iterator&) noexcept { return {}; } -// CLASS recursive_directory_iterator class recursive_directory_iterator { public: using _Myiter = _Directory_iterator; @@ -1775,7 +1746,6 @@ _NODISCARD inline recursive_directory_iterator end(const recursive_directory_ite return {}; } -// OPERATIONAL FUNCTIONS inline path _Absolute(const path& _Path, const path& _Base, error_code& _Code) { // make absolute path from _Path and directory _Base; errors in _Code _Code.clear(); diff --git a/stl/inc/experimental/forward_list b/stl/inc/experimental/forward_list index ec2323808a8..6ab53a637f1 100644 --- a/stl/inc/experimental/forward_list +++ b/stl/inc/experimental/forward_list @@ -22,13 +22,11 @@ _STD_BEGIN namespace experimental { inline namespace fundamentals_v2 { - // FUNCTION TEMPLATE erase_if template _DEPRECATE_EXPERIMENTAL_ERASE void erase_if(forward_list<_Ty, _Alloc>& _Cont, _Pr _Pred) { _Cont.remove_if(_Pass_fn(_Pred)); } - // FUNCTION TEMPLATE erase template _DEPRECATE_EXPERIMENTAL_ERASE void erase(forward_list<_Ty, _Alloc>& _Cont, const _Uty& _Val) { _Cont.remove_if([&](_Ty& _Elem) { return _Elem == _Val; }); diff --git a/stl/inc/experimental/list b/stl/inc/experimental/list index d4d1314bcf8..74da09a2674 100644 --- a/stl/inc/experimental/list +++ b/stl/inc/experimental/list @@ -22,13 +22,11 @@ _STD_BEGIN namespace experimental { inline namespace fundamentals_v2 { - // FUNCTION TEMPLATE erase_if template _DEPRECATE_EXPERIMENTAL_ERASE void erase_if(list<_Ty, _Alloc>& _Cont, _Pr _Pred) { _Cont.remove_if(_Pass_fn(_Pred)); } - // FUNCTION TEMPLATE erase template _DEPRECATE_EXPERIMENTAL_ERASE void erase(list<_Ty, _Alloc>& _Cont, const _Uty& _Val) { _Cont.remove_if([&](_Ty& _Elem) { return _Elem == _Val; }); diff --git a/stl/inc/experimental/map b/stl/inc/experimental/map index 3c5bab0cd3c..3aea2de141e 100644 --- a/stl/inc/experimental/map +++ b/stl/inc/experimental/map @@ -22,7 +22,6 @@ _STD_BEGIN namespace experimental { inline namespace fundamentals_v2 { - // FUNCTION TEMPLATE erase_if template _DEPRECATE_EXPERIMENTAL_ERASE void erase_if(map<_Kty, _Ty, _Keylt, _Alloc>& _Cont, _Pr _Pred) { _Erase_nodes_if(_Cont, _Pass_fn(_Pred)); diff --git a/stl/inc/experimental/resumable b/stl/inc/experimental/resumable index 0991c7c20d4..e243bcec857 100644 --- a/stl/inc/experimental/resumable +++ b/stl/inc/experimental/resumable @@ -31,10 +31,8 @@ _STD_BEGIN namespace experimental { #ifndef __EDG__ - // STRUCT noop_coroutine_promise struct noop_coroutine_promise {}; - // STRUCT coroutine_handle template <> struct coroutine_handle : coroutine_handle<> { friend coroutine_handle noop_coroutine() noexcept; @@ -67,10 +65,8 @@ namespace experimental { } }; - // ALIAS noop_coroutine_handle using noop_coroutine_handle = coroutine_handle; - // FUNCTION noop_coroutine _NODISCARD inline noop_coroutine_handle noop_coroutine() noexcept { // Returns a handle to a coroutine that has no observable effects when resumed or destroyed. return noop_coroutine_handle{}; diff --git a/stl/inc/experimental/set b/stl/inc/experimental/set index 9fc738f5d49..60bf792a7d6 100644 --- a/stl/inc/experimental/set +++ b/stl/inc/experimental/set @@ -22,7 +22,6 @@ _STD_BEGIN namespace experimental { inline namespace fundamentals_v2 { - // FUNCTION TEMPLATE erase_if template _DEPRECATE_EXPERIMENTAL_ERASE void erase_if(set<_Kty, _Keylt, _Alloc>& _Cont, _Pr _Pred) { _Erase_nodes_if(_Cont, _Pass_fn(_Pred)); diff --git a/stl/inc/experimental/string b/stl/inc/experimental/string index a6bc3945435..e007b96416b 100644 --- a/stl/inc/experimental/string +++ b/stl/inc/experimental/string @@ -22,13 +22,11 @@ _STD_BEGIN namespace experimental { inline namespace fundamentals_v2 { - // FUNCTION TEMPLATE erase_if template _DEPRECATE_EXPERIMENTAL_ERASE void erase_if(basic_string<_Elem, _Traits, _Alloc>& _Cont, _Pr _Pred) { _Erase_remove_if(_Cont, _Pass_fn(_Pred)); } - // FUNCTION TEMPLATE erase template _DEPRECATE_EXPERIMENTAL_ERASE void erase(basic_string<_Elem, _Traits, _Alloc>& _Cont, const _Uty& _Val) { _Erase_remove(_Cont, _Val); diff --git a/stl/inc/experimental/unordered_map b/stl/inc/experimental/unordered_map index 106746b0e57..979db931daf 100644 --- a/stl/inc/experimental/unordered_map +++ b/stl/inc/experimental/unordered_map @@ -22,7 +22,6 @@ _STD_BEGIN namespace experimental { inline namespace fundamentals_v2 { - // FUNCTION TEMPLATE erase_if template _DEPRECATE_EXPERIMENTAL_ERASE void erase_if( unordered_map<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>& _Cont, _Pr _Pred) { diff --git a/stl/inc/experimental/unordered_set b/stl/inc/experimental/unordered_set index 44f4e6c4db5..69d6bbee7e5 100644 --- a/stl/inc/experimental/unordered_set +++ b/stl/inc/experimental/unordered_set @@ -22,7 +22,6 @@ _STD_BEGIN namespace experimental { inline namespace fundamentals_v2 { - // FUNCTION TEMPLATE erase_if template _DEPRECATE_EXPERIMENTAL_ERASE void erase_if(unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _Cont, _Pr _Pred) { _Erase_nodes_if(_Cont, _Pass_fn(_Pred)); diff --git a/stl/inc/experimental/vector b/stl/inc/experimental/vector index e4422ebabd2..9dae0d7d3cc 100644 --- a/stl/inc/experimental/vector +++ b/stl/inc/experimental/vector @@ -22,13 +22,11 @@ _STD_BEGIN namespace experimental { inline namespace fundamentals_v2 { - // FUNCTION TEMPLATE erase_if template _DEPRECATE_EXPERIMENTAL_ERASE void erase_if(vector<_Ty, _Alloc>& _Cont, _Pr _Pred) { _Erase_remove_if(_Cont, _Pass_fn(_Pred)); } - // FUNCTION TEMPLATE erase template _DEPRECATE_EXPERIMENTAL_ERASE void erase(vector<_Ty, _Alloc>& _Cont, const _Uty& _Val) { _Erase_remove(_Cont, _Val); diff --git a/stl/inc/filesystem b/stl/inc/filesystem index 3c91851c797..afe9ab9aa56 100644 --- a/stl/inc/filesystem +++ b/stl/inc/filesystem @@ -409,7 +409,6 @@ namespace filesystem { } } - // FUNCTION TEMPLATE _Unaligned_load template _NODISCARD _Ty _Unaligned_load(const void* _Ptr) { // load a _Ty from _Ptr static_assert(is_trivial_v<_Ty>, "Unaligned loads require trivial types"); @@ -674,7 +673,6 @@ namespace filesystem { } }; - // CLASS path template class _Path_iterator; @@ -1451,7 +1449,6 @@ namespace filesystem { return path(_Convert_range_to_wide(_First, _Last, _Utf8_conversion{})); } - // CLASS TEMPLATE _Path_iterator template class _Path_iterator { // almost bidirectional iterator for path public: @@ -1790,7 +1787,6 @@ namespace filesystem { return iterator(_Text.cend(), this); } - // CLASS filesystem_error class filesystem_error : public system_error { // base of all filesystem-error exceptions public: filesystem_error(const string& _Message, const error_code _Errcode) @@ -1872,7 +1868,6 @@ namespace filesystem { _THROW(filesystem_error(_Op, _Path1, _Path2, _Error)); } - // ENUM CLASS file_type enum class file_type { none, not_found, @@ -1892,7 +1887,6 @@ namespace filesystem { junction // implementation-defined value indicating an NT junction }; - // ENUM CLASS perms enum class perms { none = 0, @@ -1924,7 +1918,6 @@ namespace filesystem { _BITMASK_OPS(perms) - // ENUM CLASS copy_options enum class copy_options { none = static_cast(__std_fs_copy_options::_None), @@ -1949,7 +1942,6 @@ namespace filesystem { _BITMASK_OPS(copy_options) - // CLASS file_status class file_status { public: // [fs.file_status.cons], constructors and destructor @@ -2104,7 +2096,6 @@ namespace filesystem { return _Status.type() == file_type::symlink; } - // STRUCT _File_status_and_error struct _File_status_and_error { file_status _Status; __std_win_error _Error; @@ -2123,14 +2114,12 @@ namespace filesystem { inline constexpr auto _Symlink_status_stats_flags = __std_fs_stats_flags::_Attributes | __std_fs_stats_flags::_Reparse_tag; - // ALIAS file_time_type #if _HAS_CXX20 using file_time_type = _CHRONO time_point<_CHRONO file_clock>; #else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv using file_time_type = _CHRONO time_point; #endif // ^^^ !_HAS_CXX20 - // CLASS directory_entry class directory_entry { public: // [fs.dir.entry.cons], constructors and destructor @@ -2532,7 +2521,6 @@ namespace filesystem { filesystem::path _Path; }; - // ENUM CLASS directory_options enum class directory_options { none = 0, follow_directory_symlink = 1, skip_permission_denied = 2 }; _BITMASK_OPS(directory_options) @@ -2641,7 +2629,6 @@ namespace filesystem { class directory_iterator; class recursive_directory_iterator; - // STRUCT _Directory_entry_proxy struct _Directory_entry_proxy { _NODISCARD directory_entry operator*() && noexcept { return _STD move(_Entry); @@ -2656,7 +2643,6 @@ namespace filesystem { directory_entry _Entry; }; - // CLASS directory_iterator class directory_iterator { public: using iterator_category = input_iterator_tag; @@ -2875,7 +2861,6 @@ namespace filesystem { : _Dir_enum_impl(_STD move(_Create_data)), _Options(_Options_arg) {} }; - // CLASS recursive_directory_iterator class recursive_directory_iterator { public: using iterator_category = input_iterator_tag; @@ -2998,7 +2983,6 @@ namespace filesystem { return {}; } - // FUNCTION absolute _NODISCARD inline __std_win_error _Absolute(path& _Result, const wstring& _Text) { // pre: _Result.empty() if (_Text.empty()) { return __std_win_error::_Success; @@ -3041,7 +3025,6 @@ namespace filesystem { return _Result; } - // FUNCTION canonical _NODISCARD inline __std_win_error _Canonical(path& _Result, const wstring& _Text) { // pre: _Result.empty() if (_Text.empty()) { return __std_win_error::_Success; @@ -3116,7 +3099,6 @@ namespace filesystem { return _Result; } - // FUNCTION create_directory_symlink _NODISCARD inline unique_ptr _Get_cleaned_symlink_target(const path& _To) noexcept { // transforms /s in the root-name to \s, and all other directory-separators into single \s // example: a/\/b -> a\b @@ -3179,7 +3161,6 @@ namespace filesystem { } } - // FUNCTION create_hard_link inline void create_hard_link(const path& _To, const path& _New_hard_link) { // create a hard link for a file, _New_hard_link -> _To // note reversed parameter order: @@ -3195,7 +3176,6 @@ namespace filesystem { _Ec = _Make_ec(__std_fs_create_hard_link(_New_hard_link.c_str(), _To.c_str())); } - // FUNCTION create_symlink inline void create_symlink(const path& _To, const path& _New_symlink) { // create a symlink for a file, _New_symlink -> _To const auto _Cleaned = _Get_cleaned_symlink_target(_To); @@ -3221,7 +3201,6 @@ namespace filesystem { } } - // FUNCTION read_symlink _NODISCARD inline __std_win_error _Read_symlink_reparse_data( const _Fs_file& _Handle, unique_ptr& _Buffer_unique_ptr) noexcept { constexpr auto _Buffer_size = 16 * 1024 + sizeof(wchar_t); // MAXIMUM_REPARSE_DATA_BUFFER_SIZE + sizeof(wchar_t) @@ -3286,7 +3265,6 @@ namespace filesystem { return _Result; } - // FUNCTION copy_symlink _NODISCARD inline __std_win_error _Copy_symlink(const path& _Symlink, const path& _New_symlink) noexcept { __std_win_error _Err; unique_ptr _Buffer_unique_ptr; @@ -3342,7 +3320,6 @@ namespace filesystem { } } - // FUNCTION copy_file inline bool copy_file(const path& _From, const path& _To, const copy_options _Options, error_code& _Ec) noexcept /* strengthened */ { // copy a file _From -> _To according to _Options @@ -3373,7 +3350,6 @@ namespace filesystem { return _STD filesystem::copy_file(_From, _To, copy_options::none); } - // FUNCTION equivalent _NODISCARD inline pair<__std_win_error, bool> _Equivalent( const wchar_t* const _Lhs, const wchar_t* const _Rhs) noexcept { __std_fs_file_id _Left_id; @@ -3408,7 +3384,6 @@ namespace filesystem { return _Result.second; } - // FUNCTION exists _NODISCARD inline file_status status(const path& _Path); _NODISCARD inline file_status status(const path& _Path, error_code& _Ec) noexcept; _NODISCARD inline file_status symlink_status(const path& _Path); @@ -3434,7 +3409,6 @@ namespace filesystem { return _Result; } - // FUNCTION file_size _NODISCARD inline __std_win_error _File_size(const path& _Path, uintmax_t& _Result) noexcept { __std_fs_stats _Stats; const auto _Error = __std_fs_get_stats( @@ -3464,7 +3438,6 @@ namespace filesystem { return _Result; } - // FUNCTION hard_link_count _NODISCARD inline __std_win_error _Hard_link_count(const path& _Path, uintmax_t& _Result) noexcept { __std_fs_stats _Stats; const auto _Error = __std_fs_get_stats( @@ -3495,7 +3468,6 @@ namespace filesystem { return _Result; } - // FUNCTION is_block_file _NODISCARD inline bool is_block_file(const path&) noexcept /* strengthened */ { // tests whether the input path is a block special file (never on Windows) return false; @@ -3507,7 +3479,6 @@ namespace filesystem { return false; // note status sets _Ec to an error on nonexistent input } - // FUNCTION is_character_file _NODISCARD inline bool is_character_file(const path&) noexcept /* strengthened */ { // tests whether the input path is a character special file (never on Windows) return false; @@ -3519,7 +3490,6 @@ namespace filesystem { return false; // note status sets _Ec to an error on nonexistent input } - // FUNCTION is_directory _NODISCARD inline bool is_directory(const path& _Path) { // tests whether _Path is a directory return _STD filesystem::is_directory(_STD filesystem::status(_Path)); } @@ -3529,7 +3499,6 @@ namespace filesystem { return _STD filesystem::is_directory(_STD filesystem::status(_Path, _Ec)); } - // FUNCTION is_empty _NODISCARD inline bool is_empty(const path& _Path, error_code& _Ec) { // test whether _Path refers to a zero sized file or empty directory constexpr auto _Flags = __std_fs_stats_flags::_Attributes | __std_fs_stats_flags::_File_size @@ -3560,7 +3529,6 @@ namespace filesystem { return _Result; } - // FUNCTION is_fifo _NODISCARD inline bool is_fifo(const path&) noexcept /* strengthened */ { // tests whether the input path is a fifo (never on Windows) return false; @@ -3572,7 +3540,6 @@ namespace filesystem { return false; // note status sets _Ec to an error on nonexistent input } - // FUNCTION is_other _NODISCARD inline bool is_other(const path& _Path) { // tests whether _Path is an other file (such as a junction) return _STD filesystem::is_other(_STD filesystem::status(_Path)); } @@ -3582,7 +3549,6 @@ namespace filesystem { return _STD filesystem::is_other(_STD filesystem::status(_Path, _Ec)); } - // FUNCTION is_regular_file _NODISCARD inline bool is_regular_file(const path& _Path) { // tests whether _Path is a regular file return _STD filesystem::is_regular_file(_STD filesystem::status(_Path)); } @@ -3592,7 +3558,6 @@ namespace filesystem { return _STD filesystem::is_regular_file(_STD filesystem::status(_Path, _Ec)); } - // FUNCTION is_socket _NODISCARD inline bool is_socket(const path&) noexcept /* strengthened */ { // tests whether the input path is a socket (never on Windows) return false; @@ -3604,7 +3569,6 @@ namespace filesystem { return false; // note status sets _Ec to an error on nonexistent input } - // FUNCTION is_symlink _NODISCARD inline bool is_symlink(const path& _Path) { // tests whether _Path is a symlink return _STD filesystem::is_symlink(_STD filesystem::symlink_status(_Path)); } @@ -3613,7 +3577,6 @@ namespace filesystem { return _STD filesystem::is_symlink(_STD filesystem::symlink_status(_Path, _Ec)); } - // FUNCTION remove inline bool remove(const path& _Target) { // remove file _Target (even if it is a directory); returns whether the file was removed // note !exists(_Target) is not an error, and merely returns false @@ -3633,7 +3596,6 @@ namespace filesystem { return _Result._Removed; } - // FUNCTION rename inline void rename(const path& _Old_p, const path& _New_p) { // rename _Old_p to _New_p, overwriting _New_p if it is an existing non-directory file // the standard explicitly allows an implementation to not replace _New_p if it is a directory, @@ -3651,7 +3613,6 @@ namespace filesystem { _Ec = _Make_ec(__std_fs_rename(_Old_p.c_str(), _New_p.c_str())); } - // FUNCTION resize_file inline void resize_file(const path& _Target, const uintmax_t _New_size) { // set the size of _Target to _New_size const auto _Err = __std_fs_resize_file(_Target.c_str(), _New_size); @@ -3665,7 +3626,6 @@ namespace filesystem { _Ec = _Make_ec(__std_fs_resize_file(_Target.c_str(), _New_size)); } - // FUNCTION space struct space_info { uintmax_t capacity; uintmax_t free; @@ -3694,12 +3654,10 @@ namespace filesystem { return _Result; } - // FUNCTION status_known _NODISCARD inline bool status_known(const file_status _Status) noexcept { return _Status.type() != file_type::none; } - // FUNCTION status _NODISCARD inline _File_status_and_error _Get_any_status( const path& _Path, const __std_fs_stats_flags _Flags) noexcept { _File_status_and_error _Result; @@ -3726,7 +3684,6 @@ namespace filesystem { return _Result._Status; } - // FUNCTION symlink_status _NODISCARD inline file_status symlink_status(const path& _Path, error_code& _Ec) noexcept { const auto _Result = _Get_any_status(_Path, _Symlink_status_stats_flags); _Ec = _Make_ec(_Result._Error); @@ -3742,7 +3699,6 @@ namespace filesystem { return _Result._Status; } - // FUNCTION create_directory inline bool create_directory(const path& _Path) { const auto _Result = __std_fs_create_directory(_Path.c_str()); if (_Result._Error != __std_win_error::_Success) { @@ -3773,7 +3729,6 @@ namespace filesystem { return _Result._Created; } - // FUNCTION create_directories inline bool create_directories(const path& _Path, error_code& _Ec) { if (_Path.empty()) { _Ec = _Make_ec(__std_win_error::_Path_not_found); @@ -3844,7 +3799,6 @@ namespace filesystem { return _Result; } - // FUNCTION remove_all inline constexpr int _Remove_all_retry_count = 10; inline void _Remove_all_dir(const path& _Path, error_code& _Ec, uintmax_t& _Removed_count) { @@ -3921,7 +3875,6 @@ namespace filesystem { return _Removed_count; } - // FUNCTION last_write_time _NODISCARD inline __std_win_error _Last_write_time(const path& _Path, file_time_type& _Result) noexcept { __std_fs_stats _Stats; const auto _Error = __std_fs_get_stats( @@ -3964,7 +3917,6 @@ namespace filesystem { _Ec = _Make_ec(__std_fs_set_last_write_time(_New_time.time_since_epoch().count(), _Target.c_str())); } - // FUNCTION permissions enum class perm_options { replace = 0x1, add = 0x2, remove = 0x4, nofollow = 0x8 }; _BITMASK_OPS(perm_options) @@ -4023,7 +3975,6 @@ namespace filesystem { _STD filesystem::permissions(_Target, _Perms, perm_options::replace, _Ec); } - // FUNCTION temp_directory_path _NODISCARD inline path temp_directory_path(error_code& _Ec) { // get a location suitable for temporary storage, and verify that it is a directory _Ec.clear(); // for exception safety @@ -4050,7 +4001,6 @@ namespace filesystem { return _Result; } - // FUNCTION current_path _NODISCARD inline __std_win_error _Current_path(path& _Result) noexcept { _Result._Text.resize(__std_fs_max_path); for (;;) { @@ -4090,7 +4040,6 @@ namespace filesystem { } } - // FUNCTION weakly_canonical _NODISCARD inline path weakly_canonical(const path& _Input, error_code& _Ec) { // eventually calls GetFinalPathNameByHandleW _Ec.clear(); // for exception safety @@ -4153,7 +4102,6 @@ namespace filesystem { return _Result; } - // FUNCTION proximate _NODISCARD inline path proximate(const path& _Path, const path& _Base = _STD filesystem::current_path()) { // eventually calls GetFinalPathNameByHandleW const path _Weakly_canonical_path = _STD filesystem::weakly_canonical(_Path); @@ -4189,7 +4137,6 @@ namespace filesystem { return _STD filesystem::proximate(_Path, _Base, _Ec); } - // FUNCTION relative _NODISCARD inline path relative(const path& _Path, const path& _Base = _STD filesystem::current_path()) { // eventually calls GetFinalPathNameByHandleW const path _Weakly_canonical_path = _STD filesystem::weakly_canonical(_Path); @@ -4225,7 +4172,6 @@ namespace filesystem { return _STD filesystem::relative(_Path, _Base, _Ec); } - // FUNCTION copy inline void _Copy_impl( const directory_entry& _From, const path& _To, const copy_options _Options, error_code& _Ec) { // implement copy, does not clear _Ec for callers diff --git a/stl/inc/forward_list b/stl/inc/forward_list index de12a3dc08c..1049739bc1f 100644 --- a/stl/inc/forward_list +++ b/stl/inc/forward_list @@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE _Flist_unchecked_const_iterator template class _Flist_unchecked_const_iterator : public _Base { public: @@ -82,7 +81,6 @@ public: _Nodeptr _Ptr; // pointer to node }; -// CLASS TEMPLATE _Flist_unchecked_iterator template class _Flist_unchecked_iterator : public _Flist_unchecked_const_iterator<_Mylist> { public: @@ -117,7 +115,6 @@ public: } }; -// CLASS TEMPLATE _Flist_const_iterator template class _Flist_const_iterator : public _Flist_unchecked_const_iterator<_Mylist, _Iterator_base> { public: @@ -189,7 +186,6 @@ public: } }; -// CLASS TEMPLATE _Flist_iterator template class _Flist_iterator : public _Flist_const_iterator<_Mylist> { public: @@ -230,7 +226,6 @@ public: } }; -// forward_list TYPE WRAPPERS template struct _Flist_iter_types { @@ -266,7 +261,6 @@ struct _Flist_simple_types : _Simple_types<_Ty> { using _Nodeptr = _Node*; }; -// CLASS TEMPLATE _Flist_val template class _Flist_val : public _Container_base { public: @@ -512,7 +506,6 @@ private: pointer _Head; // Points at the first constructed node. }; -// CLASS TEMPLATE forward_list template > class forward_list { // singly linked list private: diff --git a/stl/inc/fstream b/stl/inc/fstream index 7a5b704cfff..37df70a0e5c 100644 --- a/stl/inc/fstream +++ b/stl/inc/fstream @@ -67,7 +67,6 @@ extern _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const wchar_t*, ios_b extern _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const unsigned short*, ios_base::openmode, int); #endif // _NATIVE_WCHAR_T_DEFINED -// FUNCTION TEMPLATE _Fgetc template bool _Fgetc(_Elem& _Ch, FILE* _File) { // get an element from a C stream return _CSTD fread(&_Ch, sizeof(_Elem), 1, _File) == 1; @@ -108,7 +107,6 @@ inline bool _Fgetc(unsigned short& _Wchar, FILE* _File) { // get an unsigned sho } #endif // _NATIVE_WCHAR_T_DEFINED -// FUNCTION TEMPLATE _Fputc template bool _Fputc(_Elem _Ch, FILE* _File) { // put an element to a C stream return _CSTD fwrite(&_Ch, 1, sizeof(_Elem), _File) == sizeof(_Elem); @@ -131,7 +129,6 @@ inline bool _Fputc(unsigned short _Wchar, FILE* _File) { // put an unsigned shor } #endif // _NATIVE_WCHAR_T_DEFINED -// FUNCTION TEMPLATE _Ungetc template bool _Ungetc(const _Elem&, FILE*) { // put back an arbitrary element to a C stream (always fail) return false; @@ -164,7 +161,6 @@ inline bool _Ungetc(const unsigned short& _Wchar, FILE* _File) { // put back an } #endif // _NATIVE_WCHAR_T_DEFINED -// CLASS TEMPLATE basic_filebuf template class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer associated with a C stream public: @@ -806,7 +802,6 @@ void swap(basic_filebuf<_Elem, _Traits>& _Left, basic_filebuf<_Elem, _Traits>& _ _Left.swap(_Right); } -// CLASS TEMPLATE basic_ifstream template class basic_ifstream : public basic_istream<_Elem, _Traits> { // input stream associated with a C stream public: @@ -991,7 +986,6 @@ void swap(basic_ifstream<_Elem, _Traits>& _Left, basic_ifstream<_Elem, _Traits>& _Left.swap(_Right); } -// CLASS TEMPLATE basic_ofstream template class basic_ofstream : public basic_ostream<_Elem, _Traits> { // output stream associated with a C stream public: @@ -1175,7 +1169,6 @@ void swap(basic_ofstream<_Elem, _Traits>& _Left, basic_ofstream<_Elem, _Traits>& _Left.swap(_Right); } -// CLASS TEMPLATE basic_fstream template class basic_fstream : public basic_iostream<_Elem, _Traits> { // input/output stream associated with a C stream public: diff --git a/stl/inc/functional b/stl/inc/functional index dc2a4f7df86..82d8901434f 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -29,16 +29,8 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// STRUCT TEMPLATE plus -// defined in +// plus, minus, and multiplies are defined in -// STRUCT TEMPLATE minus -// defined in - -// STRUCT TEMPLATE multiplies -// defined in - -// STRUCT TEMPLATE divides template struct divides { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME; @@ -50,7 +42,6 @@ struct divides { } }; -// STRUCT TEMPLATE modulus template struct modulus { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME; @@ -62,7 +53,6 @@ struct modulus { } }; -// STRUCT TEMPLATE negate template struct negate { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _ARGUMENT_TYPE_NAME; @@ -73,25 +63,8 @@ struct negate { } }; -// STRUCT TEMPLATE equal_to -// defined in - -// STRUCT TEMPLATE not_equal_to -// defined in - -// STRUCT TEMPLATE greater -// defined in +// equal_to, not_equal_to, greater, less, greater_equal, and less_equal are defined in -// STRUCT TEMPLATE less -// defined in - -// STRUCT TEMPLATE greater_equal -// defined in - -// STRUCT TEMPLATE less_equal -// defined in - -// STRUCT TEMPLATE logical_and template struct logical_and { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME; @@ -103,7 +76,6 @@ struct logical_and { } }; -// STRUCT TEMPLATE logical_or template struct logical_or { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME; @@ -115,7 +87,6 @@ struct logical_or { } }; -// STRUCT TEMPLATE logical_not template struct logical_not { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _ARGUMENT_TYPE_NAME; @@ -126,7 +97,6 @@ struct logical_not { } }; -// STRUCT TEMPLATE bit_and template struct bit_and { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME; @@ -138,7 +108,6 @@ struct bit_and { } }; -// STRUCT TEMPLATE bit_or template struct bit_or { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME; @@ -150,7 +119,6 @@ struct bit_or { } }; -// STRUCT TEMPLATE bit_xor template struct bit_xor { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME; @@ -162,7 +130,6 @@ struct bit_xor { } }; -// STRUCT TEMPLATE bit_not template struct bit_not { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _ARGUMENT_TYPE_NAME; @@ -173,16 +140,8 @@ struct bit_not { } }; -// STRUCT TEMPLATE SPECIALIZATION plus -// defined in - -// STRUCT TEMPLATE SPECIALIZATION minus -// defined in +// void specializations of plus, minus, and multiplies are defined in -// STRUCT TEMPLATE SPECIALIZATION multiplies -// defined in - -// STRUCT TEMPLATE SPECIALIZATION divides template <> struct divides { template @@ -194,7 +153,6 @@ struct divides { using is_transparent = int; }; -// STRUCT TEMPLATE SPECIALIZATION modulus template <> struct modulus { template @@ -206,7 +164,6 @@ struct modulus { using is_transparent = int; }; -// STRUCT TEMPLATE SPECIALIZATION negate template <> struct negate { template @@ -217,25 +174,8 @@ struct negate { using is_transparent = int; }; -// STRUCT TEMPLATE SPECIALIZATION equal_to -// defined in - -// STRUCT TEMPLATE SPECIALIZATION not_equal_to -// defined in - -// STRUCT TEMPLATE SPECIALIZATION greater -// defined in - -// STRUCT TEMPLATE SPECIALIZATION less -// defined in +// void specializations of equal_to, not_equal_to, greater, less, greater_equal, and less_equal are defined in -// STRUCT TEMPLATE SPECIALIZATION greater_equal -// defined in - -// STRUCT TEMPLATE SPECIALIZATION less_equal -// defined in - -// STRUCT TEMPLATE SPECIALIZATION logical_and template <> struct logical_and { template @@ -247,7 +187,6 @@ struct logical_and { using is_transparent = int; }; -// STRUCT TEMPLATE SPECIALIZATION logical_or template <> struct logical_or { template @@ -259,7 +198,6 @@ struct logical_or { using is_transparent = int; }; -// STRUCT TEMPLATE SPECIALIZATION logical_not template <> struct logical_not { template @@ -270,7 +208,6 @@ struct logical_not { using is_transparent = int; }; -// STRUCT TEMPLATE SPECIALIZATION bit_and template <> struct bit_and { template @@ -282,7 +219,6 @@ struct bit_and { using is_transparent = int; }; -// STRUCT TEMPLATE SPECIALIZATION bit_or template <> struct bit_or { template @@ -294,7 +230,6 @@ struct bit_or { using is_transparent = int; }; -// STRUCT TEMPLATE SPECIALIZATION bit_xor template <> struct bit_xor { template @@ -306,7 +241,6 @@ struct bit_xor { using is_transparent = int; }; -// STRUCT TEMPLATE SPECIALIZATION bit_not template <> struct bit_not { template @@ -319,7 +253,6 @@ struct bit_not { #if _HAS_DEPRECATED_NEGATORS _STL_DISABLE_DEPRECATED_WARNING -// CLASS TEMPLATE unary_negate template class _CXX17_DEPRECATE_NEGATORS unary_negate { public: @@ -336,13 +269,11 @@ private: _Fn _Functor; }; -// FUNCTION TEMPLATE not1 template _CXX17_DEPRECATE_NEGATORS _NODISCARD constexpr unary_negate<_Fn> not1(const _Fn& _Func) { return unary_negate<_Fn>(_Func); } -// CLASS TEMPLATE binary_negate template class _CXX17_DEPRECATE_NEGATORS binary_negate { public: @@ -360,7 +291,6 @@ private: _Fn _Functor; }; -// FUNCTION TEMPLATE not2 template _CXX17_DEPRECATE_NEGATORS _NODISCARD constexpr binary_negate<_Fn> not2(const _Fn& _Func) { return binary_negate<_Fn>(_Func); @@ -370,7 +300,6 @@ _STL_RESTORE_DEPRECATED_WARNING #if _HAS_AUTO_PTR_ETC _STL_DISABLE_DEPRECATED_WARNING -// CLASS TEMPLATE binder1st template class binder1st : public unary_function { // functor adapter _Func(stored, right) @@ -394,14 +323,12 @@ protected: typename _Fn::first_argument_type value; // the left operand }; -// FUNCTION TEMPLATE bind1st template _NODISCARD binder1st<_Fn> bind1st(const _Fn& _Func, const _Ty& _Left) { typename _Fn::first_argument_type _Val(_Left); return binder1st<_Fn>(_Func, _Val); } -// CLASS TEMPLATE binder2nd template class binder2nd : public unary_function { // functor adapter _Func(left, stored) @@ -425,7 +352,6 @@ protected: typename _Fn::second_argument_type value; // the right operand }; -// FUNCTION TEMPLATE bind2nd template _NODISCARD binder2nd<_Fn> bind2nd(const _Fn& _Func, const _Ty& _Right) { typename _Fn::second_argument_type _Val(_Right); @@ -433,7 +359,6 @@ _NODISCARD binder2nd<_Fn> bind2nd(const _Fn& _Func, const _Ty& _Right) { } _STL_RESTORE_DEPRECATED_WARNING -// CLASS TEMPLATE pointer_to_unary_function template class pointer_to_unary_function : public unary_function<_Arg, _Result> { // functor adapter (*pfunc)(left) public: @@ -447,7 +372,6 @@ protected: _Fn _Pfun; // the function pointer }; -// CLASS TEMPLATE pointer_to_binary_function template class pointer_to_binary_function : public binary_function<_Arg1, _Arg2, _Result> { // functor adapter (*pfunc)(left, right) @@ -462,7 +386,6 @@ protected: _Fn _Pfun; // the function pointer }; -// FUNCTION TEMPLATE ptr_fun #define _PTR_FUN(CALL_OPT, X1, X2, X3) \ template \ _NODISCARD pointer_to_unary_function<_Arg, _Result, _Result(CALL_OPT*)(_Arg)> ptr_fun( \ @@ -478,7 +401,6 @@ protected: _NON_MEMBER_CALL(_PTR_FUN, X1, X2, X3) #undef _PTR_FUN -// CLASS TEMPLATE mem_fun_t template class mem_fun_t : public unary_function<_Ty*, _Result> { // functor adapter (*p->*pfunc)(), non-const *pfunc public: @@ -492,7 +414,6 @@ private: _Result (_Ty::*_Pmemfun)(); // the member function pointer }; -// CLASS TEMPLATE mem_fun1_t template class mem_fun1_t : public binary_function<_Ty*, _Arg, _Result> { // functor adapter (*p->*pfunc)(val), non-const *pfunc public: @@ -506,7 +427,6 @@ private: _Result (_Ty::*_Pmemfun)(_Arg); // the member function pointer }; -// CLASS TEMPLATE const_mem_fun_t template class const_mem_fun_t : public unary_function { // functor adapter (*p->*pfunc)(), const *pfunc public: @@ -520,7 +440,6 @@ private: _Result (_Ty::*_Pmemfun)() const; // the member function pointer }; -// CLASS TEMPLATE const_mem_fun1_t template class const_mem_fun1_t : public binary_function { // functor adapter (*p->*pfunc)(val), const *pfunc @@ -535,7 +454,6 @@ private: _Result (_Ty::*_Pmemfun)(_Arg) const; // the member function pointer }; -// FUNCTION TEMPLATE mem_fun template _NODISCARD mem_fun_t<_Result, _Ty> mem_fun(_Result (_Ty::*_Pm)()) { return mem_fun_t<_Result, _Ty>(_Pm); @@ -556,7 +474,6 @@ _NODISCARD const_mem_fun1_t<_Result, _Ty, _Arg> mem_fun(_Result (_Ty::*_Pm)(_Arg return const_mem_fun1_t<_Result, _Ty, _Arg>(_Pm); } -// CLASS TEMPLATE mem_fun_ref_t template class mem_fun_ref_t : public unary_function<_Ty, _Result> { // functor adapter (*left.*pfunc)(), non-const *pfunc public: @@ -570,7 +487,6 @@ private: _Result (_Ty::*_Pmemfun)(); // the member function pointer }; -// CLASS TEMPLATE mem_fun1_ref_t template class mem_fun1_ref_t : public binary_function<_Ty, _Arg, _Result> { // functor adapter (*left.*pfunc)(val), non-const *pfunc @@ -585,7 +501,6 @@ private: _Result (_Ty::*_Pmemfun)(_Arg); // the member function pointer }; -// CLASS TEMPLATE const_mem_fun_ref_t template class const_mem_fun_ref_t : public unary_function<_Ty, _Result> { // functor adapter (*left.*pfunc)(), const *pfunc public: @@ -599,7 +514,6 @@ private: _Result (_Ty::*_Pmemfun)() const; // the member function pointer }; -// CLASS TEMPLATE const_mem_fun1_ref_t template class const_mem_fun1_ref_t : public binary_function<_Ty, _Arg, _Result> { // functor adapter (*left.*pfunc)(val), const *pfunc @@ -614,7 +528,6 @@ private: _Result (_Ty::*_Pmemfun)(_Arg) const; // the member function pointer }; -// FUNCTION TEMPLATE mem_fun_ref template _NODISCARD mem_fun_ref_t<_Result, _Ty> mem_fun_ref(_Result (_Ty::*_Pm)()) { return mem_fun_ref_t<_Result, _Ty>(_Pm); @@ -636,7 +549,6 @@ _NODISCARD const_mem_fun1_ref_t<_Result, _Ty, _Arg> mem_fun_ref(_Result (_Ty::*_ } #endif // _HAS_AUTO_PTR_ETC -// FUNCTION TEMPLATE mem_fn template class _Mem_fn : public _Weak_types<_Memptr> { private: @@ -659,7 +571,6 @@ _NODISCARD _CONSTEXPR20 _Mem_fn<_Rx _Ty::*> mem_fn(_Rx _Ty::*_Pm) noexcept { } #if _HAS_CXX17 -// FUNCTION TEMPLATE not_fn struct _Not_fn_tag { explicit _Not_fn_tag() = default; }; @@ -715,9 +626,6 @@ _NODISCARD _CONSTEXPR20 _Not_fn> not_fn(_Callable&& _Obj) noe } #endif // _HAS_CXX17 -// IMPLEMENT function - -// CLASS bad_function_call class bad_function_call : public exception { // exception thrown when an empty std::function is called public: bad_function_call() noexcept {} @@ -734,7 +642,6 @@ struct _Unforced { // tag to distinguish bind() from bind() explicit _Unforced() = default; }; -// STRUCT TEMPLATE _Invoker_ret // helper to give INVOKE an explicit return type; avoids undesirable Expression SFINAE template > struct _Invoker_ret { // selected for _Rx being cv void @@ -764,7 +671,6 @@ struct _Invoker_ret<_Unforced, false> { // selected for _Rx being _Unforced } }; -// FUNCTION TEMPLATE _Test_callable template class function; @@ -781,7 +687,6 @@ bool _Test_callable(const _Ty& _Arg) noexcept { // determine whether std::functi } } -// CLASS TEMPLATE _Func_base template class __declspec(novtable) _Func_base { // abstract base for implementation types public: @@ -806,7 +711,6 @@ private: virtual const void* _Get() const noexcept = 0; }; -// ALIAS TEMPLATE _Is_large constexpr size_t _Space_size = (_Small_object_num_ptrs - 1) * sizeof(void*); template // determine whether _Impl must be dynamically allocated @@ -814,7 +718,6 @@ _INLINE_VAR constexpr bool _Is_large = sizeof(_Impl) > _Space_size || alignof(_I || !_Impl::_Nothrow_move::value; #if _HAS_FUNCTION_ALLOCATOR_SUPPORT -// CLASS TEMPLATE _Func_impl template class _Func_impl final : public _Func_base<_Rx, _Types...> { // derived class for specific implementation types that use allocators @@ -884,7 +787,6 @@ private: }; #endif // _HAS_FUNCTION_ALLOCATOR_SUPPORT -// CLASS TEMPLATE _Func_impl_no_alloc template class _Func_impl_no_alloc final : public _Func_base<_Rx, _Types...> { // derived class for specific implementation types that don't use allocators @@ -948,7 +850,6 @@ private: #define _USE_FUNCTION_INT_0_SFINAE 1 #endif // __CUDACC__ -// CLASS TEMPLATE _Func_class template class _Func_class : public _Arg_types<_Types...> { public: @@ -1093,7 +994,6 @@ private: } }; -// STRUCT TEMPLATE _Get_function_impl template struct _Get_function_impl { static_assert(_Always_false<_Tx>, "std::function does not accept non-function types as template arguments."); @@ -1119,7 +1019,6 @@ _NON_MEMBER_CALL(_GET_FUNCTION_IMPL_NOEXCEPT, X1, X2, X3) #undef _GET_FUNCTION_IMPL_NOEXCEPT #endif // __cpp_noexcept_function_type -// CLASS TEMPLATE function template class function : public _Get_function_impl<_Fty>::type { // wrapper for callable objects private: @@ -1259,7 +1158,6 @@ public: _NON_MEMBER_CALL(_FUNCTION_POINTER_DEDUCTION_GUIDE, X1, X2, X3) #undef _FUNCTION_POINTER_DEDUCTION_GUIDE -// STRUCT TEMPLATE _Deduce_signature template struct _Deduce_signature {}; // can't deduce signature when &_Fx::operator() is missing, inaccessible, or ambiguous @@ -1298,7 +1196,6 @@ _NODISCARD bool operator!=(nullptr_t, const function<_Fty>& _Other) noexcept { } #endif // !_HAS_CXX20 -// PLACEHOLDERS template struct _Ph { // placeholder static_assert(_Nx > 0, "invalid placeholder index"); @@ -1322,11 +1219,9 @@ struct is_placeholder : is_placeholder<_Tx>::type {}; // ign template _INLINE_VAR constexpr int is_placeholder_v = is_placeholder<_Ty>::value; -// CLASS TEMPLATE _Binder FORWARD DECLARATION template class _Binder; -// STRUCT TEMPLATE is_bind_expression template struct is_bind_expression : false_type {}; // _Tx is not a bind expression @@ -1345,7 +1240,6 @@ struct is_bind_expression : is_bind_expression<_Tx>::type {} template _INLINE_VAR constexpr bool is_bind_expression_v = is_bind_expression<_Ty>::value; -// FUNCTION TEMPLATE _Fix_arg template , reference_wrapper>, bool = is_bind_expression_v<_Cv_TiD>, int = is_placeholder_v<_Cv_TiD>> struct _Select_fixer; @@ -1404,7 +1298,6 @@ constexpr auto _Fix_arg(_Cv_TiD& _Tid, _Untuple&& _Ut) noexcept( return _Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut)); } -// FUNCTION TEMPLATE _Call_binder template _CONSTEXPR20 auto _Call_binder(_Invoker_ret<_Ret>, index_sequence<_Ix...>, _Cv_FD& _Obj, _Cv_tuple_TiD& _Tpl, _Untuple&& _Ut) noexcept(noexcept(_Invoker_ret<_Ret>::_Call(_Obj, @@ -1414,7 +1307,6 @@ _CONSTEXPR20 auto _Call_binder(_Invoker_ret<_Ret>, index_sequence<_Ix...>, _Cv_F return _Invoker_ret<_Ret>::_Call(_Obj, _Fix_arg(_STD get<_Ix>(_Tpl), _STD move(_Ut))...); } -// CLASS TEMPLATE _Binder template struct _Forced_result_type { // used by bind() _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ret _RESULT_TYPE_NAME; @@ -1461,19 +1353,16 @@ public: #undef _CALL_BINDER }; -// FUNCTION TEMPLATE bind (implicit return type) template _NODISCARD _CONSTEXPR20 _Binder<_Unforced, _Fx, _Types...> bind(_Fx&& _Func, _Types&&... _Args) { return _Binder<_Unforced, _Fx, _Types...>(_STD forward<_Fx>(_Func), _STD forward<_Types>(_Args)...); } -// FUNCTION TEMPLATE bind (explicit return type) template _NODISCARD _CONSTEXPR20 _Binder<_Ret, _Fx, _Types...> bind(_Fx&& _Func, _Types&&... _Args) { return _Binder<_Ret, _Fx, _Types...>(_STD forward<_Fx>(_Func), _STD forward<_Types>(_Args)...); } -// PLACEHOLDER ARGUMENTS namespace placeholders { _INLINE_VAR constexpr _Ph<1> _1{}; _INLINE_VAR constexpr _Ph<2> _2{}; @@ -1498,7 +1387,6 @@ namespace placeholders { } // namespace placeholders #if _HAS_CXX20 -// FUNCTION TEMPLATE _Call_front_binder template constexpr auto _Call_front_binder(index_sequence<_Ix...>, _Cv_FD&& _Obj, _Cv_tuple_TiD&& _Tpl, _Unbound&&... _Unbargs) noexcept(noexcept(_STD invoke(_STD forward<_Cv_FD>(_Obj), @@ -1509,7 +1397,6 @@ constexpr auto _Call_front_binder(index_sequence<_Ix...>, _Cv_FD&& _Obj, _Cv_tup _STD forward<_Unbound>(_Unbargs)...); } -// CLASS TEMPLATE _Front_binder template class _Front_binder { // wrap bound callable object and arguments private: @@ -1561,7 +1448,6 @@ public: } }; -// FUNCTION TEMPLATE bind_front template _NODISCARD constexpr auto bind_front(_Fx&& _Func, _Types&&... _Args) { static_assert(is_constructible_v, _Fx>, @@ -1578,13 +1464,11 @@ _NODISCARD constexpr auto bind_front(_Fx&& _Func, _Types&&... _Args) { #endif // _HAS_CXX20 #if _HAS_FUNCTION_ALLOCATOR_SUPPORT -// STRUCT TEMPLATE uses_allocator template struct uses_allocator, _Alloc> : true_type {}; // true_type if container allocator enabled #endif // _HAS_FUNCTION_ALLOCATOR_SUPPORT #if _HAS_CXX17 -// HETEROGENEOUS MEMORY BLOCK UTILITIES inline void _Add_alloc_size(size_t& _Size, const size_t _Size_added, const size_t _Alignment) { // moves _Size up to account for storing an object of size _Size_added with alignment _Alignment in a memory buffer // assumes that the memory buffer will be allocated for the "worst" alignment used in the resulting buffer @@ -1626,14 +1510,12 @@ _Ty* _Decode_aligned_block(void*& _Base, const size_t _Count) { return static_cast<_Ty*>(_Decode_aligned_block(_Base, sizeof(_Ty) * _Count, alignof(_Ty))); } -// STRUCT _Global_delete struct _Global_delete { void operator()(void* const _Ptr) const { ::operator delete(_Ptr); } }; -// CLASS TEMPLATE default_searcher template _CONSTEXPR20 pair<_FwdItHaystack, _FwdItHaystack> _Search_pair_unchecked(_FwdItHaystack _First1, _FwdItHaystack _Last1, _FwdItPat _First2, _FwdItPat _Last2, _Pred_eq& _Eq, forward_iterator_tag, forward_iterator_tag) { @@ -1709,7 +1591,6 @@ private: }; -// STRUCT TEMPLATE _Boyer_moore_hash_delta_1_table template struct _Boyer_moore_hash_delta_1_table { // stores the Boyer-Moore delta_1 table using a hash table using _Value_t = _Iter_value_t<_RanItPat>; @@ -1746,7 +1627,6 @@ private: }; -// STRUCT TEMPLATE _Boyer_moore_flat_delta_1_table template _Limit> struct _Boyer_moore_flat_delta_1_table { // stores the Boyer-Moore delta_1 table using a plain array lookup using _Value_t = _Iter_value_t<_RanItPat>; @@ -1782,7 +1662,6 @@ private: }; -// FUNCTION TEMPLATE _Build_boyer_moore_delta_2_table template void _Build_boyer_moore_delta_2_table(_Iter_diff_t<_RanItPat>* const _Shifts, const _RanItPat _Pat_first, const _Iter_diff_t<_RanItPat> _Pat_size, _Pred_eq& _Eq) { @@ -1844,7 +1723,6 @@ void _Build_boyer_moore_delta_2_table(_Iter_diff_t<_RanItPat>* const _Shifts, co } -// FUNCTION TEMPLATE _Boyer_moore_search template pair<_RanItHaystack, _RanItHaystack> _Boyer_moore_search( const _Delta1_t& _Delta1, typename _Delta1_t::_Diff* _Delta2, _RanItHaystack _First, _RanItHaystack _Last) { @@ -1887,7 +1765,6 @@ pair<_RanItHaystack, _RanItHaystack> _Boyer_moore_search( } -// FUNCTION TEMPLATE _Boyer_moore_horspool_search template pair<_RanItHaystack, _RanItHaystack> _Boyer_moore_horspool_search( const _Delta1_t& _Delta1, _RanItHaystack _First, _RanItHaystack _Last) { @@ -1926,7 +1803,6 @@ pair<_RanItHaystack, _RanItHaystack> _Boyer_moore_horspool_search( } -// STRUCT AND ALIAS TEMPLATES _Boyer_moore_traits template struct _Single_delta1_type_boyer_moore_traits { using _Diff = _Iter_diff_t<_RanItPat>; @@ -2133,7 +2009,6 @@ using _Boyer_moore_traits = _Boyer_moore_traits_general_mode<_RanItPat, _Hash_ty, _Pred_eq>>; -// CLASS TEMPLATE boyer_moore_searcher template >, class _Pred_eq = equal_to<>> class boyer_moore_searcher { public: @@ -2173,7 +2048,6 @@ private: }; -// CLASS TEMPLATE boyer_moore_horspool_searcher template >, class _Pred_eq = equal_to<>> class boyer_moore_horspool_searcher { // equivalent to Boyer-Moore without the second table public: @@ -2215,7 +2089,6 @@ private: #ifdef __cpp_lib_concepts namespace ranges { - // STRUCT ranges::not_equal_to struct not_equal_to { // clang-format off template @@ -2229,7 +2102,6 @@ namespace ranges { using is_transparent = int; }; - // STRUCT ranges::greater_equal struct greater_equal { // clang-format off template @@ -2243,7 +2115,6 @@ namespace ranges { using is_transparent = int; }; - // STRUCT ranges::less_equal struct less_equal { // clang-format off template diff --git a/stl/inc/future b/stl/inc/future index b14aa5b44fe..622f3f46ace 100644 --- a/stl/inc/future +++ b/stl/inc/future @@ -35,7 +35,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// FUNCTION TEMPLATE _Make_unique_alloc template struct _Allocator_deleter { _Alloc _Al; @@ -59,10 +58,8 @@ _NODISCARD _Unique_ptr_alloc<_Alloc> _Make_unique_alloc(_Alloc& _Al, _Args&&... return _Unique_ptr_alloc<_Alloc>(_Constructor._Release(), _Allocator_deleter<_Alloc>{_Al}); } -// STRUCT _Nil struct _Nil {}; // empty struct, for unused argument types -// ENUM future_errc enum class future_errc { // names for futures errors broken_promise = 1, future_already_retrieved, @@ -70,7 +67,6 @@ enum class future_errc { // names for futures errors no_state }; -// ENUM launch enum class launch { // names for launch options passed to async async = 0x1, deferred = 0x2 @@ -78,18 +74,15 @@ enum class launch { // names for launch options passed to async _BITMASK_OPS(launch) -// ENUM future_status enum class future_status { // names for timed wait function returns ready, timeout, deferred }; -// HELPER FUNCTIONS [[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Throw_future_error(const error_code& _Code); [[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Rethrow_future_exception(exception_ptr _Ptr); -// STRUCT TEMPLATE SPECIALIZATION is_error_code_enum template <> struct is_error_code_enum : true_type {}; @@ -103,7 +96,6 @@ _NODISCARD inline error_condition make_error_condition(future_errc _Errno) noexc return error_condition(static_cast(_Errno), _STD future_category()); } -// CLASS future_error inline const char* _Future_error_map(int _Errcode) noexcept { // convert to name of future error switch (static_cast(_Errcode)) { // switch on error code value case future_errc::broken_promise: @@ -171,7 +163,6 @@ _NODISCARD inline const error_category& future_category() noexcept { return _Immortalize_memcpy_image<_Future_error_category2>(); } -// STRUCT TEMPLATE _State_deleter template class _Associated_state; @@ -193,7 +184,6 @@ struct _State_deleter : _Deleter_base<_Ty> { // manage allocator and deletion st _Alloc _My_alloc; }; -// CLASS TEMPLATE _Associated_state template class _Associated_state { // class for managing associated synchronous state public: @@ -451,7 +441,6 @@ void _State_deleter<_Ty, _Derived, _Alloc>::_Delete( _Delete_plain_internal(_Del_alloc, this); } -// CLASS TEMPLATE _Packaged_state template class _Packaged_state; @@ -648,7 +637,6 @@ _Pack_state* _Make_packaged_state(_Fty2&& _Fnarg, const _Alloc& _Al) { } #endif // _HAS_FUNCTION_ALLOCATOR_SUPPORT -// CLASS TEMPLATE _Deferred_async_state template class _Deferred_async_state : public _Packaged_state<_Rx()> { // class for managing associated synchronous state for deferred execution from async @@ -672,7 +660,6 @@ private: } }; -// CLASS TEMPLATE _Task_async_state template class _Task_async_state : public _Packaged_state<_Rx()> { // class for managing associated synchronous state for asynchronous execution from async @@ -707,7 +694,6 @@ private: ::Concurrency::task _Task; }; -// CLASS TEMPLATE _State_manager template class _State_manager { // class for managing possibly non-existent associated asynchronous state object @@ -867,7 +853,6 @@ private: bool _Get_only_once; }; -// CLASS TEMPLATE future template class shared_future; @@ -971,7 +956,6 @@ public: future& operator=(const future&) = delete; }; -// CLASS TEMPLATE shared_future template class shared_future : public _State_manager<_Ty> { // class that defines a copyable asynchronous return object that holds a value @@ -1070,12 +1054,10 @@ public: } }; -// DEFINITION OF future::share() _NODISCARD inline shared_future future::share() noexcept { return shared_future(_STD move(*this)); } -// CLASS TEMPLATE _Promise template class _Promise { public: @@ -1144,7 +1126,6 @@ private: bool _Future_retrieved; }; -// CLASS TEMPLATE promise template class promise { // class that defines an asynchronous provider that holds a value public: @@ -1326,7 +1307,6 @@ void swap(promise<_Ty>& _Left, promise<_Ty>& _Right) noexcept { _Left.swap(_Right); } -// CLASS TEMPLATE packaged_task template struct _P_arg_type { // type for functions returning T using type = _Fret; @@ -1450,21 +1430,18 @@ void swap(packaged_task<_Ty>& _Left, packaged_task<_Ty>& _Right) noexcept { _Left.swap(_Right); } -// FUNCTION TEMPLATE _Invoke_stored_explicit template auto _Invoke_stored_explicit(tuple<_Types...>&& _Tuple, index_sequence<_Indices...>) -> decltype(_STD invoke( _STD get<_Indices>(_STD move(_Tuple))...)) { // invoke() a tuple with explicit parameter ordering return _STD invoke(_STD get<_Indices>(_STD move(_Tuple))...); } -// FUNCTION TEMPLATE _Invoke_stored template auto _Invoke_stored(tuple<_Types...>&& _Tuple) -> decltype(_Invoke_stored_explicit(_STD move(_Tuple), index_sequence_for<_Types...>{})) { // invoke() a tuple return _Invoke_stored_explicit(_STD move(_Tuple), index_sequence_for<_Types...>{}); } -// FUNCTION TEMPLATE async template class _Fake_no_copy_callable_adapter { // async() is built on packaged_task internals which incorrectly use diff --git a/stl/inc/hash_map b/stl/inc/hash_map index d2fc7b3f49d..d2075b93179 100644 --- a/stl/inc/hash_map +++ b/stl/inc/hash_map @@ -33,7 +33,6 @@ namespace stdext { using _STD _Swap_adl; using _STD _Xout_of_range; - // CLASS TEMPLATE _Hmap_traits template >, class _Alloc = allocator>> class hash_map : public _Hash<_Hmap_traits<_Kty, _Ty, _Tr, _Alloc, false>> { @@ -300,7 +298,6 @@ namespace stdext { return !(_Left == _Right); } - // CLASS TEMPLATE hash_multimap template >, class _Alloc = allocator>> class hash_multimap : public _Hash<_Hmap_traits<_Kty, _Ty, _Tr, _Alloc, true>> { diff --git a/stl/inc/hash_set b/stl/inc/hash_set index 7a3a4214318..850b4f14da3 100644 --- a/stl/inc/hash_set +++ b/stl/inc/hash_set @@ -29,7 +29,6 @@ namespace stdext { using _STD _Is_nothrow_swappable; using _STD _Swap_adl; - // CLASS TEMPLATE _Hset_traits template >, class _Alloc = allocator<_Kty>> class hash_set : public _Hash<_Hset_traits<_Kty, _Tr, _Alloc, false>> { // hash table of key values, unique keys public: @@ -233,7 +231,6 @@ namespace stdext { return !(_Left == _Right); } - // CLASS TEMPLATE hash_multiset template >, class _Alloc = allocator<_Kty>> class hash_multiset : public _Hash<_Hset_traits<_Kty, _Tr, _Alloc, true>> { // hash table of key values, non-unique keys diff --git a/stl/inc/initializer_list b/stl/inc/initializer_list index a692057e2fe..2714f3d3785 100644 --- a/stl/inc/initializer_list +++ b/stl/inc/initializer_list @@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE initializer_list template class initializer_list { public: @@ -52,13 +51,11 @@ private: const _Elem* _Last; }; -// FUNCTION TEMPLATE begin template _NODISCARD constexpr const _Elem* begin(initializer_list<_Elem> _Ilist) noexcept { return _Ilist.begin(); } -// FUNCTION TEMPLATE end template _NODISCARD constexpr const _Elem* end(initializer_list<_Elem> _Ilist) noexcept { return _Ilist.end(); diff --git a/stl/inc/iomanip b/stl/inc/iomanip index 2049d1d3106..47b44fce3d0 100644 --- a/stl/inc/iomanip +++ b/stl/inc/iomanip @@ -21,7 +21,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// STRUCT TEMPLATE _Fillobj template struct _Fillobj { // store fill character _Fillobj(_Elem _Ch) : _Fill(_Ch) {} @@ -29,7 +28,6 @@ struct _Fillobj { // store fill character _Elem _Fill; // the fill character }; -// FUNCTION TEMPLATE setfill template _NODISCARD _Fillobj<_Elem> setfill(_Elem _Ch) { return _Fillobj<_Elem>(_Ch); @@ -53,7 +51,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Ostr; } -// STRUCT TEMPLATE _Monobj template struct _Monobj { // store reference to monetary amount _Monobj(_Money& _Val_arg, bool _Intl_arg) : _Val(_Val_arg), _Intl(_Intl_arg) {} @@ -64,7 +61,6 @@ struct _Monobj { // store reference to monetary amount _Monobj& operator=(const _Monobj&) = delete; }; -// FUNCTION TEMPLATE get_money template _NODISCARD _Monobj<_Money> get_money(_Money& _Val_arg, bool _Intl_arg = false) { return _Monobj<_Money>(_Val_arg, _Intl_arg); @@ -91,7 +87,6 @@ basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, return _Istr; } -// FUNCTION TEMPLATE put_money template _NODISCARD _Monobj put_money(const _Money& _Val_arg, bool _Intl_arg = false) { return _Monobj(_Val_arg, _Intl_arg); @@ -120,7 +115,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Ostr; } -// STRUCT TEMPLATE _Timeobj template struct _Timeobj { // store reference to tm object and format _Timeobj(_Ptr _Tptr_arg, const _Elem* _Fmt_arg) : _Tptr(_Tptr_arg), _Fmtfirst(_Fmt_arg) { @@ -133,7 +127,6 @@ struct _Timeobj { // store reference to tm object and format const _Elem* _Fmtlast; // format string end }; -// FUNCTION TEMPLATE get_time template _NODISCARD _Timeobj<_Elem, tm*> get_time(tm* _Tptr_arg, const _Elem* _Fmt_arg) { return _Timeobj<_Elem, tm*>(_Tptr_arg, _Fmt_arg); @@ -163,7 +156,6 @@ basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, return _Istr; } -// FUNCTION TEMPLATE put_time template _NODISCARD _Timeobj<_Elem, const tm*> put_time(const tm* _Tptr_arg, const _Elem* _Fmt_arg) { return _Timeobj<_Elem, const tm*>(_Tptr_arg, _Fmt_arg); @@ -193,7 +185,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Ostr; } -// STRUCT TEMPLATE _Quote_in template struct _Quote_in { // store reference to string using _Mystr = basic_string<_Elem, _Traits, _Alloc>; @@ -208,7 +199,6 @@ struct _Quote_in { // store reference to string _Quote_in& operator=(const _Quote_in&) = delete; }; -// STRUCT TEMPLATE _Quote_out template struct _Quote_out { // store pointer/length for string _Quote_out(const _Elem* _Ptr_obj, _Sizet _Size_obj, _Elem _Delim_obj, _Elem _Escape_obj) @@ -222,7 +212,6 @@ struct _Quote_out { // store pointer/length for string _Quote_out& operator=(const _Quote_out&) = delete; }; -// FUNCTION TEMPLATE quoted template _NODISCARD _Quote_out<_Elem, void, size_t> quoted( const _Elem* _Ptr, _Elem _Delim = _Elem('"'), _Elem _Escape = _Elem('\\')) { @@ -256,7 +245,6 @@ _NODISCARD _Quote_in<_Elem, _Traits, _Alloc> quoted( return _Quote_in<_Elem, _Traits, _Alloc>(_Str, _Delim, _Escape); } -// quoted INSERTER template basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, const _Quote_out<_Elem, _QuTraits, _Sizet>& _Manip) { // put quoted string to output stream @@ -352,7 +340,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Ostr << _STD quoted(_Ref, _Manip._Delim, _Manip._Escape); } -// quoted EXTRACTOR template basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, const _Quote_in<_Elem, _Traits, _Alloc>& _Manip) { // get quoted string from input stream @@ -400,7 +387,6 @@ basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, return _Istr; } -// STRUCT TEMPLATE _Smanip template struct _Smanip { // store function pointer and argument value _Smanip(void(__cdecl* _Left)(ios_base&, _Arg), _Arg _Val) : _Pfun(_Left), _Manarg(_Val) {} @@ -423,7 +409,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Ostr; } -// INSTANTIATIONS _NODISCARD _MRTIMP2 _Smanip __cdecl resetiosflags(ios_base::fmtflags); _NODISCARD _MRTIMP2 _Smanip __cdecl setiosflags(ios_base::fmtflags); _NODISCARD _MRTIMP2 _Smanip __cdecl setbase(int); diff --git a/stl/inc/ios b/stl/inc/ios index fb85b460508..c2758eb2f2d 100644 --- a/stl/inc/ios +++ b/stl/inc/ios @@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE basic_ios template class basic_ios : public ios_base { // base class for basic_istream/basic_ostream public: @@ -182,7 +181,6 @@ template class _CRTIMP2_PURE_IMPORT basic_ios) +// from using streamoff = long long; using streamsize = long long; -// CLASS TEMPLATE fpos (from ) template class fpos { // store arbitrary file position public: @@ -139,7 +137,6 @@ private: using streampos = fpos<_Mbstatet>; using wstreampos = streampos; -// FORWARD REFERENCES class locale; template const _Facet& __CRTDECL use_facet(const locale&); @@ -218,7 +215,6 @@ template class collate; #endif // defined(_DLL_CPPLIB) -// char TYPEDEFS using ios = basic_ios>; using streambuf = basic_streambuf>; using istream = basic_istream>; @@ -237,7 +233,6 @@ using syncbuf = basic_syncbuf; using osyncstream = basic_osyncstream; #endif // _HAS_CXX20 -// wchar_t TYPEDEFS using wios = basic_ios>; using wstreambuf = basic_streambuf>; using wistream = basic_istream>; @@ -257,7 +252,6 @@ using wosyncstream = basic_osyncstream; #endif // _HAS_CXX20 #if defined(_CRTBLD) -// unsigned short TYPEDEFS using ushistream = basic_istream>; using ushostream = basic_ostream>; using ushfilebuf = basic_filebuf>; diff --git a/stl/inc/iostream b/stl/inc/iostream index 6a19dab8865..e0d0b24171f 100644 --- a/stl/inc/iostream +++ b/stl/inc/iostream @@ -36,7 +36,6 @@ __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcout; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcerr; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wclog; #else // _M_CEE_PURE - // OBJECTS __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT istream cin; __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cout; __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cerr; @@ -55,7 +54,6 @@ __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream* _Ptr_wcout; __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream* _Ptr_wcerr; __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream* _Ptr_wclog; -// CLASS _Winit class _CRTIMP2_PURE_IMPORT _Winit { public: __thiscall _Winit(); diff --git a/stl/inc/istream b/stl/inc/istream index 62b687c23a2..1d6e58bf92c 100644 --- a/stl/inc/istream +++ b/stl/inc/istream @@ -20,7 +20,6 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #pragma vtordisp(push, 2) // compiler bug workaround -// CLASS TEMPLATE basic_istream template class basic_istream : virtual public basic_ios<_Elem, _Traits> { // control extractions from a stream buffer public: @@ -75,7 +74,6 @@ public: using pos_type = typename _Traits::pos_type; using off_type = typename _Traits::off_type; - // CLASS TEMPLATE sentry class _Sentry_base { public: __CLR_OR_THIS_CALL _Sentry_base(basic_istream& _Istr) : _Myistr(_Istr) { @@ -705,7 +703,6 @@ template class _CRTIMP2_PURE_IMPORT basic_istream class basic_iostream : public basic_istream<_Elem, _Traits>, public basic_ostream<_Elem, _Traits> { // control insertions and extractions from a stream buffer @@ -758,8 +755,6 @@ template class _CRTIMP2_PURE_IMPORT basic_iostream basic_istream<_Elem, _Traits>& _Istream_extract_into_buffer( basic_istream<_Elem, _Traits>& _Istr, size_t _Size, _Elem* _Str) { @@ -890,7 +885,6 @@ _Istr&& operator>>(_Istr&& _Is, _Ty&& _Val) { // extract from rvalue stream return _STD move(_Is); } -// MANIPULATORS template basic_istream<_Elem, _Traits>& __CLRCALL_OR_CDECL ws(basic_istream<_Elem, _Traits>& _Istr) { // consume whitespace const typename basic_istream<_Elem, _Traits>::sentry _Ok(_Istr, true); diff --git a/stl/inc/iterator b/stl/inc/iterator index 824b3bb6c5f..a9900a0eced 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -19,7 +19,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE back_insert_iterator template class back_insert_iterator { // wrap pushes to back of container as output iterator public: @@ -65,14 +64,12 @@ protected: _Container* container; }; -// FUNCTION TEMPLATE back_inserter template _NODISCARD _CONSTEXPR20 back_insert_iterator<_Container> back_inserter(_Container& _Cont) noexcept /* strengthened */ { // return a back_insert_iterator return back_insert_iterator<_Container>(_Cont); } -// CLASS TEMPLATE front_insert_iterator template class front_insert_iterator { // wrap pushes to front of container as output iterator public: @@ -118,13 +115,11 @@ protected: _Container* container; }; -// FUNCTION TEMPLATE front_inserter template _NODISCARD _CONSTEXPR20 front_insert_iterator<_Container> front_inserter(_Container& _Cont) { return front_insert_iterator<_Container>(_Cont); } -// CLASS TEMPLATE insert_iterator template class insert_iterator { // wrap inserts into container as output iterator public: @@ -175,14 +170,12 @@ protected: _Wrapped_iter iter; }; -// FUNCTION TEMPLATE inserter template _NODISCARD _CONSTEXPR20 insert_iterator<_Container> inserter(_Container& _Cont, typename _Container::iterator _Where) { return insert_iterator<_Container>(_Cont, _Where); } #ifdef __cpp_lib_concepts -// CLASS TEMPLATE move_sentinel template class move_sentinel { public: @@ -220,7 +213,6 @@ private: }; #endif // __cpp_lib_concepts -// CLASS TEMPLATE istream_iterator template , class _Diff = ptrdiff_t> class istream_iterator { public: @@ -305,7 +297,6 @@ _NODISCARD bool operator!=(const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _ } #endif // !_HAS_CXX20 -// CLASS TEMPLATE ostream_iterator template > class ostream_iterator { public: @@ -351,7 +342,6 @@ private: ostream_type* _Myostr; // pointer to output stream }; -// CLASS TEMPLATE istreambuf_iterator template class istreambuf_iterator { public: @@ -489,7 +479,6 @@ _NODISCARD bool operator!=( } #endif // !_HAS_CXX20 -// CLASS TEMPLATE ostreambuf_iterator template class ostreambuf_iterator { public: @@ -541,7 +530,6 @@ private: }; #ifdef __cpp_lib_concepts -// CLASS TEMPLATE common_iterator enum class _Variantish_state : unsigned char { _Nothing, _Holds_iter, _Holds_sentinel }; struct _Common_iterator_construct_tag { @@ -1039,7 +1027,6 @@ struct iterator_traits> { using reference = iter_reference_t<_Iter>; }; -// CLASS TEMPLATE counted_iterator template struct _Counted_iterator_value_type_base {}; @@ -1372,7 +1359,6 @@ _STDEXT_BEGIN using _STD iterator_traits; using _STD size_t; -// CLASS TEMPLATE checked_array_iterator template class checked_array_iterator { // wrap a pointer with checking static_assert(_STD is_pointer_v<_Ptr>, "checked_array_iterator requires pointers"); @@ -1575,7 +1561,6 @@ _NODISCARD constexpr checked_array_iterator<_Ptr> make_checked_array_iterator( return checked_array_iterator<_Ptr>(_Array, _Size, _Index); } -// CLASS TEMPLATE unchecked_array_iterator template class unchecked_array_iterator { // wrap a pointer without checking, to silence warnings static_assert(_STD is_pointer_v<_Ptr>, "unchecked_array_iterator requires pointers"); diff --git a/stl/inc/limits b/stl/inc/limits index f08f92bf2ac..8e2681fdaab 100644 --- a/stl/inc/limits +++ b/stl/inc/limits @@ -23,14 +23,12 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// ENUM float_denorm_style enum float_denorm_style { // constants for different IEEE float denormalization styles denorm_indeterminate = -1, denorm_absent = 0, denorm_present = 1 }; -// ENUM float_round_style enum float_round_style { // constants for different IEEE rounding styles round_indeterminate = -1, round_toward_zero = 0, @@ -39,7 +37,6 @@ enum float_round_style { // constants for different IEEE rounding styles round_toward_neg_infinity = 3 }; -// STRUCT _Num_base struct _Num_base { // base for all types, with common defaults static constexpr float_denorm_style has_denorm = denorm_absent; static constexpr bool has_denorm_loss = false; @@ -66,7 +63,6 @@ struct _Num_base { // base for all types, with common defaults static constexpr int radix = 0; }; -// CLASS TEMPLATE numeric_limits template class numeric_limits : public _Num_base { // numeric limits for arbitrary type _Ty (say little or nothing) public: @@ -116,7 +112,6 @@ class numeric_limits : public numeric_limits<_Ty> {}; // numeric l template class numeric_limits : public numeric_limits<_Ty> {}; // numeric limits for const volatile types -// STRUCT _Num_int_base struct _Num_int_base : _Num_base { // base for integer types static constexpr bool is_bounded = true; static constexpr bool is_exact = true; @@ -125,7 +120,6 @@ struct _Num_int_base : _Num_base { // base for integer types static constexpr int radix = 2; }; -// STRUCT _Num_float_base struct _Num_float_base : _Num_base { // base for floating-point types static constexpr float_denorm_style has_denorm = denorm_present; static constexpr bool has_infinity = true; @@ -139,7 +133,6 @@ struct _Num_float_base : _Num_base { // base for floating-point types static constexpr int radix = FLT_RADIX; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -182,7 +175,6 @@ public: static constexpr int digits = 1; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -228,7 +220,6 @@ public: static constexpr int digits10 = 2; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -273,7 +264,6 @@ public: static constexpr int digits10 = 2; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -319,7 +309,6 @@ public: }; #ifdef __cpp_char8_t -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -365,7 +354,6 @@ public: }; #endif // __cpp_char8_t -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -410,7 +398,6 @@ public: static constexpr int digits10 = 4; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -455,7 +442,6 @@ public: static constexpr int digits10 = 9; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -500,7 +486,6 @@ public: static constexpr int digits10 = 4; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -545,7 +530,6 @@ public: static constexpr int digits10 = 4; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -590,7 +574,6 @@ public: static constexpr int digits10 = 9; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -636,7 +619,6 @@ public: static constexpr int digits10 = 9; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -682,7 +664,6 @@ public: }; #ifdef _NATIVE_WCHAR_T_DEFINED -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -728,7 +709,6 @@ public: }; #endif // _NATIVE_WCHAR_T_DEFINED -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -773,7 +753,6 @@ public: static constexpr int digits10 = 9; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -819,7 +798,6 @@ public: static constexpr int digits10 = 9; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_int_base { public: @@ -864,7 +842,6 @@ public: static constexpr int digits10 = 19; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_float_base { public: @@ -913,7 +890,6 @@ public: static constexpr int min_exponent10 = FLT_MIN_10_EXP; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_float_base { public: @@ -962,7 +938,6 @@ public: static constexpr int min_exponent10 = DBL_MIN_10_EXP; }; -// CLASS numeric_limits template <> class numeric_limits : public _Num_float_base { public: diff --git a/stl/inc/list b/stl/inc/list index b5fcf123193..3c698fe404c 100644 --- a/stl/inc/list +++ b/stl/inc/list @@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE _List_unchecked_const_iterator template class _List_unchecked_const_iterator : public _Base { public: @@ -83,7 +82,6 @@ public: _Nodeptr _Ptr; // pointer to node }; -// CLASS TEMPLATE _List_unchecked_iterator template class _List_unchecked_iterator : public _List_unchecked_const_iterator<_Mylist> { public: @@ -129,7 +127,6 @@ public: } }; -// CLASS TEMPLATE _List_const_iterator template class _List_const_iterator : public _List_unchecked_const_iterator<_Mylist, _Iterator_base> { public: @@ -224,7 +221,6 @@ public: } }; -// CLASS TEMPLATE _List_iterator template class _List_iterator : public _List_const_iterator<_Mylist> { public: @@ -276,7 +272,6 @@ public: } }; -// list TYPE WRAPPERS template struct _List_iter_types { @@ -341,7 +336,6 @@ struct _List_simple_types : _Simple_types<_Ty> { using _Nodeptr = _Node*; }; -// CLASS TEMPLATE _List_val template class _List_val : public _Container_base { public: @@ -579,7 +573,6 @@ public: size_type _Mysize; // number of elements }; -// STRUCT TEMPLATE _List_node_emplace_op2 template struct _List_node_emplace_op2 : _Alloc_construct_ptr<_Alnode> { using _Alnode_traits = allocator_traits<_Alnode>; @@ -612,7 +605,6 @@ struct _List_node_emplace_op2 : _Alloc_construct_ptr<_Alnode> { } }; -// STRUCT TEMPLATE _List_node_insert_op2 template struct _List_node_insert_op2 { // list insert operation which maintains exception safety @@ -758,7 +750,6 @@ private: template class _Hash; -// CLASS TEMPLATE list template > class list { // bidirectional linked list private: diff --git a/stl/inc/locale b/stl/inc/locale index fb99b74393d..6b527149118 100644 --- a/stl/inc/locale +++ b/stl/inc/locale @@ -23,7 +23,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE collate template class collate : public locale::facet { // facet for ordering sequences of elements public: @@ -118,7 +117,6 @@ private: _Locinfo::_Collvec _Coll; // used by _LStrcoll and _XStrxfrm }; -// STATIC collate::id OBJECT #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdllimport-static-field-def" @@ -143,7 +141,6 @@ template __PURE_APPDOMAIN_GLOBAL locale::id collate::id; #pragma clang diagnostic pop #endif // __clang__ -// CLASS TEMPLATE collate_byname template class collate_byname : public collate<_Elem> { // collate for named locale public: @@ -159,7 +156,6 @@ protected: virtual __CLR_OR_THIS_CALL ~collate_byname() noexcept {} }; -// FUNCTION TEMPLATE has_facet template _NODISCARD bool has_facet(const locale& _Loc) noexcept { _BEGIN_LOCK(_LOCK_LOCALE) // the thread lock, make get atomic @@ -168,85 +164,71 @@ _NODISCARD bool has_facet(const locale& _Loc) noexcept { _END_LOCK() } -// FUNCTION TEMPLATE isalnum template _NODISCARD bool(isalnum)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::alnum, _Ch); } -// FUNCTION TEMPLATE isalpha template _NODISCARD bool(isalpha)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::alpha, _Ch); } -// FUNCTION TEMPLATE isblank template _NODISCARD bool(isblank)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::blank, _Ch); } -// FUNCTION TEMPLATE iscntrl template _NODISCARD bool(iscntrl)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::cntrl, _Ch); } -// FUNCTION TEMPLATE isdigit template _NODISCARD bool(isdigit)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::digit, _Ch); } -// FUNCTION TEMPLATE isgraph template _NODISCARD bool(isgraph)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::graph, _Ch); } -// FUNCTION TEMPLATE islower template _NODISCARD bool(islower)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::lower, _Ch); } -// FUNCTION TEMPLATE isprint template _NODISCARD bool(isprint)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::print, _Ch); } -// FUNCTION TEMPLATE ispunct template _NODISCARD bool(ispunct)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::punct, _Ch); } -// FUNCTION TEMPLATE isspace template _NODISCARD bool(isspace)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::space, _Ch); } -// FUNCTION TEMPLATE isupper template _NODISCARD bool(isupper)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::upper, _Ch); } -// FUNCTION TEMPLATE isxdigit template _NODISCARD bool(isxdigit)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::xdigit, _Ch); } -// FUNCTION TEMPLATE tolower template _NODISCARD _Elem(tolower)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).tolower(_Ch); } -// FUNCTION TEMPLATE toupper template _NODISCARD _Elem(toupper)(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).toupper(_Ch); diff --git a/stl/inc/map b/stl/inc/map index 1c66bbcd478..66fdd9fc81d 100644 --- a/stl/inc/map +++ b/stl/inc/map @@ -23,7 +23,6 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new _STD_BEGIN -// CLASS TEMPLATE _Tmap_traits template , class _Alloc = allocator>> class map : public _Tree<_Tmap_traits<_Kty, _Ty, _Pr, _Alloc, false>> { // ordered red-black tree of {key, mapped} values, unique keys @@ -419,7 +417,6 @@ typename map<_Kty, _Ty, _Keylt, _Alloc>::size_type erase_if(map<_Kty, _Ty, _Keyl } #endif // _HAS_CXX20 -// CLASS TEMPLATE multimap template , class _Alloc = allocator>> class multimap : public _Tree<_Tmap_traits<_Kty, _Ty, _Pr, _Alloc, true>> { // ordered red-black tree of {key, mapped} values, non-unique keys diff --git a/stl/inc/memory b/stl/inc/memory index 9da84c51c7d..55d32f8e50a 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -28,11 +28,9 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE uninitialized_copy_result template using uninitialized_copy_result = in_out_result<_In, _Out>; - // VARIABLE ranges::uninitialized_copy class _Uninitialized_copy_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -108,7 +106,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE uninitialized_copy_n template _NoThrowFwdIt uninitialized_copy_n(const _InIt _First, const _Diff _Count_raw, _NoThrowFwdIt _Dest) { // copy [_First, _First + _Count) to [_Dest, ...) @@ -137,11 +134,9 @@ _NoThrowFwdIt uninitialized_copy_n(const _InIt _First, const _Diff _Count_raw, _ #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE uninitialized_copy_n_result template using uninitialized_copy_n_result = in_out_result<_In, _Out>; - // VARIABLE ranges::uninitialized_copy_n class _Uninitialized_copy_n_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -192,7 +187,6 @@ namespace ranges { #endif // __cpp_lib_concepts #if _HAS_CXX17 -// FUNCTION TEMPLATE uninitialized_move template _NoThrowFwdIt uninitialized_move(const _InIt _First, const _InIt _Last, _NoThrowFwdIt _Dest) { // move [_First, _Last) to raw [_Dest, ...) @@ -206,7 +200,6 @@ _NoThrowFwdIt uninitialized_move(const _InIt _First, const _InIt _Last, _NoThrow #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::uninitialized_move class _Uninitialized_move_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -247,7 +240,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE uninitialized_move_n template pair<_InIt, _NoThrowFwdIt> uninitialized_move_n(_InIt _First, const _Diff _Count_raw, _NoThrowFwdIt _Dest) { // move [_First, _First + _Count) to [_Dest, ...) @@ -280,11 +272,9 @@ pair<_InIt, _NoThrowFwdIt> uninitialized_move_n(_InIt _First, const _Diff _Count #ifdef __cpp_lib_concepts namespace ranges { - // ALIAS TEMPLATE uninitialized_move_n_result template using uninitialized_move_n_result = in_out_result<_In, _Out>; - // VARIABLE ranges::uninitialized_move_n class _Uninitialized_move_n_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -332,7 +322,6 @@ namespace ranges { inline constexpr _Uninitialized_move_n_fn uninitialized_move_n{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::uninitialized_fill class _Uninitialized_fill_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -393,7 +382,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE uninitialized_fill_n template _NoThrowFwdIt uninitialized_fill_n(_NoThrowFwdIt _First, const _Diff _Count_raw, const _Tval& _Val) { // copy _Count copies of _Val to raw _First @@ -430,7 +418,6 @@ _NoThrowFwdIt uninitialized_fill_n(_NoThrowFwdIt _First, const _Diff _Count_raw, #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::uninitialized_fill_n class _Uninitialized_fill_n_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -471,7 +458,6 @@ namespace ranges { inline constexpr _Uninitialized_fill_n_fn uninitialized_fill_n{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::construct_at class _Construct_at_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -492,7 +478,6 @@ namespace ranges { inline constexpr _Construct_at_fn construct_at{_Not_quite_object::_Construct_tag{}}; - // VARIABLE ranges::destroy_at // clang-format off template <_No_throw_input_iterator _It, _No_throw_sentinel_for<_It> _Se> requires destructible> @@ -518,7 +503,6 @@ namespace ranges { #endif // __cpp_lib_concepts #if _HAS_CXX17 -// FUNCTION TEMPLATE destroy template _CONSTEXPR20 void destroy(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) { // destroy all elements in [_First, _Last) @@ -528,7 +512,6 @@ _CONSTEXPR20 void destroy(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::destroy // clang-format off template <_No_throw_input_iterator _It, _No_throw_sentinel_for<_It> _Se> requires destructible> @@ -575,7 +558,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE destroy_n template _CONSTEXPR20 _NoThrowFwdIt destroy_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { // destroy all elements in [_First, _First + _Count) @@ -599,7 +581,6 @@ _CONSTEXPR20 _NoThrowFwdIt destroy_n(_NoThrowFwdIt _First, const _Diff _Count_ra #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::destroy_n class _Destroy_n_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -634,7 +615,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE uninitialized_default_construct template void uninitialized_default_construct(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) { // default-initialize all elements in [_First, _Last) @@ -653,7 +633,6 @@ void uninitialized_default_construct(const _NoThrowFwdIt _First, const _NoThrowF #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::uninitialized_default_construct class _Uninitialized_default_construct_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -709,7 +688,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE uninitialized_default_construct_n template _NoThrowFwdIt uninitialized_default_construct_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { // default-initialize all elements in [_First, _First + _Count_raw) @@ -735,7 +713,6 @@ _NoThrowFwdIt uninitialized_default_construct_n(_NoThrowFwdIt _First, const _Dif #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::uninitialized_default_construct_n class _Uninitialized_default_construct_n_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -770,7 +747,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE uninitialized_value_construct template void uninitialized_value_construct(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) { // value-initialize all elements in [_First, _Last) @@ -792,7 +768,6 @@ void uninitialized_value_construct(const _NoThrowFwdIt _First, const _NoThrowFwd #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::uninitialized_value_construct class _Uninitialized_value_construct_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -846,7 +821,6 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE uninitialized_value_construct_n template _NoThrowFwdIt uninitialized_value_construct_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { // value-initialize all elements in [_First, _First + _Count_raw) @@ -861,7 +835,6 @@ _NoThrowFwdIt uninitialized_value_construct_n(_NoThrowFwdIt _First, const _Diff #ifdef __cpp_lib_concepts namespace ranges { - // VARIABLE ranges::uninitialized_value_construct_n class _Uninitialized_value_construct_n_fn : private _Not_quite_object { public: using _Not_quite_object::_Not_quite_object; @@ -899,7 +872,6 @@ namespace ranges { #if _HAS_DEPRECATED_RAW_STORAGE_ITERATOR -// CLASS TEMPLATE raw_storage_iterator template class _CXX17_DEPRECATE_RAW_STORAGE_ITERATOR raw_storage_iterator { // wrap stores to raw buffer as output iterator public: @@ -947,7 +919,6 @@ private: #if _HAS_AUTO_PTR_ETC -// CLASS TEMPLATE auto_ptr template class auto_ptr; @@ -1057,7 +1028,6 @@ public: #endif // _HAS_AUTO_PTR_ETC -// CLASS bad_weak_ptr class bad_weak_ptr : public exception { // exception type for invalid use of expired weak_ptr object public: bad_weak_ptr() noexcept {} @@ -1072,7 +1042,6 @@ public: _THROW(bad_weak_ptr{}); } -// CLASS _Ref_count_base class __declspec(novtable) _Ref_count_base { // common code for reference counting private: #ifdef _M_CEE_PURE @@ -1150,7 +1119,6 @@ public: } }; -// CLASS TEMPLATE _Ref_count template class _Ref_count : public _Ref_count_base { // handle reference counting for pointer without deleter public: @@ -1168,7 +1136,6 @@ private: _Ty* _Ptr; }; -// CLASS TEMPLATE _Ref_count_resource template class _Ref_count_resource : public _Ref_count_base { // handle reference counting for object with deleter public: @@ -1205,7 +1172,6 @@ private: _Compressed_pair<_Dx, _Resource> _Mypair; }; -// CLASS TEMPLATE _Ref_count_resource_alloc template class _Ref_count_resource_alloc : public _Ref_count_base { // handle reference counting for object with deleter and allocator @@ -1248,7 +1214,6 @@ private: _Compressed_pair<_Dx, _Compressed_pair<_Myalty, _Resource>> _Mypair; }; -// DECLARATIONS template struct default_delete; @@ -1270,7 +1235,6 @@ struct _Can_enable_shared<_Yty, void_t> // is_convertible is necessary to verify unambiguous inheritance }; -// CLASS TEMPLATE _Ptr_base struct _Exception_ptr_access; template @@ -1446,25 +1410,21 @@ private: #endif // _HAS_STATIC_RTTI }; -// TYPE TRAIT _Can_scalar_delete template struct _Can_scalar_delete : false_type {}; template struct _Can_scalar_delete<_Yty, void_t())>> : true_type {}; -// TYPE TRAIT _Can_array_delete template struct _Can_array_delete : false_type {}; template struct _Can_array_delete<_Yty, void_t())>> : true_type {}; -// TYPE TRAIT _Can_call_function_object template struct _Can_call_function_object : false_type {}; template struct _Can_call_function_object<_Fx, _Arg, void_t()(_STD declval<_Arg>()))>> : true_type {}; -// TYPE TRAIT _SP_convertible template struct _SP_convertible : is_convertible<_Yty*, _Ty*>::type {}; template @@ -1472,7 +1432,6 @@ struct _SP_convertible<_Yty, _Uty[]> : is_convertible<_Yty (*)[], _Uty (*)[]>::t template struct _SP_convertible<_Yty, _Uty[_Ext]> : is_convertible<_Yty (*)[_Ext], _Uty (*)[_Ext]>::type {}; -// TYPE TRAIT _SP_pointer_compatible template struct _SP_pointer_compatible : is_convertible<_Yty*, _Ty*>::type { // N4659 [util.smartptr.shared]/5 "a pointer type Y* is said to be compatible @@ -1495,7 +1454,6 @@ struct _SP_pointer_compatible<_Uty[_Ext], const volatile _Uty[]> : true_type { // N4659 [util.smartptr.shared]/5 "... or Y is U[N] and T is cv U[]." }; -// CLASS TEMPLATE shared_ptr template struct _Temporary_owner { _Ux* _Ptr; @@ -2038,7 +1996,6 @@ struct _For_overwrite_tag { }; #endif // _HAS_CXX20 -// CLASS TEMPLATE _Ref_count_obj2 template class _Ref_count_obj2 : public _Ref_count_base { // handle reference counting for object in control block, no allocator public: @@ -2288,7 +2245,6 @@ void _Uninitialized_fill_multidimensional_n(_Ty* const _Out, const size_t _Size, } } -// CLASS TEMPLATE _Ref_count_unbounded_array template >> class _Ref_count_unbounded_array : public _Ref_count_base { // handle reference counting for unbounded array with trivial destruction in control block, no allocator @@ -2383,7 +2339,6 @@ private: } }; -// CLASS TEMPLATE _Ref_count_bounded_array template class _Ref_count_bounded_array : public _Ref_count_base { // handle reference counting for bounded array in control block, no allocator @@ -2422,7 +2377,6 @@ private: }; #endif // _HAS_CXX20 -// CLASS TEMPLATE _Ebco_base template && !is_final_v<_Ty>> class _Ebco_base : private _Ty { // Empty Base Class Optimization, active @@ -2462,7 +2416,6 @@ protected: } }; -// CLASS TEMPLATE _Ref_count_obj_alloc3 template class _Ref_count_obj_alloc3 : public _Ebco_base<_Rebind_alloc_t<_Alloc, _Ty>>, public _Ref_count_base { // handle reference counting for object in control block, allocator @@ -2639,7 +2592,6 @@ void _Uninitialized_fill_multidimensional_n_al(_Ty* const _Out, const size_t _Si } } -// CLASS TEMPLATE _Ref_count_unbounded_array_alloc template class _Ref_count_unbounded_array_alloc : public _Ebco_base<_Rebind_alloc_t<_Alloc, remove_all_extents_t<_Ty>>>, public _Ref_count_base { @@ -2707,7 +2659,6 @@ private: } }; -// CLASS TEMPLATE _Ref_count_bounded_array_alloc template class _Ref_count_bounded_array_alloc : public _Ebco_base<_Rebind_alloc_t<_Alloc, remove_all_extents_t<_Ty>>>, public _Ref_count_base { @@ -2761,7 +2712,6 @@ private: }; #endif // _HAS_CXX20 -// FUNCTION TEMPLATE make_shared template _NODISCARD #if _HAS_CXX20 @@ -2834,7 +2784,6 @@ _NODISCARD enable_if_t, shared_ptr<_Ty>> make_shared(con return _Ret; } -// FUNCTION TEMPLATE make_shared_for_overwrite template _NODISCARD enable_if_t, shared_ptr<_Ty>> make_shared_for_overwrite() { shared_ptr<_Ty> _Ret; @@ -2856,7 +2805,6 @@ _NODISCARD enable_if_t, shared_ptr<_Ty>> make_shared_f } #endif // _HAS_CXX20 -// FUNCTION TEMPLATE allocate_shared template _NODISCARD #if _HAS_CXX20 @@ -2961,7 +2909,6 @@ _NODISCARD enable_if_t, shared_ptr<_Ty>> allocate_shared return _Ret; } -// FUNCTION TEMPLATE allocate_shared_for_overwrite template _NODISCARD enable_if_t, shared_ptr<_Ty>> allocate_shared_for_overwrite(const _Alloc& _Al) { shared_ptr<_Ty> _Ret; @@ -2997,7 +2944,6 @@ _NODISCARD enable_if_t, shared_ptr<_Ty>> allocate_shar } #endif // _HAS_CXX20 -// CLASS TEMPLATE weak_ptr template class weak_ptr : public _Ptr_base<_Ty> { // class for pointer to reference counted resource public: @@ -3087,7 +3033,6 @@ void swap(weak_ptr<_Ty>& _Left, weak_ptr<_Ty>& _Right) noexcept { _Left.swap(_Right); } -// CLASS TEMPLATE enable_shared_from_this template class enable_shared_from_this { // provide member functions that create shared_ptr to this public: @@ -3130,9 +3075,6 @@ private: }; -// CLASS TEMPLATE unique_ptr AND HELPERS - -// STRUCT TEMPLATE default_delete template struct default_delete { // default deleter for unique_ptr constexpr default_delete() noexcept = default; @@ -3160,7 +3102,6 @@ struct default_delete<_Ty[]> { // default deleter for unique_ptr to array of unk } }; -// STRUCT TEMPLATE _Get_deleter_pointer_type template struct _Get_deleter_pointer_type { // provide fallback using type = _Ty*; @@ -3175,7 +3116,6 @@ template using _Unique_ptr_enable_default_t = enable_if_t>, is_default_constructible<_Dx2>>, int>; -// CLASS TEMPLATE unique_ptr SCALAR template */> class unique_ptr { // non-copyable pointer to an object public: @@ -3301,7 +3241,6 @@ private: _Compressed_pair<_Dx, pointer> _Mypair; }; -// CLASS TEMPLATE unique_ptr ARRAY template class unique_ptr<_Ty[], _Dx> { // non-copyable pointer to an array object public: @@ -3435,7 +3374,6 @@ private: }; -// FUNCTION TEMPLATE make_unique template , int> = 0> _NODISCARD unique_ptr<_Ty> make_unique(_Types&&... _Args) { // make a unique_ptr return unique_ptr<_Ty>(new _Ty(_STD forward<_Types>(_Args)...)); @@ -3451,7 +3389,6 @@ template != 0, int> = 0> void make_unique(_Types&&...) = delete; #if _HAS_CXX20 -// FUNCTION TEMPLATE make_unique_for_overwrite template , int> = 0> _NODISCARD unique_ptr<_Ty> make_unique_for_overwrite() { // make a unique_ptr with default initialization return unique_ptr<_Ty>(new _Ty); @@ -3610,7 +3547,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Out, c return _Out; } -// GARBAGE COLLECTION #if _HAS_GARBAGE_COLLECTION_SUPPORT_DELETED_IN_CXX23 enum class pointer_safety { relaxed, preferred, strict }; @@ -3630,7 +3566,6 @@ inline pointer_safety get_pointer_safety() noexcept { } #endif // _HAS_GARBAGE_COLLECTION_SUPPORT_DELETED_IN_CXX23 -// STRUCT TEMPLATE owner_less template struct owner_less; // not defined @@ -3697,7 +3632,6 @@ struct owner_less { using is_transparent = int; }; -// STRUCT TEMPLATE SPECIALIZATION hash template struct hash> : _Conditionally_enabled_hash, is_default_constructible_v::pointer>>> { @@ -3717,7 +3651,6 @@ struct hash> { } }; -// FUNCTION align inline void* align(size_t _Bound, size_t _Size, void*& _Ptr, size_t& _Space) noexcept /* strengthened */ { // try to carve out _Size bytes on boundary _Bound size_t _Off = static_cast(reinterpret_cast(_Ptr) & (_Bound - 1)); @@ -3747,13 +3680,11 @@ _NODISCARD constexpr _Ty* assume_aligned(_Ty* const _Ptr) noexcept /* strengthen } #endif // _HAS_CXX20 -// SPIN LOCKS _EXTERN_C _CRTIMP2_PURE void __cdecl _Lock_shared_ptr_spin_lock(); _CRTIMP2_PURE void __cdecl _Unlock_shared_ptr_spin_lock(); _END_EXTERN_C -// WRAP SPIN-LOCK struct _Shared_ptr_spin_lock { // class to manage a spin lock for shared_ptr atomic operations _Shared_ptr_spin_lock() { // lock the spin lock _Lock_shared_ptr_spin_lock(); diff --git a/stl/inc/memory_resource b/stl/inc/memory_resource index 386122fabb9..c9648cf8c7a 100644 --- a/stl/inc/memory_resource +++ b/stl/inc/memory_resource @@ -32,7 +32,6 @@ _STD_BEGIN namespace pmr { - // FUNCTION set_default_resource extern "C" _CRT_SATELLITE_1 memory_resource* __cdecl _Aligned_set_default_resource(memory_resource*) noexcept; extern "C" _CRT_SATELLITE_1 memory_resource* __cdecl _Unaligned_set_default_resource(memory_resource*) noexcept; @@ -46,7 +45,6 @@ namespace pmr { extern "C" _NODISCARD _CRT_SATELLITE_1 memory_resource* __cdecl null_memory_resource() noexcept; - // FUNCTION new_delete_resource class _Identity_equal_resource : public memory_resource { protected: virtual bool do_is_equal(const memory_resource& _That) const noexcept override { @@ -105,7 +103,6 @@ namespace pmr { } #endif // __cpp_aligned_new - // CLASS unsynchronized_pool_resource template struct _Double_link { // base class for intrusive doubly-linked structures _Double_link* _Next; @@ -597,7 +594,6 @@ namespace pmr { }; #endif // _M_CEE - // CLASS TEMPLATE monotonic_buffer_resource class monotonic_buffer_resource : public _Identity_equal_resource { public: explicit monotonic_buffer_resource(memory_resource* const _Upstream) noexcept // strengthened diff --git a/stl/inc/mutex b/stl/inc/mutex index aafefe48bcd..eea7d5426a6 100644 --- a/stl/inc/mutex +++ b/stl/inc/mutex @@ -33,7 +33,6 @@ _STD_BEGIN class condition_variable; class condition_variable_any; -// MUTUAL EXCLUSION class _Mutex_base { // base class for all mutex types public: _Mutex_base(int _Flags = 0) noexcept { @@ -106,7 +105,6 @@ public: }; #endif // _M_CEE -// LOCK PROPERTIES struct adopt_lock_t { // indicates adopt lock explicit adopt_lock_t() = default; }; @@ -123,13 +121,11 @@ _INLINE_VAR constexpr adopt_lock_t adopt_lock{}; _INLINE_VAR constexpr defer_lock_t defer_lock{}; _INLINE_VAR constexpr try_to_lock_t try_to_lock{}; -// CLASS TEMPLATE unique_lock template class unique_lock { // whizzy class with destructor that unlocks mutex public: using mutex_type = _Mutex; - // CONSTRUCT, ASSIGN, AND DESTROY unique_lock() noexcept : _Pmtx(nullptr), _Owns(false) {} _NODISCARD_CTOR explicit unique_lock(_Mutex& _Mtx) @@ -276,20 +272,17 @@ private: } }; -// FUNCTION TEMPLATE swap FOR unique_lock template void swap(unique_lock<_Mutex>& _Left, unique_lock<_Mutex>& _Right) noexcept { _Left.swap(_Right); } -// FUNCTION TEMPLATE _Lock_from_locks template void _Lock_from_locks(const int _Target, index_sequence<_Indices...>, _LockN&... _LkN) { // lock _LkN[_Target] int _Ignored[] = {((static_cast(_Indices) == _Target ? (void) _LkN.lock() : void()), 0)...}; (void) _Ignored; } -// FUNCTION TEMPLATE _Try_lock_from_locks template bool _Try_lock_from_locks( const int _Target, index_sequence<_Indices...>, _LockN&... _LkN) { // try to lock _LkN[_Target] @@ -299,7 +292,6 @@ bool _Try_lock_from_locks( return _Result; } -// FUNCTION TEMPLATE _Unlock_locks template void _Unlock_locks(const int _First, const int _Last, index_sequence<_Indices...>, _LockN&... _LkN) noexcept /* terminates */ { @@ -310,7 +302,6 @@ void _Unlock_locks(const int _First, const int _Last, index_sequence<_Indices... (void) _Ignored; } -// FUNCTION TEMPLATE try_lock template int _Try_lock_range(const int _First, const int _Last, _LockN&... _LkN) { using _Indices = index_sequence_for<_LockN...>; @@ -360,7 +351,6 @@ _NODISCARD int try_lock(_Lock0& _Lk0, _Lock1& _Lk1, _LockN&... _LkN) { // try to return _Try_lock1(_Lk0, _Lk1, _LkN...); } -// FUNCTION TEMPLATE lock template int _Lock_attempt(const int _Hard_lock, _LockN&... _LkN) { // attempt to lock 3 or more locks, starting by locking _LkN[_Hard_lock] and trying to lock the rest @@ -428,7 +418,6 @@ void lock(_Lock0& _Lk0, _Lock1& _Lk1, _LockN&... _LkN) { // lock multiple locks, _Lock_nonmember1(_Lk0, _Lk1, _LkN...); } -// CLASS TEMPLATE lock_guard template class _NODISCARD lock_guard { // class with destructor that unlocks a mutex public: @@ -452,7 +441,6 @@ private: }; #if _HAS_CXX17 -// CLASS TEMPLATE scoped_lock template class _NODISCARD scoped_lock { // class with destructor that unlocks mutexes public: @@ -507,7 +495,6 @@ public: }; #endif // _HAS_CXX17 -// FUNCTION TEMPLATE call_once #ifdef _M_CEE #define _WINDOWS_API __stdcall #define _RENAME_WINDOWS_API(_Api) _Api##_clr diff --git a/stl/inc/new b/stl/inc/new index c0f88c82b7e..4dd89deec12 100644 --- a/stl/inc/new +++ b/stl/inc/new @@ -20,7 +20,6 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #if _HAS_CXX20 -// STRUCT destroying_delete_t struct destroying_delete_t { explicit destroying_delete_t() = default; }; @@ -28,7 +27,6 @@ inline constexpr destroying_delete_t destroying_delete{}; #endif // _HAS_CXX20 #if _HAS_CXX17 -// FUNCTION TEMPLATE launder template _NODISCARD constexpr _Ty* launder(_Ty* _Ptr) noexcept { static_assert(!is_function_v<_Ty> && !is_void_v<_Ty>, @@ -45,13 +43,11 @@ inline constexpr size_t hardware_destructive_interference_size = 64; #endif // _HAS_CXX17 -// SUPPORT TYPES #if !defined(_INC_NEW) || !defined(_MSC_EXTENSIONS) // handler for operator new failures using new_handler = void(__CLRCALL_PURE_OR_CDECL*)(); #endif // !defined(_INC_NEW) || !defined(_MSC_EXTENSIONS) -// FUNCTION AND OBJECT DECLARATIONS _CRTIMP2 new_handler __cdecl set_new_handler(_In_opt_ new_handler) noexcept; _NODISCARD _CRTIMP2 new_handler __cdecl get_new_handler() noexcept; _STD_END diff --git a/stl/inc/numeric b/stl/inc/numeric index b8c4f86ae8d..1d6c90bf094 100644 --- a/stl/inc/numeric +++ b/stl/inc/numeric @@ -21,7 +21,6 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new _STD_BEGIN -// FUNCTION TEMPLATE accumulate template _NODISCARD _CONSTEXPR20 _Ty accumulate(const _InIt _First, const _InIt _Last, _Ty _Val, _Fn _Reduce_op) { // return noncommutative and nonassociative reduction of _Val and all in [_First, _Last), using _Reduce_op @@ -45,7 +44,6 @@ _NODISCARD _CONSTEXPR20 _Ty accumulate(const _InIt _First, const _InIt _Last, _T } #if _HAS_CXX17 -// FUNCTION TEMPLATE reduce #if _STD_VECTORIZE_WITH_FLOAT_CONTROL template inline constexpr bool _Plus_on_arithmetic_ranges_reduction_v = @@ -124,7 +122,6 @@ _NODISCARD _Iter_value_t<_FwdIt> reduce(_ExPo&& _Exec, const _FwdIt _First, cons } #endif // _HAS_CXX17 -// FUNCTION TEMPLATE inner_product template _NODISCARD _CONSTEXPR20 _Ty inner_product( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _Ty _Val, _BinOp1 _Reduce_op, _BinOp2 _Transform_op) { @@ -152,7 +149,6 @@ _NODISCARD _CONSTEXPR20 _Ty inner_product(const _InIt1 _First1, const _InIt1 _La } #if _HAS_CXX17 -// FUNCTION TEMPLATE transform_reduce #if _STD_VECTORIZE_WITH_FLOAT_CONTROL template inline constexpr bool _Default_ops_transform_reduce_v = @@ -243,7 +239,6 @@ _NODISCARD _Ty transform_reduce(_ExPo&& _Exec, const _FwdIt _First1, const _FwdI _UnaryOp _Transform_op) noexcept; // terminates #endif // _HAS_CXX17 -// FUNCTION TEMPLATE partial_sum template _CONSTEXPR20 _OutIt partial_sum(const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Reduce_op) { // compute partial noncommutative and nonassociative reductions into _Dest, using _Reduce_op @@ -280,7 +275,6 @@ _CONSTEXPR20 _OutIt partial_sum(_InIt _First, _InIt _Last, _OutIt _Dest) { } #if _HAS_CXX17 -// FUNCTION TEMPLATE exclusive_scan template _CONSTEXPR20 _OutIt exclusive_scan(const _InIt _First, const _InIt _Last, _OutIt _Dest, _Ty _Val, _BinOp _Reduce_op) { // set each value in [_Dest, _Dest + (_Last - _First)) to the associative reduction of predecessors and _Val @@ -323,7 +317,6 @@ _FwdIt2 exclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, return _STD exclusive_scan(_STD forward<_ExPo>(_Exec), _First, _Last, _Dest, _STD move(_Val), plus{}); } -// FUNCTION TEMPLATE inclusive_scan template _CONSTEXPR20 _OutIt inclusive_scan(const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Reduce_op, _Ty _Val) { // compute partial noncommutative and associative reductions including _Val into _Dest, using _Reduce_op @@ -387,7 +380,6 @@ _FwdIt2 inclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, return _STD inclusive_scan(_STD forward<_ExPo>(_Exec), _First, _Last, _Dest, plus{}); } -// FUNCTION TEMPLATE transform_exclusive_scan template _CONSTEXPR20 _OutIt transform_exclusive_scan( const _InIt _First, const _InIt _Last, _OutIt _Dest, _Ty _Val, _BinOp _Reduce_op, _UnaryOp _Transform_op) { @@ -419,7 +411,6 @@ template _CONSTEXPR20 _OutIt transform_inclusive_scan( const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op, _Ty _Val) { @@ -475,7 +466,6 @@ _FwdIt2 transform_inclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _Fwd _BinOp _Reduce_op, _UnaryOp _Transform_op) noexcept; // terminates #endif // _HAS_CXX17 -// FUNCTION TEMPLATE adjacent_difference template _CONSTEXPR20 _OutIt adjacent_difference(const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Func) { // compute adjacent differences into _Dest @@ -522,7 +512,6 @@ _FwdIt2 adjacent_difference(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _ } #endif // _HAS_CXX17 -// FUNCTION TEMPLATE iota template _CONSTEXPR20 void iota(_FwdIt _First, _FwdIt _Last, _Ty _Val) { // compute increasing sequence into [_First, _Last) @@ -535,7 +524,6 @@ _CONSTEXPR20 void iota(_FwdIt _First, _FwdIt _Last, _Ty _Val) { } #if _HAS_CXX17 -// FUNCTION TEMPLATE _Abs_u template _NODISCARD constexpr auto _Abs_u(const _Integral _Val) noexcept { // computes absolute value of _Val (converting to an unsigned integer type if necessary to avoid overflow @@ -555,7 +543,6 @@ _NODISCARD constexpr auto _Abs_u(const _Integral _Val) noexcept { } } -// FUNCTION TEMPLATE gcd template _NODISCARD constexpr common_type_t<_Mt, _Nt> gcd(const _Mt _Mx, const _Nt _Nx) noexcept /* strengthened */ { // calculate greatest common divisor @@ -592,7 +579,6 @@ _NODISCARD constexpr common_type_t<_Mt, _Nt> gcd(const _Mt _Mx, const _Nt _Nx) n return static_cast<_Common>(_Mx_magnitude << _Common_factors_of_2); } -// FUNCTION TEMPLATE lcm template _NODISCARD constexpr common_type_t<_Mt, _Nt> lcm(const _Mt _Mx, const _Nt _Nx) noexcept /* strengthened */ { // calculate least common multiple @@ -610,7 +596,6 @@ _NODISCARD constexpr common_type_t<_Mt, _Nt> lcm(const _Mt _Mx, const _Nt _Nx) n #endif // _HAS_CXX17 #if _HAS_CXX20 -// FUNCTION TEMPLATE midpoint template && !is_same_v, bool>, int> = 0> _NODISCARD constexpr _Ty midpoint(const _Ty _Val1, const _Ty _Val2) noexcept { if constexpr (is_floating_point_v<_Ty>) { diff --git a/stl/inc/optional b/stl/inc/optional index e007eb5d3fc..4c4575e928f 100644 --- a/stl/inc/optional +++ b/stl/inc/optional @@ -30,14 +30,12 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN -// STRUCT nullopt_t [optional.nullopt] struct nullopt_t { // no-value state indicator struct _Tag {}; constexpr explicit nullopt_t(_Tag) {} }; inline constexpr nullopt_t nullopt{nullopt_t::_Tag{}}; -// CLASS bad_optional_access [optional.bad_optional_access] class bad_optional_access : public exception { public: _NODISCARD virtual const char* __CLR_OR_THIS_CALL what() const noexcept override { @@ -152,7 +150,6 @@ struct _Optional_construct_base : _Optional_destruct_base<_Ty> { } }; -// CLASS TEMPLATE optional [optional.object] template class optional : private _SMF_control<_Optional_construct_base<_Ty>, _Ty> { private: @@ -166,7 +163,6 @@ public: using value_type = _Ty; - // constructors [optional.object.ctor] constexpr optional() noexcept {} constexpr optional(nullopt_t) noexcept {} @@ -255,7 +251,6 @@ public: } #endif // ^^^ !_HAS_CONDITIONAL_EXPLICIT ^^^ - // assignment [optional.object.assign] optional& operator=(nullopt_t) noexcept { reset(); return *this; @@ -315,7 +310,6 @@ public: return this->_Construct(_Ilist, _STD forward<_Types>(_Args)...); } - // swap [optional.object.swap] void swap(optional& _Right) noexcept(is_nothrow_move_constructible_v<_Ty>&& is_nothrow_swappable_v<_Ty>) { static_assert(is_move_constructible_v<_Ty>, "optional::swap requires T to be move constructible (N4828 [optional.swap]/1)."); @@ -339,7 +333,6 @@ public: } } - // observers [optional.object.observe] _NODISCARD constexpr const _Ty* operator->() const { #if _CONTAINER_DEBUG_LEVEL > 0 _STL_VERIFY(this->_Has_value, "Cannot access value of empty optional"); @@ -443,14 +436,12 @@ public: return static_cast>(_STD forward<_Ty2>(_Right)); } - // modifiers [optional.object.mod] using _Mybase::reset; }; template optional(_Ty) -> optional<_Ty>; -// RELATIONAL OPERATORS [optional.relops] template _NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) { const bool _Left_has_value = _Left.has_value(); @@ -495,7 +486,6 @@ _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> operator<=>( } #endif // __cpp_lib_concepts -// COMPARISONS WITH nullopt [optional.nullops] template _NODISCARD constexpr bool operator==(const optional<_Ty>& _Left, nullopt_t) noexcept { return !_Left.has_value(); @@ -558,7 +548,6 @@ _NODISCARD constexpr bool operator>=(nullopt_t, const optional<_Ty>& _Right) noe } #endif // !_HAS_CXX20 -// COMPARISONS WITH T [optional.comp_with_t] template using _Enable_if_bool_convertible = enable_if_t, int>; @@ -657,13 +646,11 @@ _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> } #endif // __cpp_lib_concepts -// FUNCTION TEMPLATE swap [optional.specalg] template && is_swappable_v<_Ty>, int> = 0> void swap(optional<_Ty>& _Left, optional<_Ty>& _Right) noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } -// FUNCTION TEMPLATE make_optional [optional.specalg] template _NODISCARD constexpr optional> make_optional(_Ty&& _Value) { return optional>{_STD forward<_Ty>(_Value)}; @@ -677,7 +664,6 @@ _NODISCARD constexpr optional<_Ty> make_optional(initializer_list<_Elem> _Ilist, return optional<_Ty>{in_place, _Ilist, _STD forward<_Types>(_Args)...}; } -// STRUCT TEMPLATE SPECIALIZATION hash [optional.hash] template struct hash> : _Conditionally_enabled_hash, is_default_constructible_v>>> { diff --git a/stl/inc/ostream b/stl/inc/ostream index 61766bf311e..2431d3ff392 100644 --- a/stl/inc/ostream +++ b/stl/inc/ostream @@ -20,7 +20,6 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #pragma vtordisp(push, 2) // compiler bug workaround -// CLASS TEMPLATE basic_ostream template class basic_ostream : virtual public basic_ios<_Elem, _Traits> { // control insertions into a stream buffer public: @@ -647,8 +646,6 @@ template class _CRTIMP2_PURE_IMPORT basic_ostream basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, const char* _Val) { // insert NTBS ios_base::iostate _State = ios_base::goodbit; @@ -972,7 +969,6 @@ _Ostr&& operator<<(_Ostr&& _Os, const _Ty& _Val) { // insert to rvalue stream return _STD move(_Os); } -// MANIPULATORS template basic_ostream<_Elem, _Traits>& __CLRCALL_OR_CDECL endl( basic_ostream<_Elem, _Traits>& _Ostr) { // insert newline and flush stream @@ -1032,7 +1028,6 @@ basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>&) = dele #endif // _CPPRTTI #endif // _HAS_CXX20 -// INSERTER FOR error_category template basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, const error_code& _Errcode) { // display error code diff --git a/stl/inc/queue b/stl/inc/queue index edf4c79772a..787587336e5 100644 --- a/stl/inc/queue +++ b/stl/inc/queue @@ -20,7 +20,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE queue template > class queue { public: @@ -173,7 +172,6 @@ void swap(queue<_Ty, _Container>& _Left, queue<_Ty, _Container>& _Right) noexcep template struct uses_allocator, _Alloc> : uses_allocator<_Container, _Alloc>::type {}; -// CLASS TEMPLATE priority_queue template , class _Pr = less> class priority_queue { public: diff --git a/stl/inc/random b/stl/inc/random index 350d5ff6df8..b0155d67a6d 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -27,7 +27,6 @@ _STL_DISABLE_CLANG_WARNINGS #pragma warning(disable : 4127) // conditional expression is constant _STD_BEGIN -// TYPE ASSERT MACROS #define _RNG_PROHIBIT_CHAR(_CheckedType) \ static_assert(!_Is_character<_CheckedType>::value, \ "note: char, signed char, unsigned char, char8_t, int8_t, and uint8_t are not allowed") @@ -50,7 +49,6 @@ _STD_BEGIN "unsigned short, unsigned int, unsigned long, or unsigned long long"); \ _RNG_PROHIBIT_CHAR(_CheckedType) -// ALIAS TEMPLATE _Enable_if_seed_seq_t template using _Enable_if_seed_seq_t = enable_if_t< !is_convertible_v, @@ -58,18 +56,15 @@ using _Enable_if_seed_seq_t = enable_if_t< result_type> && !is_same_v, _Self> && !is_same_v, _Engine>, int>; -// CONSTANTS _INLINE_VAR constexpr long double _Pi = 3.14159265358979323846264338327950288L; _INLINE_VAR constexpr long double _Exp1 = 2.71828182845904523536028747135266250L; _INLINE_VAR constexpr long double _Two32 = 4294967296.0L; _INLINE_VAR constexpr long double _Two31 = 2147483648.0L; -// HELPER FUNCTIONS _CRTIMP2_PURE float __CLRCALL_PURE_OR_CDECL _XLgamma(float); _CRTIMP2_PURE double __CLRCALL_PURE_OR_CDECL _XLgamma(double); _CRTIMP2_PURE long double __CLRCALL_PURE_OR_CDECL _XLgamma(long double); -// I/O HELPERS FOR FLOATING-POINT VALUES _INLINE_VAR constexpr int _Nwords = 4; template @@ -148,7 +143,6 @@ private: basic_istream<_Elem, _Traits>& _Str; }; -// CLASS seed_seq class seed_seq { // standard sequence of seed values public: using result_type = unsigned int; @@ -244,7 +238,6 @@ private: vector _Myvec; }; -// FUNCTION TEMPLATE generate_canonical template _NODISCARD _Real generate_canonical(_Gen& _Gx) { // build a floating-point value from random sequence _RNG_REQUIRE_REALTYPE(generate_canonical, _Real); @@ -272,7 +265,6 @@ _NODISCARD _Real generate_canonical(_Gen& _Gx) { // build a floating-point value #define _NRAND(eng, resty) (_STD generate_canonical(-1)>(eng)) -// CLASS TEMPLATE linear_congruential_engine _INLINE_VAR constexpr int _MP_len = 5; using _MP_arr = uint64_t[_MP_len]; @@ -462,7 +454,6 @@ private: result_type _Prev; }; -// CLASS TEMPLATE linear_congruential template class linear_congruential { // linear congruential random engine public: @@ -555,7 +546,6 @@ private: _Uint _Prev; }; -// CLASS TEMPLATE _Circ_buf FOR subtract_with_carry, subtract_with_carry_01, AND mersenne_twister template struct _Circ_buf { // holds historical values for generators _Ty _At(size_t _Ix) const { @@ -612,7 +602,6 @@ struct _Circ_buf { // holds historical values for generators _Ty _Ax[2 * _Nw]; }; -// CLASS TEMPLATE _Swc_base (subtract_with_carry, subtract_with_carry_01) template class _Swc_base : public _Circ_buf<_Ty, _Rx> { // common bits of subtract_with_carry/_01 public: @@ -761,7 +750,6 @@ const size_t _Swc_base<_Ty, _Sx, _Rx, _Swc_Traits>::short_lag; template const size_t _Swc_base<_Ty, _Sx, _Rx, _Swc_Traits>::long_lag; -// STRUCT TEMPLATE _Swc_traits template struct _Swc_traits { // traits for subtract_with_carry generator using _Cy_t = int; @@ -838,7 +826,6 @@ struct _Swc_traits { // traits for subtract_with_carry generator } }; -// CLASS TEMPLATE subtract_with_carry template class subtract_with_carry : public _Swc_base<_Ty, _Sx, _Rx, _Swc_traits<_Ty, _Mx, _Rx>> { // subtract_with_carry generator @@ -857,7 +844,6 @@ public: subtract_with_carry(_Gen& _Gx) : _Mybase(_Gx) {} }; -// CLASS TEMPLATE subtract_with_carry_engine template class subtract_with_carry_engine : public subtract_with_carry<_Ty, (_Ty{1} << (_Wx - 1)) << 1, _Sx, _Rx> { // subtract_with_carry generator @@ -925,7 +911,6 @@ public: }; #if _HAS_TR1_NAMESPACE -// STRUCT TEMPLATE _Swc_01_traits template struct _Swc_01_traits { // traits for subtract_with_carry_01 generator using _Cy_t = _Ty; @@ -997,7 +982,6 @@ const _Ty _Swc_01_traits<_Ty, _Wx, _Rx>::_Max = 1; template const _Ty _Swc_01_traits<_Ty, _Wx, _Rx>::_Scale1 = static_cast<_Ty>(_CSTD ldexp(1.0, _Wx % 32)); -// CLASS TEMPLATE subtract_with_carry_01 template class _DEPRECATE_TR1_NAMESPACE subtract_with_carry_01 : public _Swc_base<_Ty, _Sx, _Rx, _Swc_01_traits<_Ty, _Wx, _Rx>> { // subtract_with_carry_01 generator @@ -1021,7 +1005,6 @@ _STL_RESTORE_DEPRECATED_WARNING #endif // _HAS_TR1_NAMESPACE -// CLASS TEMPLATE mersenne_twister template class mersenne_twister : public _Circ_buf<_Ty, _Nx> { // mersenne twister generator public: @@ -1201,7 +1184,6 @@ basic_ostream<_Elem, _S_Traits>& operator<<(basic_ostream<_Elem, _S_Traits>& _Os return _Eng._Write(_Ostr); } -// CLASS TEMPLATE mersenne_twister_engine template class mersenne_twister_engine : public mersenne_twister<_Ty, _Wx, _Nx, _Mx, _Rx, _Px, _Ux, _Sx, _Bx, _Tx, _Cx, _Lx> { @@ -1286,7 +1268,6 @@ public: } }; -// CLASS TEMPLATE discard_block template class discard_block { // discard_block compound engine public: @@ -1400,7 +1381,6 @@ basic_ostream<_Elem, _Traits>& operator<<( return _Eng._Write(_Ostr); } -// CLASS TEMPLATE discard_block_engine template class discard_block_engine : public discard_block<_Engine, _Px, _Rx> { // discard_block_engine compound engine public: @@ -1429,7 +1409,6 @@ public: } }; -// CLASS TEMPLATE independent_bits_engine template class independent_bits_engine { // independent_bits_engine compound engine public: @@ -1593,7 +1572,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Eng._Write(_Ostr); } -// CLASS TEMPLATE shuffle_order_engine template class shuffle_order_engine { // shuffle_order_engine compound engine public: @@ -1728,7 +1706,6 @@ basic_ostream<_Elem, _Traits>& operator<<( return _Eng._Write(_Ostr); } -// CLASS TEMPLATE uniform_int template class uniform_int { // uniform integer distribution public: @@ -1882,7 +1859,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE uniform_int_distribution template class uniform_int_distribution : public uniform_int<_Ty> { // uniform integer distribution public: @@ -1920,7 +1896,6 @@ _NODISCARD bool operator!=(const uniform_int_distribution<_Ty>& _Left, const uni return !(_Left == _Right); } -// CLASS bernoulli_distribution class bernoulli_distribution { // class for bernoulli distribution public: using result_type = bool; @@ -2038,7 +2013,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// FUNCTION TEMPLATE _Float_upper_bound // Returns smallest _Flt such that static_cast<_Ty>(_Result) > _Val. // First truncate to largest _Flt <= _Val, then add ceil(ulp). @@ -2077,7 +2051,6 @@ _NODISCARD _Flt _Float_upper_bound(_Ty _Val) { } } -// CLASS TEMPLATE geometric_distribution template class geometric_distribution { // geometric distribution public: @@ -2211,7 +2184,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE poisson_distribution AND HELPER template class _Small_poisson_distribution { // poisson distribution with small mean public: @@ -2394,7 +2366,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE binomial_distribution template class binomial_distribution { // binomial distribution public: @@ -2601,7 +2572,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE uniform_real template class uniform_real { // uniform real distribution public: @@ -2725,7 +2695,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE uniform_real_distribution template class uniform_real_distribution : public uniform_real<_Ty> { // uniform real distribution public: @@ -2762,7 +2731,6 @@ _NODISCARD bool operator!=(const uniform_real_distribution<_Ty>& _Left, const un return !(_Left == _Right); } -// CLASS TEMPLATE exponential_distribution template class exponential_distribution { // exponential distribution public: @@ -2884,7 +2852,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE normal_distribution template class normal_distribution { // normal distribution public: @@ -3081,7 +3048,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE gamma_distribution template class gamma_distribution { // gamma distribution public: @@ -3277,7 +3243,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE weibull_distribution template class weibull_distribution { // weibull distribution public: @@ -3414,7 +3379,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE extreme_value_distribution template class extreme_value_distribution { // extreme value distribution public: @@ -3552,7 +3516,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE lognormal_distribution template class lognormal_distribution { // lognormal_distribution public: @@ -3688,7 +3651,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE chi_squared_distribution template class chi_squared_distribution { // chi squared distribution public: @@ -3810,7 +3772,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE cauchy_distribution template class cauchy_distribution { // Cauchy distribution public: @@ -3946,7 +3907,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE _Beta_distribution template class _Beta_distribution { // beta distribution public: @@ -4006,7 +3966,6 @@ private: _Ty _Bx; }; -// CLASS TEMPLATE fisher_f_distribution template class fisher_f_distribution { // fisher_f distribution public: @@ -4154,7 +4113,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE student_t_distribution template class student_t_distribution { // student_t distribution public: @@ -4291,7 +4249,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE negative_binomial_distribution template class negative_binomial_distribution { // negative binomial distribution public: @@ -4437,7 +4394,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE discrete_distribution template class discrete_distribution { // discrete integer distribution public: @@ -4634,7 +4590,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr, _Dist._Par); } -// CLASS TEMPLATE piecewise_constant_distribution template class piecewise_constant_distribution : public discrete_distribution { // piecewise constant floating-point distribution @@ -4827,7 +4782,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// CLASS TEMPLATE piecewise_linear_distribution template class piecewise_linear_distribution : public discrete_distribution { // piecewise linear floating-point distribution @@ -5076,7 +5030,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Dist._Write(_Ostr); } -// PREDEFINED GENERATORS using minstd_rand0 = linear_congruential_engine; using minstd_rand = linear_congruential_engine; @@ -5107,7 +5060,6 @@ using knuth_b = shuffle_order_engine; using default_random_engine = mt19937; -// CLASS random_device _CRTIMP2_PURE unsigned int __CLRCALL_PURE_OR_CDECL _Random_device(); diff --git a/stl/inc/ranges b/stl/inc/ranges index 9e07a4743b7..0593e90e88a 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -30,7 +30,6 @@ namespace ranges { // MUCH machinery defined in // clang-format off - // CONCEPT ranges::viewable_range template concept viewable_range = range<_Rng> && ((view> && constructible_from, _Rng>) @@ -242,7 +241,6 @@ namespace ranges { template using _Cached_position_t = conditional_t<_Enable, _Cached_position<_Rng, _Derived>, view_interface<_Derived>>; - // CLASS TEMPLATE ranges::_Copyable_box template <_Copy_constructible_object _Ty> class _Copyable_box { // a simplified optional that augments copy_constructible types with full copyability public: @@ -453,7 +451,6 @@ namespace ranges { /* [[no_unique_address]] */ _Ty _Val = _Ty(); }; - // CLASS TEMPLATE ranges::_Defaultabox template class _Defaultabox { // a simplified optional that augments movable types with default-constructibility public: @@ -636,7 +633,6 @@ namespace ranges { /* [[no_unique_address]] */ _Ty _Value{}; }; - // CLASS TEMPLATE ranges::empty_view // clang-format off template requires is_object_v<_Ty> @@ -665,12 +661,10 @@ namespace ranges { }; namespace views { - // VARIABLE TEMPLATE views::empty template inline constexpr empty_view<_Ty> empty; } // namespace views - // CLASS TEMPLATE ranges::single_view // clang-format off template requires is_object_v<_Ty> @@ -724,7 +718,6 @@ namespace ranges { }; namespace views { - // VARIABLE views::single struct _Single_fn { // clang-format off template @@ -740,7 +733,6 @@ namespace ranges { inline constexpr _Single_fn single; } // namespace views - // CLASS TEMPLATE ranges::iota_view template using _Iota_diff_t = conditional_t, conditional_t<(sizeof(_Ty) < sizeof(int)), int, long long>, iter_difference_t<_Ty>>; @@ -1051,7 +1043,6 @@ namespace ranges { inline constexpr bool enable_borrowed_range> = true; namespace views { - // VARIABLE views::iota struct _Iota_fn { template _NODISCARD constexpr auto operator()(_Ty&& _Val) const @@ -1071,7 +1062,6 @@ namespace ranges { inline constexpr _Iota_fn iota; } // namespace views - // CLASS TEMPLATE ranges::istream_view template concept _Stream_extractable = requires(basic_istream<_Elem, _Traits>& __is, _Ty& __t) { __is >> __t; @@ -1154,7 +1144,6 @@ namespace ranges { return basic_istream_view<_Ty, _Elem, _Traits>{_Stream}; } - // CLASS TEMPLATE ranges::ref_view // clang-format off template requires is_object_v<_Rng> @@ -1212,7 +1201,6 @@ namespace ranges { inline constexpr bool enable_borrowed_range> = true; namespace views { - // VARIABLE views::all template concept _Can_ref_view = requires(_Rng&& __r) { ref_view{static_cast<_Rng&&>(__r)}; @@ -1267,12 +1255,10 @@ namespace ranges { inline constexpr _All_fn all; - // ALIAS TEMPLATE views::all_t template using all_t = decltype(all(_STD declval<_Rng>())); } // namespace views - // CLASS TEMPLATE ranges::filter_view // clang-format off template > _Pr> requires view<_Vw> && is_object_v<_Pr> @@ -1503,7 +1489,6 @@ namespace ranges { filter_view(_Rng&&, _Pr) -> filter_view, _Pr>; namespace views { - // VARIABLE views::filter class _Filter_fn { private: template @@ -1545,7 +1530,6 @@ namespace ranges { inline constexpr _Filter_fn filter; } // namespace views - // CLASS TEMPLATE ranges::transform_view // clang-format off template // TRANSITION, LLVM-47414 concept _Can_const_transform = range && regular_invocable>; @@ -1991,7 +1975,6 @@ namespace ranges { transform_view(_Rng&&, _Fn) -> transform_view, _Fn>; namespace views { - // VARIABLE views::transform class _Transform_fn { private: template @@ -2033,7 +2016,6 @@ namespace ranges { inline constexpr _Transform_fn transform; } // namespace views - // CLASS TEMPLATE ranges::take_view template class take_view : public view_interface> { private: @@ -2200,7 +2182,6 @@ namespace ranges { inline constexpr bool enable_borrowed_range> = enable_borrowed_range<_Rng>; namespace views { - // VARIABLE views::take template inline constexpr bool _Is_subrange = false; template @@ -2335,7 +2316,6 @@ namespace ranges { inline constexpr _Take_fn take; } // namespace views - // CLASS TEMPLATE ranges::take_while_view // clang-format off template requires input_range<_Vw> && is_object_v<_Pr> && indirect_unary_predicate> @@ -2483,7 +2463,6 @@ namespace ranges { take_while_view(_Rng&&, _Pr) -> take_while_view, _Pr>; namespace views { - // VARIABLE views::take_while class _Take_while_fn { private: template @@ -2522,7 +2501,6 @@ namespace ranges { inline constexpr _Take_while_fn take_while; } // namespace views - // CLASS TEMPLATE ranges::drop_view template class drop_view : public _Cached_position_t && !(random_access_range<_Vw> && sized_range<_Vw>), _Vw, drop_view<_Vw>> { @@ -2645,7 +2623,6 @@ namespace ranges { inline constexpr bool enable_borrowed_range> = enable_borrowed_range<_Rng>; namespace views { - // VARIABLE views::drop class _Drop_fn { private: enum class _St { _Empty, _Reconstruct_span, _Reconstruct_subrange, _Reconstruct_other, _Drop_view }; @@ -2771,7 +2748,6 @@ namespace ranges { inline constexpr _Drop_fn drop; } // namespace views - // CLASS TEMPLATE ranges::drop_while_view // clang-format off template requires input_range<_Vw> && is_object_v<_Pr> && indirect_unary_predicate> @@ -2836,7 +2812,6 @@ namespace ranges { inline constexpr bool enable_borrowed_range> = enable_borrowed_range<_Rng>; namespace views { - // VARIABLE views::drop_while class _Drop_while_fn { private: template @@ -2875,7 +2850,6 @@ namespace ranges { inline constexpr _Drop_while_fn drop_while; } // namespace views - // CLASS TEMPLATE ranges::join_view // clang-format off template requires (view<_Vw> && input_range> @@ -3234,7 +3208,6 @@ namespace ranges { explicit join_view(_Rng&&) -> join_view>; namespace views { - // VARIABLE views::join class _Join_fn : public _Pipe::_Base<_Join_fn> { public: // clang-format off @@ -3251,7 +3224,6 @@ namespace ranges { inline constexpr _Join_fn join; } // namespace views - // CLASS TEMPLATE ranges::split_view // clang-format off template concept _Tiny_range = sized_range<_Ty> @@ -3628,7 +3600,6 @@ namespace ranges { split_view(_Rng&&, range_value_t<_Rng>) -> split_view, single_view>>; namespace views { - // VARIABLE views::split class _Split_fn { private: template @@ -3673,7 +3644,6 @@ namespace ranges { inline constexpr _Split_fn split; - // VARIABLE views::counted class _Counted_fn { private: enum class _St { _Span, _Subrange, _Subrange_counted }; @@ -3719,7 +3689,6 @@ namespace ranges { inline constexpr _Counted_fn counted; } // namespace views - // CLASS TEMPLATE ranges::common_view // clang-format off template requires (!common_range<_Vw> && copyable>) @@ -3796,7 +3765,6 @@ namespace ranges { inline constexpr bool enable_borrowed_range> = enable_borrowed_range<_Rng>; namespace views { - // VARIABLE views::common class _Common_fn : public _Pipe::_Base<_Common_fn> { private: enum class _St { _None, _All, _Common }; @@ -3836,7 +3804,6 @@ namespace ranges { inline constexpr _Common_fn common; } // namespace views - // CLASS TEMPLATE ranges::reverse_view // clang-format off template requires bidirectional_range<_Vw> @@ -3914,7 +3881,6 @@ namespace ranges { inline constexpr bool enable_borrowed_range> = enable_borrowed_range<_Rng>; namespace views { - // VARIABLE views::reverse template concept _Can_extract_base = requires(_Rng&& __r) { static_cast<_Rng&&>(__r).base(); @@ -3989,7 +3955,6 @@ namespace ranges { inline constexpr _Reverse_fn reverse; } // namespace views - // CLASS TEMPLATE ranges::elements_view template concept _Has_tuple_element = requires(_Tuple __t) { typename tuple_size<_Tuple>::type; @@ -4375,7 +4340,6 @@ namespace ranges { using values_view = elements_view, 1>; namespace views { - // VARIABLE views::elements template class _Elements_fn : public _Pipe::_Base<_Elements_fn<_Index>> { public: diff --git a/stl/inc/ratio b/stl/inc/ratio index f8562fb72c7..cc259f050c8 100644 --- a/stl/inc/ratio +++ b/stl/inc/ratio @@ -19,11 +19,9 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// STRUCT TEMPLATE _Abs template struct _Abs : integral_constant {}; // computes absolute value of _Val -// STRUCT TEMPLATE _Safe_mult template ::value <= INTMAX_MAX / (_Bx == 0 ? 1 : _Abs<_Bx>::value))> struct _Safe_mult : integral_constant {}; // computes _Ax * _Bx without overflow @@ -33,11 +31,9 @@ struct _Safe_mult<_Ax, _Bx, _Sfinae, false> { // _Ax * _Bx would overflow static_assert(_Sfinae, "integer arithmetic overflow"); }; -// STRUCT TEMPLATE _Sign_of template struct _Sign_of : integral_constant {}; // computes sign of _Val -// STRUCT TEMPLATE _Safe_add template struct _Safe_addX : integral_constant {}; // computes _Ax + _Bx without overflow @@ -52,7 +48,6 @@ struct _Safe_add : _Safe_addX<_Ax, _Bx, _Sign_of<_Ax>::value != _Sign_of<_Bx>::v // computes _Ax + _Bx, forbids overflow }; -// STRUCT TEMPLATE _Gcd template struct _GcdX : _GcdX<_Bx, _Ax % _Bx>::type {}; // computes GCD of _Ax and _Bx @@ -67,7 +62,6 @@ struct _Gcd<0, 0> : integral_constant { // contrary to mathematical convention; avoids division by 0 in ratio_less }; -// STRUCT TEMPLATE ratio template struct ratio { // holds the ratio of _Nx to _Dx static_assert(_Dx != 0, "zero denominator"); @@ -82,14 +76,12 @@ struct ratio { // holds the ratio of _Nx to _Dx using type = ratio; }; -// VARIABLE TEMPLATE _Is_ratio_v template _INLINE_VAR constexpr bool _Is_ratio_v = false; // test for ratio type template _INLINE_VAR constexpr bool _Is_ratio_v> = true; -// ALIAS TEMPLATE ratio_add template struct _Ratio_add { // add two ratios static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_add requires R1 and R2 to be ratio<>s."); @@ -110,7 +102,6 @@ struct _Ratio_add { // add two ratios template using ratio_add = typename _Ratio_add<_Rx1, _Rx2>::type; -// ALIAS TEMPLATE ratio_subtract template struct _Ratio_subtract { // subtract two ratios static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_subtract requires R1 and R2 to be ratio<>s."); @@ -124,7 +115,6 @@ struct _Ratio_subtract { // subtract two ratios template using ratio_subtract = typename _Ratio_subtract<_Rx1, _Rx2>::type; -// ALIAS TEMPLATE ratio_multiply template struct _Ratio_multiply { // multiply two ratios static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_multiply requires R1 and R2 to be ratio<>s."); @@ -156,7 +146,6 @@ struct _Ratio_multiply_sfinae<_Rx1, _Rx2, _Sfinae, template using ratio_multiply = typename _Ratio_multiply_sfinae<_Rx1, _Rx2, false>::type; -// ALIAS TEMPLATE ratio_divide template struct _Ratio_divide { // divide two ratios static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_divide requires R1 and R2 to be ratio<>s."); @@ -174,7 +163,6 @@ using _Ratio_divide_sfinae = template using ratio_divide = _Ratio_divide_sfinae<_Rx1, _Rx2, false>; -// STRUCT TEMPLATE ratio_equal template struct ratio_equal : bool_constant<_Rx1::num == _Rx2::num && _Rx1::den == _Rx2::den> { // tests if ratio == ratio static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_equal requires R1 and R2 to be ratio<>s."); @@ -183,7 +171,6 @@ struct ratio_equal : bool_constant<_Rx1::num == _Rx2::num && _Rx1::den == _Rx2:: template _INLINE_VAR constexpr bool ratio_equal_v = ratio_equal<_Rx1, _Rx2>::value; -// STRUCT TEMPLATE ratio_not_equal template struct ratio_not_equal : bool_constant> { // tests if ratio != ratio static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_not_equal requires R1 and R2 to be ratio<>s."); @@ -192,7 +179,6 @@ struct ratio_not_equal : bool_constant> { // tests if template _INLINE_VAR constexpr bool ratio_not_equal_v = ratio_not_equal<_Rx1, _Rx2>::value; -// STRUCT TEMPLATE ratio_less struct _Big_uint128 { uint64_t _Upper; uint64_t _Lower; @@ -249,7 +235,6 @@ struct ratio_less : bool_constant<_Ratio_less(_Rx1::num, _Rx1::den, _Rx2::num, _ template _INLINE_VAR constexpr bool ratio_less_v = ratio_less<_Rx1, _Rx2>::value; -// STRUCT TEMPLATE ratio_less_equal template struct ratio_less_equal : bool_constant> { // tests if ratio <= ratio static_assert( @@ -259,7 +244,6 @@ struct ratio_less_equal : bool_constant> { // tests if template _INLINE_VAR constexpr bool ratio_less_equal_v = ratio_less_equal<_Rx1, _Rx2>::value; -// STRUCT TEMPLATE ratio_greater template struct ratio_greater : ratio_less<_Rx2, _Rx1>::type { // tests if ratio > ratio static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_greater requires R1 and R2 to be ratio<>s."); @@ -268,7 +252,6 @@ struct ratio_greater : ratio_less<_Rx2, _Rx1>::type { // tests if ratio > ratio template _INLINE_VAR constexpr bool ratio_greater_v = ratio_greater<_Rx1, _Rx2>::value; -// STRUCT TEMPLATE ratio_greater_equal template struct ratio_greater_equal : bool_constant> { // tests if ratio >= ratio static_assert( @@ -278,7 +261,6 @@ struct ratio_greater_equal : bool_constant> { // tests template _INLINE_VAR constexpr bool ratio_greater_equal_v = ratio_greater_equal<_Rx1, _Rx2>::value; -// SI TYPEDEFS using atto = ratio<1, 1000000000000000000LL>; using femto = ratio<1, 1000000000000000LL>; using pico = ratio<1, 1000000000000LL>; diff --git a/stl/inc/regex b/stl/inc/regex index d17ea56bb56..61d7a4d8681 100644 --- a/stl/inc/regex +++ b/stl/inc/regex @@ -58,7 +58,6 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN -// NAMED CONSTANTS enum _Meta_type { // meta character representations for parser _Meta_lpar = '(', _Meta_rpar = ')', @@ -100,7 +99,6 @@ enum _Meta_type { // meta character representations for parser _Esc_uni = 'u' }; -// NAMESPACE regex_constants namespace regex_constants { // constants used in regular expressions enum syntax_option_type : int { // specify RE syntax rules @@ -161,7 +159,6 @@ namespace regex_constants { [[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xregex_error(regex_constants::error_type _Code); -// CLASS TEMPLATE regex_traits template class regex_traits; @@ -389,7 +386,6 @@ private: locale_type _Loc; }; -// CLASS regex_traits template <> class regex_traits : public _Regex_traits { public: @@ -414,7 +410,6 @@ public: } }; -// CLASS regex_traits template <> class regex_traits : public _Regex_traits { public: @@ -439,7 +434,6 @@ public: } }; -// CLASS regex_error class regex_error : public runtime_error { // type of all regular expression exceptions public: explicit regex_error(regex_constants::error_type _Ex) : runtime_error(_Stringify(_Ex)), _Err(_Ex) {} @@ -507,7 +501,6 @@ private: regex_constants::error_type _Err; }; -// FUNCTION TEMPLATE _Iter_compare template int _Iter_compare3(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, true_type) { // _Iter_compare for memory buffer ranges @@ -562,7 +555,6 @@ int _Iter_compare(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Las _Get_unwrapped(_First1), _Get_unwrapped(_Last1), _Get_unwrapped(_First2), _Get_unwrapped(_Last2)); } -// FUNCTION TEMPLATE _Is_word inline bool _Is_word(unsigned char _UCh) { // special casing char to avoid branches for std::regex in this path static constexpr bool _Is_word_table[(numeric_limits::max) () + 1] = { @@ -605,7 +597,6 @@ struct _Get_member_comparison_category<_Ty, void_t class sub_match : public pair<_BidIt, _BidIt> { // class to hold contents of a capture group public: @@ -757,7 +748,6 @@ _NODISCARD bool operator>=(const sub_match<_BidIt>& _Left, const sub_match<_BidI } #endif // !_HAS_CXX20 -// COMPARE sub_match AND NTBS template _NODISCARD bool operator==(const sub_match<_BidIt>& _Left, const _Iter_value_t<_BidIt>* _Right) { return _Left._Match_equal(_Right); @@ -825,7 +815,6 @@ _NODISCARD bool operator>=(const sub_match<_BidIt>& _Left, const _Iter_value_t<_ } #endif // !_HAS_CXX20 -// COMPARE sub_match AND ELEMENT template _NODISCARD bool operator==(const sub_match<_BidIt>& _Left, const _Iter_value_t<_BidIt>& _Right) { return _Left._Match_equal(_STD addressof(_Right), 1); @@ -894,7 +883,6 @@ _NODISCARD bool operator>=(const sub_match<_BidIt>& _Left, const _Iter_value_t<_ } #endif // !_HAS_CXX20 -// COMPARE sub_match AND string template _NODISCARD bool operator==( const sub_match<_BidIt>& _Left, const basic_string<_Iter_value_t<_BidIt>, _Traits, _Alloc>& _Right) { @@ -975,13 +963,11 @@ _NODISCARD bool operator>=( } #endif // !_HAS_CXX20 -// INSERT sub_match IN STREAM template basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, const sub_match<_BidIt>& _Match) { return _Ostr << _Match.str(); } -// FORWARD DECLARATIONS template >> class match_results; @@ -993,7 +979,6 @@ template _OutIt _Format_sed(const match_results<_BidIt, _Alloc>& _Match, _OutIt _Out, _InIt _First, _InIt _Last, regex_constants::match_flag_type _Flags = regex_constants::format_default); -// CLASS TEMPLATE match_results template class match_results { // class to hold contents of all capture groups public: @@ -1188,7 +1173,6 @@ _NODISCARD bool operator!=(const match_results<_BidIt, _Alloc>& _Left, const mat } #endif // !_HAS_CXX20 -// NFA PROPERTIES const unsigned int _BRE_MAX_GRP = 9U; const unsigned int _Bmp_max = 256U; // must fit in an unsigned int @@ -1235,7 +1219,6 @@ enum _Node_type { // type flag for nfa nodes _N_end }; -// STRUCT TEMPLATE _Buf template struct _Buf { // character buffer _Buf() : _Sz(0), _Nchrs(0), _Chrs(nullptr) {} @@ -1295,7 +1278,6 @@ private: _Elem* _Chrs; }; -// STRUCT _Bitmap struct _Bitmap { // accelerator table for small character values _Bitmap() { _CSTD memset(_Chrs, '\0', _Bmp_size); @@ -1319,7 +1301,6 @@ private: unsigned char _Chrs[_Bmp_size]; }; -// STRUCT TEMPLATE _Sequence template struct _Sequence { // holds sequences of _Sz elements explicit _Sequence(unsigned int _Len) : _Sz(_Len) {} @@ -1329,7 +1310,6 @@ struct _Sequence { // holds sequences of _Sz elements _Sequence* _Next; }; -// CLASS _Node_base class _Node_base { // base class for all nfa nodes public: explicit _Node_base(_Node_type _Ty, _Node_flags _Fl = _Fl_none) @@ -1343,7 +1323,6 @@ public: virtual ~_Node_base() noexcept {} }; -// FUNCTION _Destroy_node inline void _Destroy_node(_Node_base* _Nx, _Node_base* _Ne = nullptr) noexcept { // destroy sublist of nodes while (_Nx != _Ne && _Nx) { // destroy node _Node_base* _Tmp = _Nx; @@ -1353,7 +1332,6 @@ inline void _Destroy_node(_Node_base* _Nx, _Node_base* _Ne = nullptr) noexcept { } } -// CLASS _Root_node class _Root_node : public _Node_base { // root of parse tree public: _Root_node() : _Node_base(_N_begin), _Loops(0), _Marks(0), _Refs(0) { @@ -1366,7 +1344,6 @@ public: unsigned int _Refs; }; -// CLASS _Node_end_group class _Node_end_group : public _Node_base { // node that marks end of a group public: _Node_end_group(_Node_type _Ty, _Node_flags _Fl, _Node_base* _Bx) : _Node_base(_Ty, _Fl), _Back(_Bx) {} @@ -1374,7 +1351,6 @@ public: _Node_base* _Back; }; -// CLASS _Node_assert class _Node_assert : public _Node_base { // node that holds an ECMAScript assertion public: explicit _Node_assert(_Node_type _Ty, _Node_flags _Fl = _Fl_none) : _Node_base(_Ty, _Fl), _Child(nullptr) {} @@ -1386,7 +1362,6 @@ public: _Node_base* _Child; }; -// CLASS TEMPLATE _Node_capture class _Node_capture : public _Node_base { // node that marks beginning of a capture group public: explicit _Node_capture(unsigned int _Ix) : _Node_base(_N_capture, _Fl_none), _Idx(_Ix) {} @@ -1394,7 +1369,6 @@ public: unsigned int _Idx; }; -// CLASS _Node_back class _Node_back : public _Node_base { // node that holds a back reference public: explicit _Node_back(unsigned int _Ix) : _Node_base(_N_back, _Fl_none), _Idx(_Ix) {} @@ -1402,7 +1376,6 @@ public: unsigned int _Idx; }; -// CLASS TEMPLATE _Node_str template class _Node_str : public _Node_base { // node that holds text public: @@ -1411,7 +1384,6 @@ public: _Buf<_Elem> _Data; }; -// CLASS TEMPLATE _Node_class template class _Node_class : public _Node_base { // node that holds a character class (POSIX bracket expression) public: @@ -1443,13 +1415,11 @@ public: _Sequence<_Elem>* _Equiv; }; -// CLASS _Node_endif class _Node_endif : public _Node_base { // node that marks the end of an alternative public: _Node_endif() : _Node_base(_N_endif, _Fl_none) {} }; -// CLASS _Node_if class _Node_if : public _Node_base { // node that marks the beginning of an alternative public: explicit _Node_if(_Node_base* _End) @@ -1469,7 +1439,6 @@ public: _Node_if* _Child; }; -// CLASS _Node_end_rep class _Node_rep; class _Node_end_rep : public _Node_base { // node that marks the end of a repetition @@ -1481,13 +1450,11 @@ public: _Node_end_rep& operator=(const _Node_end_rep&) = delete; }; -// CLASS _Loop_vals_t struct _Loop_vals_t { // storage for loop administration int _Loop_idx; void* _Loop_iter; }; -// CLASS _Node_rep class _Node_rep : public _Node_base { // node that marks the beginning of a repetition public: _Node_rep(bool _Greedy, int _Mn, int _Mx, _Node_end_rep* _End, unsigned int _Number) @@ -1503,7 +1470,6 @@ public: _Node_rep& operator=(const _Node_rep&) = delete; }; -// CLASS TEMPLATE _Builder template class _Builder { // provides operations used by _Parser to build the nfa public: @@ -1566,7 +1532,6 @@ public: _Builder& operator=(const _Builder&) = delete; }; -// CLASS TEMPLATE _Bt_state_t template class _Bt_state_t { // holds the state needed for backtracking public: @@ -1574,7 +1539,6 @@ public: vector _Grp_valid; }; -// CLASS TEMPLATE _Tgt_state_t template class _Tgt_state_t : public _Bt_state_t<_BidIt> { // holds the current state of the match public: @@ -1590,7 +1554,6 @@ public: } }; -// CLASS TEMPLATE _Matcher template class _Matcher { // provides ways to match a regular expression to a text sequence public: @@ -1711,7 +1674,6 @@ enum _Prs_ret { // indicate class element type _Prs_set }; -// CLASS TEMPLATE _Parser template class _Parser { // parse a regular expression public: @@ -1807,7 +1769,6 @@ enum _Lang_flags { // describe language properties _L_mtch_long = 0x40000000, // find longest match (ERE, BRE) }; -// CLASS _Regex_base class _Regex_base : public _Container_base { // base class for basic_regex to construct and destroy proxy public: #if 0 < _ITERATOR_DEBUG_LEVEL @@ -1824,7 +1785,6 @@ public: #endif // 0 < _ITERATOR_DEBUG_LEVEL }; -// CLASS TEMPLATE basic_regex template > class basic_regex : public _Regex_base { // regular expression public: @@ -2095,7 +2055,6 @@ using wcmatch = match_results; using smatch = match_results; using wsmatch = match_results; -// FUNCTION TEMPLATE _Format_default template _OutIt _Format_default(const match_results<_BidIt, _Alloc>& _Match, _OutIt _Out, _InIt _First, _InIt _Last, regex_constants::match_flag_type) { // format with ECMAScript rules @@ -2142,7 +2101,6 @@ _OutIt _Format_default(const match_results<_BidIt, _Alloc>& _Match, _OutIt _Out, return _Out; } -// FUNCTION TEMPLATE _Format_sed template _OutIt _Format_sed(const match_results<_BidIt, _Alloc>& _Match, _OutIt _Out, _InIt _First, _InIt _Last, regex_constants::match_flag_type) { // format with sed rules @@ -2169,7 +2127,6 @@ _OutIt _Format_sed(const match_results<_BidIt, _Alloc>& _Match, _OutIt _Out, _In return _Out; } -// FUNCTION TEMPLATE _Regex_match1 template bool _Regex_match1(_It _First, _It _Last, match_results<_BidIt, _Alloc>* _Matches, const basic_regex<_Elem, _RxTraits>& _Re, regex_constants::match_flag_type _Flgs, @@ -2183,7 +2140,6 @@ bool _Regex_match1(_It _First, _It _Last, match_results<_BidIt, _Alloc>* _Matche return _Mx._Match(_Matches, _Full); } -// FUNCTION TEMPLATE regex_match template bool regex_match(_BidIt _First, _BidIt _Last, match_results<_BidIt, _Alloc>& _Matches, const basic_regex<_Elem, _RxTraits>& _Re, regex_constants::match_flag_type _Flgs = regex_constants::match_default) { @@ -2240,7 +2196,6 @@ _NODISCARD bool regex_match(const basic_string<_Elem, _StTraits, _StAlloc>& _Str _Re, _Flgs | regex_constants::match_any, true); } -// FUNCTION TEMPLATE _Regex_search2 template bool _Regex_search2(_It _First, _It _Last, match_results<_BidIt, _Alloc>* _Matches, const basic_regex<_Elem, _RxTraits>& _Re, regex_constants::match_flag_type _Flgs, _It _Org) { @@ -2283,7 +2238,6 @@ bool _Regex_search2(_It _First, _It _Last, match_results<_BidIt, _Alloc>* _Match return _Found; } -// FUNCTION TEMPLATE regex_search template bool regex_search(_BidIt _First, _BidIt _Last, match_results<_BidIt, _Alloc>& _Matches, const basic_regex<_Elem, _RxTraits>& _Re, regex_constants::match_flag_type _Flgs = regex_constants::match_default) { @@ -2344,7 +2298,6 @@ _NODISCARD bool regex_search(const basic_string<_Elem, _StTraits, _StAlloc>& _St _First, _Last, static_cast*>(nullptr), _Re, _Flgs | regex_constants::match_any, _First); } -// FUNCTION TEMPLATE regex_replace template _OutIt _Regex_replace1(_OutIt _Result, _BidIt _First, _BidIt _Last, const basic_regex<_Elem, _RxTraits>& _Re, const basic_string<_Elem, _Traits, _Alloc>& _Fmt, regex_constants::match_flag_type _Flgs) { @@ -2439,7 +2392,6 @@ _NODISCARD basic_string<_Elem> regex_replace(const _Elem* _Pstr, const basic_reg return _Res; } -// CLASS TEMPLATE regex_iterator template , class _RxTraits = regex_traits<_Elem>> class regex_iterator : public _Iterator_base { public: @@ -2569,7 +2521,6 @@ using wcregex_iterator = regex_iterator; using sregex_iterator = regex_iterator; using wsregex_iterator = regex_iterator; -// CLASS TEMPLATE regex_token_iterator template , class _RxTraits = regex_traits<_Elem>> class regex_token_iterator { public: @@ -2754,7 +2705,6 @@ using wcregex_token_iterator = regex_token_iterator; using sregex_token_iterator = regex_token_iterator; using wsregex_token_iterator = regex_token_iterator; -// IMPLEMENTATION OF _Builder template _Builder<_FwdIt, _Elem, _RxTraits>::_Builder(const _RxTraits& _Tr, regex_constants::syntax_option_type _Fx) : _Root(new _Root_node), _Current(_Root), _Flags(_Fx), _Traits(_Tr), @@ -3163,7 +3113,6 @@ void _Builder<_FwdIt, _Elem, _RxTraits>::_Tidy() noexcept { // free memory _Root = nullptr; } -// IMPLEMENTATION OF _Matcher template bool _Matcher<_BidIt, _Elem, _RxTraits, _It>::_Do_if(_Node_if* _Node) { // apply if node _Tgt_state_t<_It> _St = _Tgt_state; @@ -3835,7 +3784,6 @@ _BidIt _Matcher<_BidIt, _Elem, _RxTraits, _It>::_Skip(_BidIt _First_arg, _BidIt return _First_arg; } -// IMPLEMENTATION OF _Parser template void _Parser<_FwdIt, _Elem, _RxTraits>::_Error(regex_constants::error_type _Code) { // handle error _Xregex_error(_Code); @@ -4584,7 +4532,6 @@ _Parser<_FwdIt, _Elem, _RxTraits>::_Parser( : _Pat(_Pfirst), _Begin(_Pfirst), _End(_Plast), _Grp_idx(0), _Disj_count(0), _Finished_grps(0), _Nfa(_Tr, _Fx), _Traits(_Tr), _Flags(_Fx) { - // PARSER LANGUAGE FLAGS constexpr unsigned int _ECMA_flags = _L_ext_rep | _L_alt_pipe | _L_nex_grp | _L_nex_rep | _L_nc_grp | _L_asrt_gen | _L_asrt_wrd | _L_bckr | _L_ngr_rep | _L_esc_uni | _L_esc_hex | _L_esc_bsl | _L_esc_ffn | _L_esc_wsd | _L_esc_ctrl | _L_bzr_chr | _L_grp_esc | _L_ident_ECMA diff --git a/stl/inc/scoped_allocator b/stl/inc/scoped_allocator index e35dfaf2db3..2819923a68b 100644 --- a/stl/inc/scoped_allocator +++ b/stl/inc/scoped_allocator @@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// FUNCTION TEMPLATE _Scoped_outermost template struct _Scoped_outermost_helper { // gets the outermost allocator static decltype(auto) _Fn(_Alloc& _Al) { // gets the outermost allocator @@ -41,15 +40,12 @@ decltype(auto) _Scoped_outermost(_Alloc& _Al) { // gets the outermost allocator return _Scoped_outermost_helper<_Alloc>::_Fn(_Al); } -// ALIAS TEMPLATE _Scoped_outermost_t template using _Scoped_outermost_t = remove_reference_t()))>; -// ALIAS TEMPLATE _Scoped_outermost_traits template using _Scoped_outermost_traits = allocator_traits<_Scoped_outermost_t<_Alloc>>; -// CLASS TEMPLATE _Scoped_base template class scoped_allocator_adaptor; @@ -125,7 +121,6 @@ struct _Scoped_base<_Outer> : _Outer { // nest of allocators, one deep } }; -// CLASS TEMPLATE scoped_allocator_adaptor template class scoped_allocator_adaptor : public _Scoped_base<_Outer, _Inner...> { // nest of allocators using _Mybase = _Scoped_base<_Outer, _Inner...>; diff --git a/stl/inc/set b/stl/inc/set index f45bd81991d..ffb4c5cf5b9 100644 --- a/stl/inc/set +++ b/stl/inc/set @@ -21,7 +21,6 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new _STD_BEGIN -// CLASS TEMPLATE _Tset_traits template , class _Alloc = allocator<_Kty>> class set : public _Tree<_Tset_traits<_Kty, _Pr, _Alloc, false>> { // ordered red-black tree of key values, unique keys @@ -229,7 +227,6 @@ typename set<_Kty, _Keylt, _Alloc>::size_type erase_if(set<_Kty, _Keylt, _Alloc> } #endif // _HAS_CXX20 -// CLASS TEMPLATE multiset template , class _Alloc = allocator<_Kty>> class multiset : public _Tree<_Tset_traits<_Kty, _Pr, _Alloc, true>> { // ordered red-black tree of key values, non-unique keys diff --git a/stl/inc/shared_mutex b/stl/inc/shared_mutex index a735ca0938c..87b629d7389 100644 --- a/stl/inc/shared_mutex +++ b/stl/inc/shared_mutex @@ -27,7 +27,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS shared_mutex class shared_mutex { // class for mutual exclusion shared across threads public: using native_handle_type = _Smtx_t*; @@ -74,7 +73,6 @@ private: // shared_timed_mutex is not supported under /clr #ifndef _M_CEE -// CLASS shared_timed_mutex class shared_timed_mutex { // class for mutual exclusion shared across threads using _Read_cnt_t = unsigned int; @@ -231,7 +229,6 @@ private: }; #endif // _M_CEE -// CLASS TEMPLATE shared_lock template class shared_lock { // shareable lock public: @@ -334,7 +331,6 @@ public: _Owns = false; } - // MUTATE void swap(shared_lock& _Right) noexcept { _STD swap(_Pmtx, _Right._Pmtx); _STD swap(_Owns, _Right._Owns); @@ -347,7 +343,6 @@ public: return _Res; } - // OBSERVE _NODISCARD bool owns_lock() const noexcept { return _Owns; } @@ -375,7 +370,6 @@ private: } }; -// SWAP template void swap(shared_lock<_Mutex>& _Left, shared_lock<_Mutex>& _Right) noexcept { _Left.swap(_Right); diff --git a/stl/inc/span b/stl/inc/span index 36a5e9b3181..b68c5c5d621 100644 --- a/stl/inc/span +++ b/stl/inc/span @@ -29,7 +29,6 @@ _STD_BEGIN inline constexpr size_t dynamic_extent = static_cast(-1); -// STRUCT TEMPLATE _Span_iterator template struct _Span_iterator { #ifdef __cpp_lib_concepts @@ -198,7 +197,6 @@ struct pointer_traits<_Span_iterator<_Ty>> { } }; -// STRUCT TEMPLATE _Span_extent_type template struct _Span_extent_type { using pointer = _Ty*; @@ -238,14 +236,12 @@ namespace ranges { inline constexpr bool enable_borrowed_range> = true; } // namespace ranges -// VARIABLE TEMPLATE _Is_span_v template inline constexpr bool _Is_span_v = false; template inline constexpr bool _Is_span_v> = true; -// VARIABLE TEMPLATE _Is_std_array_v template inline constexpr bool _Is_std_array_v = false; @@ -253,17 +249,14 @@ template inline constexpr bool _Is_std_array_v> = true; // clang-format off -// CONCEPT _Span_compatible_iterator template concept _Span_compatible_iterator = contiguous_iterator<_It> && is_convertible_v>(*)[], _Ty(*)[]>; -// CONCEPT _Span_compatible_sentinel template concept _Span_compatible_sentinel = sized_sentinel_for<_Sentinel, _It> && !is_convertible_v<_Sentinel, size_t>; -// CONCEPT _Span_compatible_range template concept _Span_compatible_range = !is_array_v> @@ -276,26 +269,22 @@ concept _Span_compatible_range = // clang-format on #else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv -// STRUCT TEMPLATE _Is_span template struct _Is_span : false_type {}; template struct _Is_span> : true_type {}; -// STRUCT TEMPLATE _Is_std_array template struct _Is_std_array : false_type {}; template struct _Is_std_array> : true_type {}; -// STRUCT TEMPLATE _Is_span_convertible_range template struct _Is_span_convertible_range : bool_constant()))> (*)[], _Ty (*)[]>> {}; -// STRUCT TEMPLATE _Has_container_interface template struct _Has_container_interface : false_type {}; @@ -303,7 +292,6 @@ template struct _Has_container_interface<_Rng, void_t())), decltype(_STD size(_STD declval<_Rng&>()))>> : true_type {}; -// VARIABLE TEMPLATE _Is_span_compatible_range // clang-format off template inline constexpr bool _Is_span_compatible_range = conjunction_v< @@ -317,7 +305,6 @@ inline constexpr bool _Is_span_compatible_range = conjunction_v< #endif // !__cpp_lib_concepts // [views.span] -// CLASS TEMPLATE span template class span : private _Span_extent_type<_Ty, _Extent> { private: @@ -645,7 +632,6 @@ public: } }; -// DEDUCTION GUIDES template span(_Ty (&)[_Extent]) -> span<_Ty, _Extent>; @@ -675,14 +661,12 @@ span(const _Rng&) -> span; #ifdef __cpp_lib_byte // [span.objectrep] Views of object representation -// FUNCTION TEMPLATE as_bytes template _NODISCARD auto as_bytes(span<_Ty, _Extent> _Sp) noexcept { using _ReturnType = span; return _ReturnType{reinterpret_cast(_Sp.data()), _Sp.size_bytes()}; } -// FUNCTION TEMPLATE as_writable_bytes template , int> = 0> _NODISCARD auto as_writable_bytes(span<_Ty, _Extent> _Sp) noexcept { using _ReturnType = span; diff --git a/stl/inc/sstream b/stl/inc/sstream index e18be8fe5ca..19622bced2a 100644 --- a/stl/inc/sstream +++ b/stl/inc/sstream @@ -19,7 +19,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE basic_stringbuf template class basic_stringbuf : public basic_streambuf<_Elem, _Traits> { // stream buffer maintaining an allocated character array @@ -544,7 +543,6 @@ void swap(basic_stringbuf<_Elem, _Traits, _Alloc>& _Left, basic_stringbuf<_Elem, _Left.swap(_Right); } -// CLASS TEMPLATE basic_istringstream template class basic_istringstream : public basic_istream<_Elem, _Traits> { // input stream associated with a character array public: @@ -664,7 +662,6 @@ void swap(basic_istringstream<_Elem, _Traits, _Alloc>& _Left, basic_istringstrea _Left.swap(_Right); } -// CLASS TEMPLATE basic_ostringstream template class basic_ostringstream : public basic_ostream<_Elem, _Traits> { // output stream associated with a character array public: @@ -784,7 +781,6 @@ void swap(basic_ostringstream<_Elem, _Traits, _Alloc>& _Left, basic_ostringstrea _Left.swap(_Right); } -// CLASS TEMPLATE basic_stringstream template class basic_stringstream : public basic_iostream<_Elem, _Traits> { // input/output stream associated with a character array diff --git a/stl/inc/stack b/stl/inc/stack index 6a9a191ba8a..d9f82b5239c 100644 --- a/stl/inc/stack +++ b/stl/inc/stack @@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE stack template > class stack { public: diff --git a/stl/inc/stdexcept b/stl/inc/stdexcept index 844aad34d04..c5e1a3302e1 100644 --- a/stl/inc/stdexcept +++ b/stl/inc/stdexcept @@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new _STD_BEGIN -// CLASS logic_error class logic_error : public exception { // base of all logic-error exceptions public: using _Mybase = exception; @@ -35,7 +34,6 @@ protected: #endif // !_HAS_EXCEPTIONS }; -// CLASS domain_error class domain_error : public logic_error { // base of all domain-error exceptions public: using _Mybase = logic_error; @@ -52,7 +50,6 @@ protected: #endif // !_HAS_EXCEPTIONS }; -// CLASS invalid_argument class invalid_argument : public logic_error { // base of all invalid-argument exceptions public: using _Mybase = logic_error; @@ -69,7 +66,6 @@ protected: #endif // !_HAS_EXCEPTIONS }; -// CLASS length_error class length_error : public logic_error { // base of all length-error exceptions public: using _Mybase = logic_error; @@ -86,7 +82,6 @@ protected: #endif // !_HAS_EXCEPTIONS }; -// CLASS out_of_range class out_of_range : public logic_error { // base of all out-of-range exceptions public: using _Mybase = logic_error; @@ -103,7 +98,6 @@ protected: #endif // !_HAS_EXCEPTIONS }; -// CLASS runtime_error class runtime_error : public exception { // base of all runtime-error exceptions public: using _Mybase = exception; @@ -120,7 +114,6 @@ protected: #endif // !_HAS_EXCEPTIONS }; -// CLASS overflow_error class overflow_error : public runtime_error { // base of all overflow-error exceptions public: using _Mybase = runtime_error; @@ -137,7 +130,6 @@ protected: #endif // !_HAS_EXCEPTIONS }; -// CLASS underflow_error class underflow_error : public runtime_error { // base of all underflow-error exceptions public: using _Mybase = runtime_error; @@ -154,7 +146,6 @@ protected: #endif // !_HAS_EXCEPTIONS }; -// CLASS range_error class range_error : public runtime_error { // base of all range-error exceptions public: using _Mybase = runtime_error; diff --git a/stl/inc/streambuf b/stl/inc/streambuf index ce41dd05566..081b1ff9820 100644 --- a/stl/inc/streambuf +++ b/stl/inc/streambuf @@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// CLASS TEMPLATE basic_streambuf template class basic_streambuf { // control read/write buffers protected: diff --git a/stl/inc/string b/stl/inc/string index e298a1b771d..41cb4877fd4 100644 --- a/stl/inc/string +++ b/stl/inc/string @@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// FUNCTION TEMPLATE getline template basic_istream<_Elem, _Traits>& getline(basic_istream<_Elem, _Traits>&& _Istr, basic_string<_Elem, _Traits, _Alloc>& _Str, @@ -84,7 +83,6 @@ basic_istream<_Elem, _Traits>& getline(basic_istream<_Elem, _Traits>& _Istr, return getline(_STD move(_Istr), _Str, _Istr.widen('\n')); } -// sto* NARROW CONVERSIONS _NODISCARD inline int stoi(const string& _Str, size_t* _Idx = nullptr, int _Base = 10) { // convert string to int int& _Errno_ref = errno; // Nonzero cost, pay it once @@ -266,7 +264,6 @@ _NODISCARD inline long double stold(const string& _Str, size_t* _Idx = nullptr) return _Ans; } -// sto* WIDE CONVERSIONS _NODISCARD inline int stoi(const wstring& _Str, size_t* _Idx = nullptr, int _Base = 10) { // convert wstring to int int& _Errno_ref = errno; // Nonzero cost, pay it once @@ -448,7 +445,6 @@ _NODISCARD inline long double stold(const wstring& _Str, size_t* _Idx = nullptr) return _Ans; } -// HELPERS FOR to_string AND to_wstring AND operator<<(duration) template _NODISCARD _Elem* _UIntegral_to_buff(_Elem* _RNext, _UTy _UVal) { // format _UVal into buffer *ending at* _RNext static_assert(is_unsigned_v<_UTy>, "_UTy must be unsigned"); @@ -509,7 +505,6 @@ _NODISCARD basic_string<_Elem> _UIntegral_to_string(const _Ty _Val) { // convert return basic_string<_Elem>(_RNext, _Buff_end); } -// to_string NARROW CONVERSIONS _NODISCARD inline string to_string(int _Val) { // convert int to string return _Integral_to_string(_Val); } @@ -549,7 +544,6 @@ _NODISCARD inline string to_string(long double _Val) { // convert long double to return _STD to_string(static_cast(_Val)); } -// to_wstring WIDE CONVERSIONS _NODISCARD inline wstring to_wstring(int _Val) { // convert int to wstring return _Integral_to_string(_Val); } diff --git a/stl/inc/strstream b/stl/inc/strstream index d90ed93ca24..2ee1a17e78e 100644 --- a/stl/inc/strstream +++ b/stl/inc/strstream @@ -22,7 +22,6 @@ _STD_BEGIN _CXX17_DEPRECATE_STRSTREAM typedef int _Header_strstream; using _Hdr_strstream = _Header_strstream; -// CLASS strstreambuf class strstreambuf : public streambuf { // stream buffer associated with static or allocated character array public: using _Mysb = streambuf; @@ -420,12 +419,10 @@ private: void(__CLRCALL_OR_CDECL* _Pfree)(void*); // the pointer to free function }; -// strstreambuf OPERATORS inline void swap(strstreambuf& _Left, strstreambuf& _Right) { _Left.swap(_Right); } -// CLASS istrstream class istrstream : public istream { // input stream associated with a character array public: using _Mybase = istream; @@ -485,12 +482,10 @@ private: _Mysb _Strbuffer; // the string buffer }; -// istrstream OPERATORS inline void swap(istrstream& _Left, istrstream& _Right) { _Left.swap(_Right); } -// CLASS ostrstream class ostrstream : public ostream { // output stream associated with a character array public: using _Mybase = ostream; @@ -549,12 +544,10 @@ private: _Mysb _Strbuffer; // the string buffer }; -// ostrstream OPERATORS inline void swap(ostrstream& _Left, ostrstream& _Right) { _Left.swap(_Right); } -// CLASS strstream class strstream : public iostream { // input/output stream associated with character array buffer public: using _Mybase = iostream; @@ -618,7 +611,6 @@ private: _Mysb _Strbuffer; // the string buffer }; -// strstream OPERATORS inline void swap(strstream& _Left, strstream& _Right) { _Left.swap(_Right); } diff --git a/stl/inc/syncstream b/stl/inc/syncstream index 434a1cd7a7f..9668a224a05 100644 --- a/stl/inc/syncstream +++ b/stl/inc/syncstream @@ -32,7 +32,6 @@ _END_EXTERN_C _STD_BEGIN -// CLASS TEMPLATE _Basic_syncbuf_impl template class _Basic_syncbuf_impl : public basic_streambuf<_Elem, _Traits> { public: @@ -67,7 +66,6 @@ protected: bool _Sync_recorded{false}; }; -// CLASS TEMPLATE basic_syncbuf template class basic_syncbuf : public _Basic_syncbuf_impl<_Elem, _Traits> { public: @@ -319,7 +317,6 @@ void swap(basic_syncbuf<_Elem, _Traits, _Alloc>& _Left, _Left.swap(_Right); } -// CLASS TEMPLATE basic_osyncstream template class basic_osyncstream : public basic_ostream<_Elem, _Traits> { public: diff --git a/stl/inc/system_error b/stl/inc/system_error index a9b527db251..0eaea9facf4 100644 --- a/stl/inc/system_error +++ b/stl/inc/system_error @@ -30,12 +30,10 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// ENUM CLASS io_errc enum class io_errc { // error codes for ios_base::failure stream = 1 }; -// STRUCT TEMPLATE is_error_code_enum template struct is_error_code_enum : false_type {}; @@ -45,7 +43,6 @@ struct is_error_code_enum : true_type {}; template _INLINE_VAR constexpr bool is_error_code_enum_v = is_error_code_enum<_Ty>::value; -// STRUCT TEMPLATE is_error_condition_enum template struct is_error_condition_enum : false_type {}; @@ -62,7 +59,6 @@ _NODISCARD error_code make_error_code(io_errc) noexcept; _NODISCARD error_condition make_error_condition(errc) noexcept; _NODISCARD error_condition make_error_condition(io_errc) noexcept; -// CLASS error_category class error_category; _NODISCARD const error_category& generic_category() noexcept; @@ -131,7 +127,6 @@ protected: _NODISCARD inline bool _System_error_equal(const error_code&, const error_condition&) noexcept; #endif // _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS -// CLASS error_code class error_code { // store an implementation-specific error code and category public: error_code() noexcept : _Myval(0), _Mycat(&_STD system_category()) {} // construct non-error @@ -224,7 +219,6 @@ private: const error_category* _Mycat; // pointer to error category }; -// CLASS error_condition class error_condition { // store an abstract error code and category public: error_condition() noexcept : _Myval(0), _Mycat(&_STD generic_category()) {} // construct non-error @@ -377,7 +371,6 @@ _NODISCARD inline bool operator!=(const error_condition& _Left, const error_cond #endif // !_HAS_CXX20 #endif // _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS -// VIRTUALS FOR error_category _NODISCARD inline error_condition error_category::default_error_condition(int _Errval) const noexcept { // make error_condition for error code return error_condition(_Errval, *this); @@ -391,13 +384,11 @@ _NODISCARD inline bool error_category::equivalent(const error_code& _Code, int _ return *this == _Code.category() && _Code.value() == _Errval; } -// MEMBER FUNCTIONS for error_code _NODISCARD inline error_condition error_code::default_error_condition() const noexcept { // make error_condition for error code return category().default_error_condition(value()); } -// FUNCTION make_error_code _NODISCARD inline error_code make_error_code(errc _Errno) noexcept { return error_code(static_cast(_Errno), _STD generic_category()); } @@ -406,7 +397,6 @@ _NODISCARD inline error_code make_error_code(io_errc _Errno) noexcept { return error_code(static_cast(_Errno), _STD iostream_category()); } -// FUNCTION make_error_condition _NODISCARD inline error_condition make_error_condition(errc _Errno) noexcept { return error_condition(static_cast(_Errno), _STD generic_category()); } @@ -415,7 +405,6 @@ _NODISCARD inline error_condition make_error_condition(io_errc _Errno) noexcept return error_condition(static_cast(_Errno), _STD iostream_category()); } -// STRUCT TEMPLATE SPECIALIZATION hash template <> struct hash { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef error_code _ARGUMENT_TYPE_NAME; @@ -436,7 +425,6 @@ struct hash { } }; -// CLASS system_error class _System_error : public runtime_error { // base of all system-error exceptions private: static string _Makestr(error_code _Errcode, string _Message) { // compose error message diff --git a/stl/inc/thread b/stl/inc/thread index 48275183c09..ef864b20b5f 100644 --- a/stl/inc/thread +++ b/stl/inc/thread @@ -276,7 +276,6 @@ basic_ostream<_Ch, _Tr>& operator<<(basic_ostream<_Ch, _Tr>& _Str, thread::id _I return _Str << _Id._Id; } -// STRUCT TEMPLATE SPECIALIZATION hash template <> struct hash { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef thread::id _ARGUMENT_TYPE_NAME; diff --git a/stl/inc/tuple b/stl/inc/tuple index 6e69ab4f25b..8fae9205b56 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -23,7 +23,6 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #if _HAS_CONDITIONAL_EXPLICIT -// VARIABLE TEMPLATE _Tuple_conditional_explicit_v template _INLINE_VAR constexpr bool _Tuple_conditional_explicit_v0 = false; @@ -35,7 +34,6 @@ template _INLINE_VAR constexpr bool _Tuple_conditional_explicit_v = _Tuple_conditional_explicit_v0 == sizeof...(_Srcs), _Dest, _Srcs...>; #else // ^^^ _HAS_CONDITIONAL_EXPLICIT ^^^ / vvv !_HAS_CONDITIONAL_EXPLICIT vvv -// STRUCT TEMPLATE _Tuple_implicit_val // Constrain tuple's implicit constructors template _INLINE_VAR constexpr bool _Tuple_implicit_v0 = false; @@ -48,7 +46,6 @@ template struct _Tuple_implicit_val : bool_constant<_Tuple_implicit_v0 == sizeof...(_Srcs), _Dest, _Srcs...>> {}; -// STRUCT TEMPLATE _Tuple_explicit_val // Constrain tuple's explicit constructors template _INLINE_VAR constexpr bool _Tuple_explicit_v0 = false; @@ -62,7 +59,6 @@ struct _Tuple_explicit_val : bool_constant<_Tuple_explicit_v0 == sizeof...(_Srcs), _Dest, _Srcs...>> {}; #endif // ^^^ !_HAS_CONDITIONAL_EXPLICIT ^^^ -// VARIABLE TEMPLATE _Tuple_constructible_v template _INLINE_VAR constexpr bool _Tuple_constructible_v0 = false; @@ -77,7 +73,6 @@ _INLINE_VAR constexpr bool _Tuple_constructible_v = template struct _Tuple_constructible_val : bool_constant<_Tuple_constructible_v<_Dest, _Srcs...>> {}; -// VARIABLE TEMPLATE _Tuple_nothrow_constructible_v template _INLINE_VAR constexpr bool _Tuple_nothrow_constructible_v0 = false; @@ -89,7 +84,6 @@ template _INLINE_VAR constexpr bool _Tuple_nothrow_constructible_v = _Tuple_nothrow_constructible_v0 == sizeof...(_Srcs), _Dest, _Srcs...>; -// VARIABLE TEMPLATE _Tuple_assignable_v template _INLINE_VAR constexpr bool _Tuple_assignable_v0 = false; @@ -104,7 +98,6 @@ _INLINE_VAR constexpr bool _Tuple_assignable_v = template struct _Tuple_assignable_val : bool_constant<_Tuple_assignable_v<_Dest, _Srcs...>> {}; -// VARIABLE TEMPLATE _Tuple_nothrow_assignable_v template _INLINE_VAR constexpr bool _Tuple_nothrow_assignable_v0 = false; @@ -116,7 +109,6 @@ template _INLINE_VAR constexpr bool _Tuple_nothrow_assignable_v = _Tuple_nothrow_assignable_v0 == sizeof...(_Srcs), _Dest, _Srcs...>; -// STRUCT TEMPLATE _Tuple_convert_copy_val // Constrain tuple's copy converting constructor (LWG-2549) template struct _Tuple_convert_copy_val : true_type {}; @@ -126,7 +118,6 @@ struct _Tuple_convert_copy_val, _Uty> : bool_constant, is_constructible<_This, const tuple<_Uty>&>, is_convertible&, _This>>> {}; -// STRUCT TEMPLATE _Tuple_convert_move_val // Constrain tuple's move converting constructor (LWG-2549) template struct _Tuple_convert_move_val : true_type {}; @@ -136,7 +127,6 @@ struct _Tuple_convert_move_val, _Uty> : bool_constant, is_constructible<_This, tuple<_Uty>>, is_convertible, _This>>> {}; -// STRUCT TEMPLATE _Tuple_perfect_val // Constrain tuple's perfect forwarding constructor (LWG-3121) template struct _Tuple_perfect_val : true_type {}; @@ -145,7 +135,6 @@ template struct _Tuple_perfect_val<_Myself, _This2> : bool_constant>>> {}; -// STRUCT _Ignore struct _Ignore { // struct that ignores assignments template constexpr const _Ignore& operator=(const _Ty&) const noexcept /* strengthened */ { @@ -161,7 +150,6 @@ _INLINE_VAR constexpr _Ignore ignore{}; // some class - including injected-class-names! - that we know are not members of the class being defined. // This avoids pointless class-member lookup for those names in this context. -// STRUCT TEMPLATE _Tuple_val template struct _Tuple_val { // stores each value in a tuple constexpr _Tuple_val() : _Val() {} @@ -189,7 +177,6 @@ struct _Tuple_val { // stores each value in a tuple _Ty _Val; }; -// CLASS TEMPLATE tuple struct _Exact_args_t { explicit _Exact_args_t() = default; }; // tag type to disambiguate construction (from one arg per element) @@ -747,7 +734,6 @@ template tuple(allocator_arg_t, _Alloc, tuple<_Types...>) -> tuple<_Types...>; #endif // _HAS_CXX17 -// OPERATORS FOR tuple template _NODISCARD constexpr bool operator==(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right) { static_assert(sizeof...(_Types1) == sizeof...(_Types2), "cannot compare tuples of different sizes"); @@ -796,7 +782,6 @@ _CONSTEXPR20 void swap(tuple<_Types...>& _Left, tuple<_Types...>& _Right) noexce return _Left.swap(_Right); } -// CLASS _Tuple_element (find element by type) template struct _Tuple_element {}; // backstop _Tuple_element definition @@ -811,7 +796,6 @@ struct _Tuple_element<_Ty, tuple<_This, _Rest...>> { // recursive _Tuple_element using _Ttype = typename _Tuple_element<_Ty, tuple<_Rest...>>::_Ttype; }; -// FUNCTION TEMPLATE get (by index) template _NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>& get(tuple<_Types...>& _Tuple) noexcept { using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype; @@ -846,7 +830,6 @@ _NODISCARD constexpr auto&& _Tuple_get(tuple<_Types...>&& _Tuple) noexcept { return static_cast<_Ty&&>(static_cast<_Ttype&>(_Tuple)._Myfirst._Val); } -// FUNCTION TEMPLATE get (by type) template _NODISCARD constexpr _Ty& get(tuple<_Types...>& _Tuple) noexcept { using _Ttype = typename _Tuple_element<_Ty, tuple<_Types...>>::_Ttype; @@ -871,7 +854,6 @@ _NODISCARD constexpr const _Ty&& get(const tuple<_Types...>&& _Tuple) noexcept { return static_cast(static_cast(_Tuple)._Myfirst._Val); } -// CONSTRUCTOR TEMPLATES FOR tuple template template , int>> constexpr tuple<_This, _Rest...>::tuple(_Tag, _Tpl&& _Right, index_sequence<_Indices...>) @@ -883,27 +865,23 @@ template ::tuple(_Tag, const _Alloc& _Al, _Tpl&& _Right, index_sequence<_Indices...>) : tuple(_Alloc_exact_args_t{}, _Al, _STD get<_Indices>(_STD forward<_Tpl>(_Right))...) {} -// FUNCTION TEMPLATE make_tuple template _NODISCARD constexpr tuple<_Unrefwrap_t<_Types>...> make_tuple(_Types&&... _Args) { // make tuple from elements using _Ttype = tuple<_Unrefwrap_t<_Types>...>; return _Ttype(_STD forward<_Types>(_Args)...); } -// FUNCTION TEMPLATE tie template _NODISCARD constexpr tuple<_Types&...> tie(_Types&... _Args) noexcept { // make tuple from elements using _Ttype = tuple<_Types&...>; return _Ttype(_Args...); } -// FUNCTION TEMPLATE forward_as_tuple template _NODISCARD constexpr tuple<_Types&&...> forward_as_tuple(_Types&&... _Args) noexcept { // forward arguments in a tuple return tuple<_Types&&...>(_STD forward<_Types>(_Args)...); } -// STRUCT TEMPLATE _Cat_sequences template struct _Cat_sequences; @@ -913,7 +891,6 @@ struct _Cat_sequences, using type = index_sequence<_Indexes1..., _Indexes2...>; }; -// FORWARD DECLARATIONS template class array; @@ -929,7 +906,6 @@ _NODISCARD constexpr _Ty&& get(array<_Ty, _Size>&& _Arr) noexcept; template _NODISCARD constexpr const _Ty&& get(const array<_Ty, _Size>&& _Arr) noexcept; -// STRUCT TEMPLATE _View_as_tuple template struct _View_as_tuple { // tuple_cat() supports only tuples, pairs, and arrays static_assert(_Always_false<_Ty>, "Unsupported tuple_cat arguments."); @@ -955,11 +931,9 @@ struct _View_as_tuple, _Types...> : _View_as_tuple, _Ty, _Types...> { // view an array as a tuple; counts down to 0 }; -// STRUCT TEMPLATE _Repeat_for template struct _Repeat_for : integral_constant {}; // repeats _Nx for each _Ty in a parameter pack -// FUNCTION TEMPLATE tuple_cat template struct _Tuple_cat2 { // determine tuple_cat's return type and _Kx/_Ix indices static_assert(sizeof...(_Tuples) == 0, "Unsupported tuple_cat arguments."); @@ -994,7 +968,6 @@ _NODISCARD constexpr typename _Tuple_cat1<_Tuples...>::type tuple_cat(_Tuples&&. } #if _HAS_CXX17 -// FUNCTION TEMPLATE apply template constexpr decltype(auto) _Apply_impl( _Callable&& _Obj, _Tuple&& _Tpl, index_sequence<_Indices...>) { // invoke _Obj with the elements of _Tpl @@ -1007,7 +980,6 @@ constexpr decltype(auto) apply(_Callable&& _Obj, _Tuple&& _Tpl) { // invoke _Obj make_index_sequence>>{}); } -// FUNCTION TEMPLATE make_from_tuple template constexpr _Ty _Make_from_tuple_impl( _Tuple&& _Tpl, index_sequence<_Indices...>) { // construct _Ty from the elements of _Tpl @@ -1021,7 +993,6 @@ _NODISCARD constexpr _Ty make_from_tuple(_Tuple&& _Tpl) { // construct _Ty from } #endif // _HAS_CXX17 -// STRUCT TEMPLATE uses_allocator template struct uses_allocator, _Alloc> : true_type {}; // true_type if container allocator enabled diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 0025e1653f2..50c651643ea 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -19,7 +19,6 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -// STRUCT TEMPLATE integer_sequence template struct integer_sequence { // sequence of integer parameters static_assert(is_integral_v<_Ty>, "integer_sequence requires T to be an integral type."); @@ -31,7 +30,6 @@ struct integer_sequence { // sequence of integer parameters } }; -// ALIAS TEMPLATE make_integer_sequence template using make_integer_sequence = __make_integer_seq; @@ -44,7 +42,6 @@ using make_index_sequence = make_integer_sequence; template using index_sequence_for = make_index_sequence; -// STRUCT TEMPLATE conjunction template struct _Conjunction { // handle false trait or last trait using type = _First; @@ -66,26 +63,22 @@ struct conjunction<_First, _Rest...> : _Conjunction<_First::value, _First, _Rest template _INLINE_VAR constexpr bool conjunction_v = conjunction<_Traits...>::value; -// STRUCT TEMPLATE negation template struct negation : bool_constant(_Trait::value)> {}; // The negated result of _Trait template _INLINE_VAR constexpr bool negation_v = negation<_Trait>::value; -// STRUCT TEMPLATE is_void template _INLINE_VAR constexpr bool is_void_v = is_same_v, void>; template struct is_void : bool_constant> {}; -// ALIAS TEMPLATE void_t template using void_t = void; // Type modifiers -// STRUCT TEMPLATE add_const template struct add_const { // add top-level const qualifier using type = const _Ty; @@ -94,7 +87,6 @@ struct add_const { // add top-level const qualifier template using add_const_t = typename add_const<_Ty>::type; -// STRUCT TEMPLATE add_volatile template struct add_volatile { // add top-level volatile qualifier using type = volatile _Ty; @@ -103,7 +95,6 @@ struct add_volatile { // add top-level volatile qualifier template using add_volatile_t = typename add_volatile<_Ty>::type; -// STRUCT TEMPLATE add_cv template struct add_cv { // add top-level const and volatile qualifiers using type = const volatile _Ty; @@ -112,7 +103,6 @@ struct add_cv { // add top-level const and volatile qualifiers template using add_cv_t = typename add_cv<_Ty>::type; -// STRUCT TEMPLATE _Add_reference template struct _Add_reference { // add reference (non-referenceable type) using _Lvalue = _Ty; @@ -125,7 +115,6 @@ struct _Add_reference<_Ty, void_t<_Ty&>> { // (referenceable type) using _Rvalue = _Ty&&; }; -// STRUCT TEMPLATE add_lvalue_reference template struct add_lvalue_reference { using type = typename _Add_reference<_Ty>::_Lvalue; @@ -134,7 +123,6 @@ struct add_lvalue_reference { template using add_lvalue_reference_t = typename _Add_reference<_Ty>::_Lvalue; -// STRUCT TEMPLATE add_rvalue_reference template struct add_rvalue_reference { using type = typename _Add_reference<_Ty>::_Rvalue; @@ -143,11 +131,9 @@ struct add_rvalue_reference { template using add_rvalue_reference_t = typename _Add_reference<_Ty>::_Rvalue; -// FUNCTION TEMPLATE declval template add_rvalue_reference_t<_Ty> declval() noexcept; -// STRUCT TEMPLATE remove_extent template struct remove_extent { // remove array extent using type = _Ty; @@ -166,7 +152,6 @@ struct remove_extent<_Ty[]> { template using remove_extent_t = typename remove_extent<_Ty>::type; -// STRUCT TEMPLATE remove_all_extents template struct remove_all_extents { // remove all array extents using type = _Ty; @@ -185,7 +170,6 @@ struct remove_all_extents<_Ty[]> { template using remove_all_extents_t = typename remove_all_extents<_Ty>::type; -// STRUCT TEMPLATE remove_pointer template struct remove_pointer { using type = _Ty; @@ -214,7 +198,6 @@ struct remove_pointer<_Ty* const volatile> { template using remove_pointer_t = typename remove_pointer<_Ty>::type; -// STRUCT TEMPLATE add_pointer template struct _Add_pointer { // add pointer (pointer type cannot be formed) using type = _Ty; @@ -233,8 +216,6 @@ struct add_pointer { template using add_pointer_t = typename _Add_pointer<_Ty>::type; -// TYPE PREDICATES -// STRUCT TEMPLATE is_array template _INLINE_VAR constexpr bool is_array_v = false; // determine whether type argument is an array @@ -248,7 +229,6 @@ template struct is_array : bool_constant> {}; #if _HAS_CXX20 -// STRUCT TEMPLATE is_bounded_array template inline constexpr bool is_bounded_array_v = false; @@ -258,7 +238,6 @@ inline constexpr bool is_bounded_array_v<_Ty[_Nx]> = true; template struct is_bounded_array : bool_constant> {}; -// STRUCT TEMPLATE is_unbounded_array template inline constexpr bool is_unbounded_array_v = false; @@ -269,7 +248,6 @@ template struct is_unbounded_array : bool_constant> {}; #endif // _HAS_CXX20 -// STRUCT TEMPLATE is_lvalue_reference template _INLINE_VAR constexpr bool is_lvalue_reference_v = false; // determine whether type argument is an lvalue reference @@ -279,7 +257,6 @@ _INLINE_VAR constexpr bool is_lvalue_reference_v<_Ty&> = true; template struct is_lvalue_reference : bool_constant> {}; -// STRUCT TEMPLATE is_rvalue_reference template _INLINE_VAR constexpr bool is_rvalue_reference_v = false; // determine whether type argument is an rvalue reference @@ -289,7 +266,6 @@ _INLINE_VAR constexpr bool is_rvalue_reference_v<_Ty&&> = true; template struct is_rvalue_reference : bool_constant> {}; -// STRUCT TEMPLATE is_reference template _INLINE_VAR constexpr bool is_reference_v = false; // determine whether type argument is a reference @@ -302,7 +278,6 @@ _INLINE_VAR constexpr bool is_reference_v<_Ty&&> = true; template struct is_reference : bool_constant> {}; -// STRUCT TEMPLATE is_pointer template _INLINE_VAR constexpr bool is_pointer_v = false; // determine whether _Ty is a pointer @@ -321,7 +296,6 @@ _INLINE_VAR constexpr bool is_pointer_v<_Ty* const volatile> = true; template struct is_pointer : bool_constant> {}; -// STRUCT TEMPLATE is_null_pointer template _INLINE_VAR constexpr bool is_null_pointer_v = is_same_v, nullptr_t>; // determine whether _Ty is cv-qualified nullptr_t @@ -329,28 +303,24 @@ _INLINE_VAR constexpr bool is_null_pointer_v = template struct is_null_pointer : bool_constant> {}; -// STRUCT TEMPLATE is_union template struct is_union : bool_constant<__is_union(_Ty)> {}; // determine whether _Ty is a union template _INLINE_VAR constexpr bool is_union_v = __is_union(_Ty); -// STRUCT TEMPLATE is_class template struct is_class : bool_constant<__is_class(_Ty)> {}; // determine whether _Ty is a class template _INLINE_VAR constexpr bool is_class_v = __is_class(_Ty); -// STRUCT TEMPLATE is_fundamental template _INLINE_VAR constexpr bool is_fundamental_v = is_arithmetic_v<_Ty> || is_void_v<_Ty> || is_null_pointer_v<_Ty>; template struct is_fundamental : bool_constant> {}; // determine whether _Ty is a fundamental type -// STRUCT TEMPLATE is_convertible template struct is_convertible : bool_constant<__is_convertible_to(_From, _To)> { // determine whether _From is convertible to _To @@ -359,7 +329,6 @@ struct is_convertible : bool_constant<__is_convertible_to(_From, _To)> { template _INLINE_VAR constexpr bool is_convertible_v = __is_convertible_to(_From, _To); -// STRUCT TEMPLATE is_enum template struct is_enum : bool_constant<__is_enum(_Ty)> {}; // determine whether _Ty is an enumerated type @@ -367,7 +336,6 @@ template _INLINE_VAR constexpr bool is_enum_v = __is_enum(_Ty); #if _HAS_CXX23 -// STRUCT TEMPLATE is_scoped_enum template inline constexpr bool is_scoped_enum_v = conjunction_v, negation>>; @@ -375,14 +343,12 @@ template struct is_scoped_enum : bool_constant> {}; #endif // _HAS_CXX23 -// STRUCT TEMPLATE is_compound template struct is_compound : bool_constant> {}; // determine whether _Ty is a compound type template _INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>; -// STRUCT TEMPLATE _Arg_types template struct _Arg_types {}; // provide argument_type, etc. when sizeof...(_Types) is 1 or 2 @@ -397,7 +363,6 @@ struct _Arg_types<_Ty1, _Ty2> { _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty2 _SECOND_ARGUMENT_TYPE_NAME; }; -// STRUCT TEMPLATE is_member_function_pointer template struct _Is_memfunptr { // base class for member function pointer predicates using _Bool_type = false_type; // NB: members are user-visible via _Weak_types @@ -440,7 +405,6 @@ _INLINE_VAR constexpr bool is_member_function_pointer_v = _Is_memfunptr struct is_member_function_pointer : bool_constant> {}; -// STRUCT TEMPLATE is_const template _INLINE_VAR constexpr bool is_const_v = false; // determine whether type argument is const qualified @@ -450,7 +414,6 @@ _INLINE_VAR constexpr bool is_const_v = true; template struct is_const : bool_constant> {}; -// STRUCT TEMPLATE is_volatile template _INLINE_VAR constexpr bool is_volatile_v = false; // determine whether type argument is volatile qualified @@ -460,7 +423,6 @@ _INLINE_VAR constexpr bool is_volatile_v = true; template struct is_volatile : bool_constant> {}; -// STRUCT TEMPLATE is_function template _INLINE_VAR constexpr bool is_function_v = // only function types and reference types can't be const qualified !is_const_v && !is_reference_v<_Ty>; @@ -468,7 +430,6 @@ _INLINE_VAR constexpr bool is_function_v = // only function types and reference template struct is_function : bool_constant> {}; -// STRUCT TEMPLATE is_object template _INLINE_VAR constexpr bool is_object_v = // only function types and reference types can't be const qualified is_const_v && !is_void_v<_Ty>; @@ -476,7 +437,6 @@ _INLINE_VAR constexpr bool is_object_v = // only function types and reference ty template struct is_object : bool_constant> {}; -// STRUCT TEMPLATE is_member_object_pointer template struct _Is_member_object_pointer { static constexpr bool value = false; @@ -499,7 +459,6 @@ _INLINE_VAR constexpr bool is_member_object_pointer_v = _Is_member_object_pointe template struct is_member_object_pointer : bool_constant> {}; -// STRUCT TEMPLATE is_member_pointer #ifdef __clang__ template _INLINE_VAR constexpr bool is_member_pointer_v = __is_member_pointer(_Ty); @@ -511,7 +470,6 @@ _INLINE_VAR constexpr bool is_member_pointer_v = is_member_object_pointer_v<_Ty> template struct is_member_pointer : bool_constant> {}; // determine whether _Ty is a pointer to member -// STRUCT TEMPLATE is_scalar template _INLINE_VAR constexpr bool is_scalar_v = // determine whether _Ty is a scalar type is_arithmetic_v<_Ty> || is_enum_v<_Ty> || is_pointer_v<_Ty> || is_member_pointer_v<_Ty> || is_null_pointer_v<_Ty>; @@ -519,42 +477,36 @@ _INLINE_VAR constexpr bool is_scalar_v = // determine whether _Ty is a scalar ty template struct is_scalar : bool_constant> {}; -// STRUCT TEMPLATE is_pod template struct _CXX20_DEPRECATE_IS_POD is_pod : bool_constant<__is_pod(_Ty)> {}; // determine whether _Ty is a POD type template _CXX20_DEPRECATE_IS_POD _INLINE_VAR constexpr bool is_pod_v = __is_pod(_Ty); -// STRUCT TEMPLATE is_empty template struct is_empty : bool_constant<__is_empty(_Ty)> {}; // determine whether _Ty is an empty class template _INLINE_VAR constexpr bool is_empty_v = __is_empty(_Ty); -// STRUCT TEMPLATE is_polymorphic template struct is_polymorphic : bool_constant<__is_polymorphic(_Ty)> {}; // determine whether _Ty is a polymorphic type template _INLINE_VAR constexpr bool is_polymorphic_v = __is_polymorphic(_Ty); -// STRUCT TEMPLATE is_abstract template struct is_abstract : bool_constant<__is_abstract(_Ty)> {}; // determine whether _Ty is an abstract class template _INLINE_VAR constexpr bool is_abstract_v = __is_abstract(_Ty); -// STRUCT TEMPLATE is_final template struct is_final : bool_constant<__is_final(_Ty)> {}; // determine whether _Ty is a final class template _INLINE_VAR constexpr bool is_final_v = __is_final(_Ty); -// STRUCT TEMPLATE is_standard_layout template struct is_standard_layout : bool_constant<__is_standard_layout(_Ty)> {}; // determine whether _Ty is standard layout @@ -562,7 +514,6 @@ template _INLINE_VAR constexpr bool is_standard_layout_v = __is_standard_layout(_Ty); #if _HAS_DEPRECATED_IS_LITERAL_TYPE -// STRUCT TEMPLATE is_literal_type template struct _CXX17_DEPRECATE_IS_LITERAL_TYPE is_literal_type : bool_constant<__is_literal_type(_Ty)> { // determine whether _Ty is a literal type @@ -572,7 +523,6 @@ template _CXX17_DEPRECATE_IS_LITERAL_TYPE _INLINE_VAR constexpr bool is_literal_type_v = __is_literal_type(_Ty); #endif // _HAS_DEPRECATED_IS_LITERAL_TYPE -// STRUCT TEMPLATE is_trivial #if 1 // TRANSITION, VSO-119526 and LLVM-41915 template struct is_trivial : bool_constant<__is_trivially_constructible(_Ty) && __is_trivially_copyable(_Ty)> { @@ -589,7 +539,6 @@ template _INLINE_VAR constexpr bool is_trivial_v = __is_trivial(_Ty); #endif // TRANSITION -// STRUCT TEMPLATE is_trivially_copyable template struct is_trivially_copyable : bool_constant<__is_trivially_copyable(_Ty)> { // determine whether _Ty is a trivially copyable type @@ -598,7 +547,6 @@ struct is_trivially_copyable : bool_constant<__is_trivially_copyable(_Ty)> { template _INLINE_VAR constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Ty); -// STRUCT TEMPLATE has_virtual_destructor template struct has_virtual_destructor : bool_constant<__has_virtual_destructor(_Ty)> { // determine whether _Ty has a virtual destructor @@ -608,7 +556,6 @@ template _INLINE_VAR constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Ty); #if _HAS_CXX17 -// STRUCT TEMPLATE has_unique_object_representations template struct has_unique_object_representations : bool_constant<__has_unique_object_representations(_Ty)> { // determine whether _Ty has unique object representations @@ -617,7 +564,6 @@ struct has_unique_object_representations : bool_constant<__has_unique_object_rep template _INLINE_VAR constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Ty); -// STRUCT TEMPLATE is_aggregate template struct is_aggregate : bool_constant<__is_aggregate(_Ty)> {}; // determine whether _Ty is an aggregate @@ -625,8 +571,6 @@ template _INLINE_VAR constexpr bool is_aggregate_v = __is_aggregate(_Ty); #endif // _HAS_CXX17 -// CONSTRUCTIBLE/ASSIGNABLE TRAITS -// STRUCT TEMPLATE is_constructible template struct is_constructible : bool_constant<__is_constructible(_Ty, _Args...)> { // determine whether _Ty can be direct-initialized with _Args... @@ -635,7 +579,6 @@ struct is_constructible : bool_constant<__is_constructible(_Ty, _Args...)> { template _INLINE_VAR constexpr bool is_constructible_v = __is_constructible(_Ty, _Args...); -// STRUCT TEMPLATE is_copy_constructible template struct is_copy_constructible : bool_constant<__is_constructible(_Ty, add_lvalue_reference_t)> { // determine whether _Ty can be direct-initialized with an lvalue const _Ty @@ -644,7 +587,6 @@ struct is_copy_constructible : bool_constant<__is_constructible(_Ty, add_lvalue_ template _INLINE_VAR constexpr bool is_copy_constructible_v = __is_constructible(_Ty, add_lvalue_reference_t); -// STRUCT TEMPLATE is_default_constructible template struct is_default_constructible : bool_constant<__is_constructible(_Ty)> { // determine whether _Ty can be value-initialized @@ -653,7 +595,6 @@ struct is_default_constructible : bool_constant<__is_constructible(_Ty)> { template _INLINE_VAR constexpr bool is_default_constructible_v = __is_constructible(_Ty); -// STRUCT TEMPLATE _Is_implicitly_default_constructible template struct _Is_implicitly_default_constructible : false_type { // determine whether _Ty can be copy-initialized with {} @@ -666,7 +607,6 @@ template struct _Is_implicitly_default_constructible<_Ty, void_t({}))>> : true_type { }; -// STRUCT TEMPLATE is_move_constructible template struct is_move_constructible : bool_constant<__is_constructible(_Ty, _Ty)> { // determine whether _Ty can be direct-initialized from an rvalue _Ty @@ -675,14 +615,12 @@ struct is_move_constructible : bool_constant<__is_constructible(_Ty, _Ty)> { template _INLINE_VAR constexpr bool is_move_constructible_v = __is_constructible(_Ty, _Ty); -// STRUCT TEMPLATE is_assignable template struct is_assignable : bool_constant<__is_assignable(_To, _From)> {}; // determine whether _From can be assigned to _To template _INLINE_VAR constexpr bool is_assignable_v = __is_assignable(_To, _From); -// STRUCT TEMPLATE is_copy_assignable template struct is_copy_assignable : bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t)> { @@ -710,7 +648,6 @@ template _INLINE_VAR constexpr bool _Is_copy_assignable_unchecked_v = is_copy_assignable_v<_Ty>; #endif // defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__) -// STRUCT TEMPLATE is_move_assignable template struct is_move_assignable : bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { // determine whether an rvalue _Ty can be assigned to an lvalue _Ty @@ -735,7 +672,6 @@ template _INLINE_VAR constexpr bool _Is_move_assignable_unchecked_v = is_move_assignable_v<_Ty>; #endif // defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__) -// STRUCT TEMPLATE is_destructible template struct is_destructible : bool_constant<__is_destructible(_Ty)> { // true iff remove_all_extents_t<_Ty> is a reference type, or can be explicitly destroyed @@ -744,8 +680,6 @@ struct is_destructible : bool_constant<__is_destructible(_Ty)> { template _INLINE_VAR constexpr bool is_destructible_v = __is_destructible(_Ty); -// TRIVIAL TRAITS -// STRUCT TEMPLATE is_trivially_constructible template struct is_trivially_constructible : bool_constant<__is_trivially_constructible(_Ty, _Args...)> { // determine whether direct-initialization of _Ty with _Args... is trivial @@ -754,7 +688,6 @@ struct is_trivially_constructible : bool_constant<__is_trivially_constructible(_ template _INLINE_VAR constexpr bool is_trivially_constructible_v = __is_trivially_constructible(_Ty, _Args...); -// STRUCT TEMPLATE is_trivially_copy_constructible template struct is_trivially_copy_constructible : bool_constant<__is_trivially_constructible(_Ty, add_lvalue_reference_t)> { @@ -765,7 +698,6 @@ template _INLINE_VAR constexpr bool is_trivially_copy_constructible_v = __is_trivially_constructible( _Ty, add_lvalue_reference_t); -// STRUCT TEMPLATE is_trivially_default_constructible template struct is_trivially_default_constructible : bool_constant<__is_trivially_constructible(_Ty)> { // determine whether value-initialization of _Ty is trivial @@ -774,7 +706,6 @@ struct is_trivially_default_constructible : bool_constant<__is_trivially_constru template _INLINE_VAR constexpr bool is_trivially_default_constructible_v = __is_trivially_constructible(_Ty); -// STRUCT TEMPLATE is_trivially_move_constructible template struct is_trivially_move_constructible : bool_constant<__is_trivially_constructible(_Ty, _Ty)> { // determine whether direct-initialization of _Ty with an rvalue _Ty is trivial @@ -783,7 +714,6 @@ struct is_trivially_move_constructible : bool_constant<__is_trivially_constructi template _INLINE_VAR constexpr bool is_trivially_move_constructible_v = __is_trivially_constructible(_Ty, _Ty); -// STRUCT TEMPLATE is_trivially_assignable template struct is_trivially_assignable : bool_constant<__is_trivially_assignable(_To, _From)> { // determine whether _From can be trivially assigned to _To @@ -792,7 +722,6 @@ struct is_trivially_assignable : bool_constant<__is_trivially_assignable(_To, _F template _INLINE_VAR constexpr bool is_trivially_assignable_v = __is_trivially_assignable(_To, _From); -// STRUCT TEMPLATE is_trivially_copy_assignable template struct is_trivially_copy_assignable : bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t)> { @@ -803,7 +732,6 @@ template _INLINE_VAR constexpr bool is_trivially_copy_assignable_v = __is_trivially_assignable( add_lvalue_reference_t<_Ty>, add_lvalue_reference_t); -// STRUCT TEMPLATE is_trivially_move_assignable template struct is_trivially_move_assignable : bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { // determine whether an rvalue _Ty can be trivially assigned to an lvalue _Ty @@ -812,7 +740,6 @@ struct is_trivially_move_assignable : bool_constant<__is_trivially_assignable(ad template _INLINE_VAR constexpr bool is_trivially_move_assignable_v = __is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty); -// STRUCT TEMPLATE is_trivially_destructible template struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty)> { // determine whether remove_all_extents_t<_Ty> is a reference type or can trivially be explicitly destroyed @@ -821,8 +748,6 @@ struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty template _INLINE_VAR constexpr bool is_trivially_destructible_v = __is_trivially_destructible(_Ty); -// NOTHROW TRAITS -// STRUCT TEMPLATE is_nothrow_constructible template struct is_nothrow_constructible : bool_constant<__is_nothrow_constructible(_Ty, _Args...)> { // determine whether direct-initialization of _Ty from _Args... is both valid and not potentially-throwing @@ -831,7 +756,6 @@ struct is_nothrow_constructible : bool_constant<__is_nothrow_constructible(_Ty, template _INLINE_VAR constexpr bool is_nothrow_constructible_v = __is_nothrow_constructible(_Ty, _Args...); -// STRUCT TEMPLATE is_nothrow_copy_constructible template struct is_nothrow_copy_constructible : bool_constant<__is_nothrow_constructible(_Ty, add_lvalue_reference_t)> { @@ -843,7 +767,6 @@ template _INLINE_VAR constexpr bool is_nothrow_copy_constructible_v = __is_nothrow_constructible( _Ty, add_lvalue_reference_t); -// STRUCT TEMPLATE is_nothrow_default_constructible template struct is_nothrow_default_constructible : bool_constant<__is_nothrow_constructible(_Ty)> { // determine whether value-initialization of _Ty is both valid and not potentially-throwing @@ -852,7 +775,6 @@ struct is_nothrow_default_constructible : bool_constant<__is_nothrow_constructib template _INLINE_VAR constexpr bool is_nothrow_default_constructible_v = __is_nothrow_constructible(_Ty); -// STRUCT TEMPLATE is_nothrow_move_constructible template struct is_nothrow_move_constructible : bool_constant<__is_nothrow_constructible(_Ty, _Ty)> { // determine whether direct-initialization of _Ty from an rvalue _Ty is both valid and not potentially-throwing @@ -861,7 +783,6 @@ struct is_nothrow_move_constructible : bool_constant<__is_nothrow_constructible( template _INLINE_VAR constexpr bool is_nothrow_move_constructible_v = __is_nothrow_constructible(_Ty, _Ty); -// STRUCT TEMPLATE is_nothrow_assignable template struct is_nothrow_assignable : bool_constant<__is_nothrow_assignable(_To, _From)> { // determine whether assignment of _From to _To is both valid and not potentially-throwing @@ -870,7 +791,6 @@ struct is_nothrow_assignable : bool_constant<__is_nothrow_assignable(_To, _From) template _INLINE_VAR constexpr bool is_nothrow_assignable_v = __is_nothrow_assignable(_To, _From); -// STRUCT TEMPLATE is_nothrow_copy_assignable template struct is_nothrow_copy_assignable : bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t)> { @@ -881,7 +801,6 @@ template _INLINE_VAR constexpr bool is_nothrow_copy_assignable_v = __is_nothrow_assignable( add_lvalue_reference_t<_Ty>, add_lvalue_reference_t); -// STRUCT TEMPLATE is_nothrow_move_assignable template struct is_nothrow_move_assignable : bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { // determine whether assignment of an rvalue _Ty to an lvalue _Ty is both valid and not potentially-throwing @@ -890,7 +809,6 @@ struct is_nothrow_move_assignable : bool_constant<__is_nothrow_assignable(add_lv template _INLINE_VAR constexpr bool is_nothrow_move_assignable_v = __is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty); -// STRUCT TEMPLATE is_nothrow_destructible template struct is_nothrow_destructible : bool_constant<__is_nothrow_destructible(_Ty)> { // determine whether remove_all_extents_t<_Ty> is a reference type or has @@ -900,7 +818,6 @@ struct is_nothrow_destructible : bool_constant<__is_nothrow_destructible(_Ty)> { template _INLINE_VAR constexpr bool is_nothrow_destructible_v = __is_nothrow_destructible(_Ty); -// STRUCT TEMPLATE is_signed template > struct _Sign_base { // determine whether integral type _Ty is signed or unsigned using _Uty = remove_cv_t<_Ty>; @@ -922,18 +839,15 @@ struct is_signed : bool_constant<_Sign_base<_Ty>::_Signed> {}; // determine whet template _INLINE_VAR constexpr bool is_signed_v = _Sign_base<_Ty>::_Signed; -// STRUCT TEMPLATE is_unsigned template struct is_unsigned : bool_constant<_Sign_base<_Ty>::_Unsigned> {}; // determine whether _Ty is an unsigned type template _INLINE_VAR constexpr bool is_unsigned_v = _Sign_base<_Ty>::_Unsigned; -// VARIABLE TEMPLATE _Is_nonbool_integral template _INLINE_VAR constexpr bool _Is_nonbool_integral = is_integral_v<_Ty> && !is_same_v, bool>; -// STRUCT TEMPLATE make_signed template struct _Select { // Select between aliases that extract either their first or second parameter template @@ -990,7 +904,6 @@ struct make_signed { // signed partner to _Ty template using make_signed_t = typename make_signed<_Ty>::type; -// STRUCT TEMPLATE make_unsigned template struct _Make_unsigned2; // Choose make_unsigned strategy by type size @@ -1036,20 +949,17 @@ struct make_unsigned { // unsigned partner to _Ty template using make_unsigned_t = typename make_unsigned<_Ty>::type; -// FUNCTION TEMPLATE _Unsigned_value template constexpr make_unsigned_t<_Rep> _Unsigned_value(_Rep _Val) { // makes _Val unsigned return static_cast>(_Val); } -// STRUCT TEMPLATE alignment_of template struct alignment_of : integral_constant {}; // determine alignment of _Ty template _INLINE_VAR constexpr size_t alignment_of_v = alignof(_Ty); -// STRUCT TEMPLATE aligned_storage template union _Align_type { // union with size _Len bytes and alignment of _Ty _Ty _Val; @@ -1119,7 +1029,6 @@ struct aligned_storage { // define type with size _Len and alignment _Align template using aligned_storage_t = typename aligned_storage<_Len, _Align>::type; -// STRUCT TEMPLATE aligned_union template struct _Maximum; @@ -1145,7 +1054,6 @@ struct aligned_union { // define type with size at least _Len, for storing anyth template using aligned_union_t = typename aligned_union<_Len, _Types...>::type; -// STRUCT TEMPLATE underlying_type template > struct _Underlying_type { using type = __underlying_type(_Ty); @@ -1160,7 +1068,6 @@ struct underlying_type : _Underlying_type<_Ty> {}; // determine underlying type template using underlying_type_t = typename _Underlying_type<_Ty>::type; -// STRUCT TEMPLATE rank template _INLINE_VAR constexpr size_t rank_v = 0; // determine number of dimensions of array _Ty @@ -1173,7 +1080,6 @@ _INLINE_VAR constexpr size_t rank_v<_Ty[]> = rank_v<_Ty> + 1; template struct rank : integral_constant> {}; -// STRUCT TEMPLATE extent template _INLINE_VAR constexpr size_t extent_v = 0; // determine extent of dimension _Ix of array _Ty @@ -1189,7 +1095,6 @@ _INLINE_VAR constexpr size_t extent_v<_Ty[], _Ix> = extent_v<_Ty, _Ix - 1>; template struct extent : integral_constant> {}; -// STRUCT TEMPLATE is_base_of template struct is_base_of : bool_constant<__is_base_of(_Base, _Derived)> { // determine whether _Base is a base of or the same as _Derived @@ -1198,7 +1103,6 @@ struct is_base_of : bool_constant<__is_base_of(_Base, _Derived)> { template _INLINE_VAR constexpr bool is_base_of_v = __is_base_of(_Base, _Derived); -// STRUCT TEMPLATE decay template struct decay { // determines decayed version of _Ty using _Ty1 = remove_reference_t<_Ty>; @@ -1209,11 +1113,9 @@ struct decay { // determines decayed version of _Ty template using decay_t = typename decay<_Ty>::type; -// ALIAS TEMPLATE _Conditional_type template using _Conditional_type = decltype(false ? _STD declval<_Ty1>() : _STD declval<_Ty2>()); -// STRUCT TEMPLATE common_type #if _HAS_CXX20 template struct _Const_lvalue_cond_oper {}; @@ -1269,20 +1171,16 @@ template struct common_type<_Ty1, _Ty2, _Rest...> : _Common_type3 {}; #if _HAS_CXX20 -// STRUCT TEMPLATE basic_common_reference template class, template class> struct basic_common_reference {}; -// FUNCTION TEMPLATE _Returns_exactly template _Ty _Returns_exactly() noexcept; // not defined -// ALIAS TEMPLATE _Cond_res template using _Cond_res = // N4810 [meta.trans.other]/2.4 decltype(false ? _Returns_exactly<_Ty1>() : _Returns_exactly<_Ty2>()); -// ALIAS TEMPLATE _Copy_cv template struct _Copy_cv_impl { template @@ -1307,7 +1205,6 @@ template using _Copy_cv = // N4810 [meta.trans.other]/2.3 typename _Copy_cv_impl<_From>::template _Apply<_To>; -// STRUCT TEMPLATE _Add_qualifiers template struct _Add_qualifiers { // _Add_qualifiers::template _Apply is XREF(A) from N4810 [meta.trans.other]/2.1 template @@ -1324,11 +1221,9 @@ struct _Add_qualifiers<_Ty1&&> { using _Apply = add_rvalue_reference_t<_Copy_cv<_Ty1, _Ty2>>; }; -// STRUCT TEMPLATE common_reference template struct common_reference; -// ALIAS TEMPLATE common_reference_t template using common_reference_t = typename common_reference<_Types...>::type; @@ -1415,7 +1310,6 @@ template struct common_reference<_Ty1, _Ty2, _Ty3, _Rest...> : _Fold_common_reference {}; #endif // _HAS_CXX20 -// STRUCT TEMPLATE _Identity template struct _Identity { using type = _Ty; @@ -1424,7 +1318,6 @@ template using _Identity_t = typename _Identity<_Ty>::type; #if _HAS_CXX20 -// STRUCT TEMPLATE type_identity template struct type_identity { using type = _Ty; @@ -1433,7 +1326,6 @@ template using type_identity_t = typename type_identity<_Ty>::type; #endif // _HAS_CXX20 -// STRUCT TEMPLATE _Is_specialization template class _Template> _INLINE_VAR constexpr bool _Is_specialization_v = false; // true if and only if _Type is a specialization of _Template template