Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment cleanups #4439

Merged
merged 6 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stl/inc/compare
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ concept three_way_comparable_with =
three_way_comparable<_Ty1, _Cat> && three_way_comparable<_Ty2, _Cat>
#if _HAS_CXX23
&& _Comparison_common_type_with<_Ty1, _Ty2>
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
&& common_reference_with<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>
#endif // C++20
#endif // ^^^ !_HAS_CXX23 ^^^
&& three_way_comparable<common_reference_t<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>, _Cat>
&& _Weakly_equality_comparable_with<_Ty1, _Ty2> && _Partially_ordered_with<_Ty1, _Ty2>
&& requires(const remove_reference_t<_Ty1>& __t, const remove_reference_t<_Ty2>& __u) {
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/concepts
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ _EXPORT_STD template <class _Ty1, class _Ty2>
concept equality_comparable_with = equality_comparable<_Ty1> && equality_comparable<_Ty2>
#if _HAS_CXX23
&& _Comparison_common_type_with<_Ty1, _Ty2>
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
&& common_reference_with<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>
#endif // C++20
#endif // ^^^ !_HAS_CXX23 ^^^
&& equality_comparable<common_reference_t<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>>
&& _Weakly_equality_comparable_with<_Ty1, _Ty2>;

Expand Down
8 changes: 4 additions & 4 deletions stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ namespace ranges {
concept _Valid_movable_box_object =
#if _HAS_CXX23
move_constructible<_Ty>
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
copy_constructible<_Ty>
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
&& _Destructible_object<_Ty>;

template <class _It>
Expand Down Expand Up @@ -5696,14 +5696,14 @@ namespace ranges {
concept _Has_tuple_element =
#if _HAS_CXX23
_Tuple_like<_Tuple> && _Index < tuple_size_v<_Tuple>;
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
requires(_Tuple __t) {
typename tuple_size<_Tuple>::type;
requires _Index < tuple_size_v<_Tuple>;
typename tuple_element_t<_Index, _Tuple>;
{ _STD get<_Index>(__t) } -> convertible_to<const tuple_element_t<_Index, _Tuple>&>;
};
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^

template <class _Tuple, size_t _Index>
concept _Returnable_element = is_reference_v<_Tuple> || move_constructible<tuple_element_t<_Index, _Tuple>>;
Expand Down
24 changes: 12 additions & 12 deletions stl/inc/tuple
Original file line number Diff line number Diff line change
Expand Up @@ -1032,9 +1032,9 @@ struct _Tuple_cat2<_Ty, index_sequence<_Kx...>, index_sequence<_Ix...>, _Ix_next

#if _HAS_CXX23
template <_Tuple_like... _Tuples>
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
template <class... _Tuples>
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
using _Tuple_cat1 = _Tuple_cat2<tuple<_Tuples&&...>, index_sequence<>, index_sequence<>, 0,
make_index_sequence<tuple_size_v<_Remove_cvref_t<_Tuples>>>...>;

Expand All @@ -1045,9 +1045,9 @@ constexpr _Ret _Tuple_cat(index_sequence<_Kx...>, index_sequence<_Ix...>, _Ty _A

#if _HAS_CXX23
_EXPORT_STD template <_Tuple_like... _Tuples>
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
_EXPORT_STD template <class... _Tuples>
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
_NODISCARD constexpr typename _Tuple_cat1<_Tuples...>::_Ret tuple_cat(_Tuples&&... _Tpls) { // concatenate tuples
using _Cat1 = _Tuple_cat1<_Tuples...>;
using _Ret = typename _Cat1::_Ret;
Expand All @@ -1059,19 +1059,19 @@ _NODISCARD constexpr typename _Tuple_cat1<_Tuples...>::_Ret tuple_cat(_Tuples&&.
#if _HAS_CXX17
#if _HAS_CXX23
template <class _Callable, _Tuple_like _Tuple, size_t... _Indices>
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
template <class _Callable, class _Tuple, size_t... _Indices>
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
constexpr decltype(auto) _Apply_impl(_Callable&& _Obj, _Tuple&& _Tpl, index_sequence<_Indices...>) noexcept(
noexcept(_STD invoke(_STD forward<_Callable>(_Obj), _STD get<_Indices>(_STD forward<_Tuple>(_Tpl))...))) {
return _STD invoke(_STD forward<_Callable>(_Obj), _STD get<_Indices>(_STD forward<_Tuple>(_Tpl))...);
}

#if _HAS_CXX23
_EXPORT_STD template <class _Callable, _Tuple_like _Tuple>
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
_EXPORT_STD template <class _Callable, class _Tuple>
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
constexpr decltype(auto) apply(_Callable&& _Obj, _Tuple&& _Tpl) noexcept(
noexcept(_Apply_impl(_STD forward<_Callable>(_Obj), _STD forward<_Tuple>(_Tpl),
make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>{}))) {
Expand All @@ -1081,9 +1081,9 @@ constexpr decltype(auto) apply(_Callable&& _Obj, _Tuple&& _Tpl) noexcept(

#if _HAS_CXX23
template <class _Ty, _Tuple_like _Tuple, size_t... _Indices>
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
template <class _Ty, class _Tuple, size_t... _Indices>
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
constexpr _Ty _Make_from_tuple_impl(_Tuple&& _Tpl, index_sequence<_Indices...>) noexcept(
is_nothrow_constructible_v<_Ty, decltype(_STD get<_Indices>(_STD forward<_Tuple>(_Tpl)))...>) {
// construct _Ty from the elements of _Tpl
Expand All @@ -1094,9 +1094,9 @@ constexpr _Ty _Make_from_tuple_impl(_Tuple&& _Tpl, index_sequence<_Indices...>)

#if _HAS_CXX23
_EXPORT_STD template <class _Ty, _Tuple_like _Tuple>
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
_EXPORT_STD template <class _Ty, class _Tuple>
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
_NODISCARD constexpr _Ty make_from_tuple(_Tuple&& _Tpl) noexcept(noexcept(_Make_from_tuple_impl<_Ty>(
_STD forward<_Tuple>(_Tpl), make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>{}))) /* strengthened */ {
// construct _Ty from the elements of _Tpl
Expand Down
32 changes: 16 additions & 16 deletions stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -1423,27 +1423,27 @@ template <class _Iter>
using _Guide_key_t =
#if _HAS_CXX23
remove_const_t<tuple_element_t<0, typename iterator_traits<_Iter>::value_type>>;
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
remove_const_t<typename iterator_traits<_Iter>::value_type::first_type>;
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^

template <class _Iter>
using _Guide_val_t =
#if _HAS_CXX23
tuple_element_t<1, typename iterator_traits<_Iter>::value_type>;
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
typename iterator_traits<_Iter>::value_type::second_type;
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^

template <class _Iter>
using _Guide_pair_t =
#if _HAS_CXX23
pair<add_const_t<tuple_element_t<0, typename iterator_traits<_Iter>::value_type>>,
tuple_element_t<1, typename iterator_traits<_Iter>::value_type>>;
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
pair<add_const_t<typename iterator_traits<_Iter>::value_type::first_type>,
typename iterator_traits<_Iter>::value_type::second_type>;
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^

_EXPORT_STD template <class _Ty>
struct is_execution_policy : false_type {};
Expand Down Expand Up @@ -2840,15 +2840,15 @@ namespace ranges {
noexcept(const_iterator<_Begin_on_const<_Ty>>{_RANGES begin(_RANGES _Possibly_const_range(_Val))})) {
return const_iterator<_Begin_on_const<_Ty>>{_RANGES begin(_RANGES _Possibly_const_range(_Val))};
}
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
template <class _Ty, class _CTy = _Const_thru_ref<_Ty>>
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES begin(static_cast<_CTy&&>(_Val))))
requires requires { _RANGES begin(static_cast<_CTy&&>(_Val)); }
{
return _RANGES begin(static_cast<_CTy&&>(_Val));
}
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
};

inline namespace _Cpos {
Expand All @@ -2870,15 +2870,15 @@ namespace ranges {
noexcept(noexcept(const_sentinel<_End_on_const<_Ty>>{_RANGES end(_RANGES _Possibly_const_range(_Val))})) {
return const_sentinel<_End_on_const<_Ty>>{_RANGES end(_RANGES _Possibly_const_range(_Val))};
}
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
template <class _Ty, class _CTy = _Const_thru_ref<_Ty>>
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES end(static_cast<_CTy&&>(_Val))))
requires requires { _RANGES end(static_cast<_CTy&&>(_Val)); }
{
return _RANGES end(static_cast<_CTy&&>(_Val));
}
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
};

inline namespace _Cpos {
Expand Down Expand Up @@ -3040,15 +3040,15 @@ namespace ranges {
noexcept(const_iterator<_Rbegin_on_const<_Ty>>{_RANGES rbegin(_RANGES _Possibly_const_range(_Val))})) {
return const_iterator<_Rbegin_on_const<_Ty>>{_RANGES rbegin(_RANGES _Possibly_const_range(_Val))};
}
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
template <class _Ty, class _CTy = _Const_thru_ref<_Ty>>
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES rbegin(static_cast<_CTy&&>(_Val))))
requires requires { _RANGES rbegin(static_cast<_CTy&&>(_Val)); }
{
return _RANGES rbegin(static_cast<_CTy&&>(_Val));
}
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
};

inline namespace _Cpos {
Expand All @@ -3070,15 +3070,15 @@ namespace ranges {
noexcept(noexcept(const_sentinel<_Rend_on_const<_Ty>>{_RANGES rend(_RANGES _Possibly_const_range(_Val))})) {
return const_sentinel<_Rend_on_const<_Ty>>{_RANGES rend(_RANGES _Possibly_const_range(_Val))};
}
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
template <class _Ty, class _CTy = _Const_thru_ref<_Ty>>
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES rend(static_cast<_CTy&&>(_Val))))
requires requires { _RANGES rend(static_cast<_CTy&&>(_Val)); }
{
return _RANGES rend(static_cast<_CTy&&>(_Val));
}
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
};

inline namespace _Cpos {
Expand Down Expand Up @@ -3297,15 +3297,15 @@ namespace ranges {
noexcept(noexcept(_RANGES data(_RANGES _Possibly_const_range(_Val)))) {
return _RANGES _As_const_pointer(_RANGES data(_RANGES _Possibly_const_range(_Val)));
}
#else // ^^^ C++23 / C++20 vvv
#else // ^^^ _HAS_CXX23 / !_HAS_CXX23 vvv
template <class _Ty, class _CTy = _Const_thru_ref<_Ty>>
_NODISCARD _STATIC_CALL_OPERATOR constexpr auto operator()(_Ty&& _Val) _CONST_CALL_OPERATOR
noexcept(noexcept(_RANGES data(static_cast<_CTy&&>(_Val))))
requires requires { _RANGES data(static_cast<_CTy&&>(_Val)); }
{
return _RANGES data(static_cast<_CTy&&>(_Val));
}
#endif // ^^^ C++20 ^^^
#endif // ^^^ !_HAS_CXX23 ^^^
};

inline namespace _Cpos {
Expand Down
34 changes: 17 additions & 17 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect

// P0298R3 std::byte
#ifndef _HAS_STD_BYTE
#define _HAS_STD_BYTE _HAS_CXX17 // inspected by GSL, do not remove
#define _HAS_STD_BYTE _HAS_CXX17
#endif // !defined(_HAS_STD_BYTE)

// P0302R1 Removing Allocator Support In std::function
Expand Down Expand Up @@ -1842,29 +1842,29 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
// macros with language mode sensitivity
#if _HAS_CXX20
#define __cpp_lib_array_constexpr 201811L // P1032R1 Miscellaneous constexpr
#elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv
#elif _HAS_CXX17
#define __cpp_lib_array_constexpr 201803L // P0858R0 Constexpr Iterator Requirements
#endif // _HAS_CXX17
#endif

#if _HAS_CXX20
#define __cpp_lib_chrono 201907L // P1466R3 Miscellaneous Minor Fixes For <chrono>
#elif _HAS_CXX17
#define __cpp_lib_chrono 201611L // P0505R0 constexpr For <chrono> (Again)
#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv
#else
#define __cpp_lib_chrono 201510L // P0092R1 <chrono> floor(), ceil(), round(), abs()
#endif // ^^^ !_HAS_CXX17 ^^^
#endif

#if _HAS_CXX23
#define __cpp_lib_concepts 202207L // P2404R3 Move-Only Types For Comparison Concepts
#elif _HAS_CXX20 // ^^^ C++23 / C++20 vvv
#elif _HAS_CXX20
#define __cpp_lib_concepts 202002L // P1964R2 Replacing boolean With boolean-testable
#endif // C++20
#endif

#if _HAS_CXX23
#define __cpp_lib_constexpr_memory 202202L // P2273R3 constexpr unique_ptr
#elif _HAS_CXX20
#define __cpp_lib_constexpr_memory 201811L // P1006R1 constexpr For pointer_traits<T*>::pointer_to()
#endif // _HAS_CXX20
#endif

#ifndef _M_CEE_PURE
#if _HAS_CXX20
Expand All @@ -1876,17 +1876,17 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect

#if _HAS_CXX23
#define __cpp_lib_optional 202110L // P0798R8 Monadic Operations For optional
#elif _HAS_CXX20 // ^^^ _HAS_CXX23 / _HAS_CXX20 vvv
#elif _HAS_CXX20
#define __cpp_lib_optional 202106L // P2231R1 Completing constexpr In optional And variant
#elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv
#elif _HAS_CXX17
#define __cpp_lib_optional 201606L // P0307R2 Making Optional Greater Equal Again
#endif // _HAS_CXX17
#endif

#if _HAS_CXX23
#define __cpp_lib_ranges 202302L // P2609R3 Relaxing Ranges Just A Smidge
#elif _HAS_CXX20 // ^^^ _HAS_CXX23 / _HAS_CXX20 vvv
#elif _HAS_CXX20
#define __cpp_lib_ranges 202110L // P2415R2 What Is A view?
#endif // _HAS_CXX20
#endif

#if _HAS_CXX20
#define __cpp_lib_shared_ptr_arrays 201707L // P0674R1 make_shared() For Arrays
Expand All @@ -1896,15 +1896,15 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect

#if _HAS_CXX23
#define __cpp_lib_shift 202202L // P2440R1 ranges::shift_left, ranges::shift_right
#elif _HAS_CXX20 // ^^^ _HAS_CXX23 / _HAS_CXX20 vvv
#elif _HAS_CXX20
#define __cpp_lib_shift 201806L // P0769R2 shift_left(), shift_right()
#endif // _HAS_CXX20
#endif

#if _HAS_CXX20
#define __cpp_lib_variant 202106L // P2231R1 Completing constexpr In optional And variant
#elif _HAS_CXX17 // ^^^ _HAS_CXX20 / _HAS_CXX17 vvv
#elif _HAS_CXX17
#define __cpp_lib_variant 202102L // P2162R2 Inheriting From variant
#endif // _HAS_CXX17
#endif

#define __cpp_lib_experimental_erase_if 201411L
#define __cpp_lib_experimental_filesystem 201406L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ STATIC_ASSERT(test_equal_memcmp_is_safe_for_types<true, char8_t, char8_t>());
STATIC_ASSERT(test_equal_memcmp_is_safe_for_types<true, char16_t, char16_t>());
STATIC_ASSERT(test_equal_memcmp_is_safe_for_types<true, char32_t, char32_t>());

// Don't allow diffrent size integrals
// Don't allow different size integrals
STATIC_ASSERT(test_equal_memcmp_is_safe_for_types<false, short, int>());
STATIC_ASSERT(test_equal_memcmp_is_safe_for_types<false, long long, int>());

Expand Down
8 changes: 4 additions & 4 deletions tests/std/tests/P0088R3_variant/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6528,11 +6528,11 @@ int run_test() {

return 0;
}
#else // ^^ real test / vv workaround
#else // ^^^ no workaround / workaround vvv
int run_test() {
return 0;
}
#endif // _HAS_CXX20 && !defined(__EDG__) && !defined(TEST_PERMISSIVE)
#endif // ^^^ workaround ^^^

} // namespace visit
// -- END: test/std/utilities/variant/variant.visit/visit.pass.cpp
Expand Down Expand Up @@ -7058,11 +7058,11 @@ int run_test() {

return 0;
}
#else // ^^ real tests / vv workaround
#else // ^^^ no workaround / workaround vvv
int run_test() {
return 0;
}
#endif // _HAS_CXX20 && !defined(__EDG__) && !defined(TEST_PERMISSIVE)
#endif // ^^^ workaround ^^^
} // namespace visit::return_type
// -- END: test/std/utilities/variant/variant.visit/visit_return_type.pass.cpp

Expand Down
Loading