diff --git a/stl/inc/functional b/stl/inc/functional index 421d21805dd..bfc928f5dd2 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -747,20 +747,11 @@ struct _Invoker_ret { // selected for _Rx being cv void template struct _Invoker_ret<_Rx, false> { // selected for all _Rx other than cv void and _Unforced -#ifdef __EDG__ // TRANSITION, VSO-1132186 - template class _Is_nothrow = _Select_invoke_traits<_Fx, _Valtys...>::template _Is_nothrow_invocable_r> - static _CONSTEXPR20 _Rx _Call(_Fx&& _Func, _Valtys&&... _Vals) noexcept(_Is_nothrow<_Rx>::value) { - // INVOKE, implicitly converted to _Rx - return _STD invoke(static_cast<_Fx&&>(_Func), static_cast<_Valtys&&>(_Vals)...); - } -#else // ^^^ workaround / no workaround vvv template static _CONSTEXPR20 _Rx _Call(_Fx&& _Func, _Valtys&&... _Vals) noexcept(_Select_invoke_traits<_Fx, _Valtys...>::template _Is_nothrow_invocable_r<_Rx>::value) { // INVOKE, implicitly converted to _Rx return _STD invoke(static_cast<_Fx&&>(_Func), static_cast<_Valtys&&>(_Vals)...); } -#endif // TRANSITION, VSO-1132186 }; template <> diff --git a/stl/inc/iterator b/stl/inc/iterator index fa219671771..f181c140565 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -557,12 +557,12 @@ public: } } -#if 0 // TRANSITION, VSO-1174090 +#if 0 // TRANSITION, VSO-1225825 // clang-format off _Variantish(const _Variantish&) requires is_trivially_copy_constructible_v<_It> && is_trivially_copy_constructible_v<_Se> = default; // clang-format on -#endif // TRANSITION, VSO-1174090 +#endif // TRANSITION, VSO-1225825 _Variantish(const _Variantish& _That) noexcept( noexcept(is_nothrow_copy_constructible_v<_It>&& is_nothrow_copy_constructible_v<_Se>)) @@ -579,12 +579,12 @@ public: } } -#if 0 // TRANSITION, VSO-1174090 +#if 0 // TRANSITION, VSO-1225825 // clang-format off _Variantish(_Variantish&&) requires is_trivially_move_constructible_v<_It> && is_trivially_move_constructible_v<_Se> = default; // clang-format on -#endif // TRANSITION, VSO-1174090 +#endif // TRANSITION, VSO-1225825 _Variantish(_Variantish&& _That) noexcept( is_nothrow_move_constructible_v<_It>&& is_nothrow_move_constructible_v<_Se>) @@ -601,16 +601,17 @@ public: } } -#if 0 // TRANSITION, VSO-1174090 +#if 0 // TRANSITION, VSO-1225825 // clang-format off ~_Variantish() requires is_trivially_destructible_v<_It> && is_trivially_destructible_v<_Se> = default; // clang-format on -#endif // TRANSITION, VSO-1174090 +#endif // TRANSITION, VSO-1225825 + ~_Variantish() { _Raw_clear(); } -#if 0 // TRANSITION, VSO-1174090 +#if 0 // TRANSITION, VSO-1225825 // clang-format off _Variantish& operator=(const _Variantish&) requires is_trivially_destructible_v<_It> && is_trivially_destructible_v<_Se> @@ -619,7 +620,7 @@ public: && is_trivially_copy_assignable_v<_It> && is_trivially_copy_assignable_v<_Se> = default; // clang-format on -#endif // TRANSITION, VSO-1174090 +#endif // TRANSITION, VSO-1225825 _Variantish& operator=(const _Variantish& _That) noexcept( is_nothrow_copy_constructible_v<_It>&& is_nothrow_copy_constructible_v<_Se>&& @@ -657,7 +658,7 @@ public: return *this; } -#if 0 // TRANSITION, VSO-1174090 +#if 0 // TRANSITION, VSO-1225825 // clang-format off _Variantish& operator=(_Variantish&&) requires is_trivially_destructible_v<_It> && is_trivially_destructible_v<_Se> @@ -666,7 +667,7 @@ public: && is_trivially_move_assignable_v<_It> && is_trivially_move_assignable_v<_Se> = default; // clang-format on -#endif // TRANSITION, VSO-1174090 +#endif // TRANSITION, VSO-1225825 _Variantish& operator=(_Variantish&& _That) noexcept( is_nothrow_move_constructible_v<_It>&& is_nothrow_move_constructible_v<_Se>&& diff --git a/stl/inc/ranges b/stl/inc/ranges index 1947d90b18e..776e1310efe 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -15,9 +15,9 @@ #include #include -#if 1 // TRANSITION, VSO-1174090 +#if 1 // TRANSITION, VSO-1225825 #include -#endif // TRANSITION, VSO-1174090 +#endif // TRANSITION, VSO-1225825 #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) @@ -244,7 +244,7 @@ namespace ranges { using _Cached_position_t = conditional_t<_Enable, _Cached_position<_Rng, _Derived>, view_interface<_Derived>>; // CLASS TEMPLATE ranges::_Semiregular_box -#if 0 // TRANSITION, VSO-1174090 +#if 0 // TRANSITION, VSO-1225825 template <_Copy_constructible_object _Ty> class _Semiregular_box { public: @@ -531,7 +531,7 @@ namespace ranges { private: /* [[no_unique_address]] */ _Ty _Val = _Ty(); }; -#endif // TRANSITION, VSO-1174090 +#endif // TRANSITION, VSO-1225825 // CLASS TEMPLATE ranges::empty_view // clang-format off diff --git a/stl/inc/utility b/stl/inc/utility index 1727b5ca4b6..53e38b608af 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -697,7 +697,7 @@ _NODISCARD constexpr bool cmp_greater_equal(const _Ty1 _Left, const _Ty2 _Right) // FUNCTION TEMPLATE in_range template -_NODISCARD constexpr _Ty _Min_limit() noexcept { // same as (numeric_limits<_Ty>::min)(), less throughput cost +_NODISCARD _CONSTEVAL _Ty _Min_limit() noexcept { // same as (numeric_limits<_Ty>::min)(), less throughput cost static_assert(_Is_standard_integer<_Ty>); // doesn't attempt to handle all types if constexpr (is_signed_v<_Ty>) { constexpr auto _Unsigned_max = static_cast>(-1); @@ -708,7 +708,7 @@ _NODISCARD constexpr _Ty _Min_limit() noexcept { // same as (numeric_limits<_Ty> } template -_NODISCARD constexpr _Ty _Max_limit() noexcept { // same as (numeric_limits<_Ty>::max)(), less throughput cost +_NODISCARD _CONSTEVAL _Ty _Max_limit() noexcept { // same as (numeric_limits<_Ty>::max)(), less throughput cost static_assert(_Is_standard_integer<_Ty>); // doesn't attempt to handle all types if constexpr (is_signed_v<_Ty>) { constexpr auto _Unsigned_max = static_cast>(-1); diff --git a/stl/inc/xutility b/stl/inc/xutility index e655abfe542..c40a1b30c4c 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -474,21 +474,11 @@ concept _Cpp17_input_iterator = _Cpp17_iterator<_It> requires signed_integral::difference_type>; }; -#if 1 // TRANSITION, VSO-1002863 -template -using _Member_iterator_category = typename _Ty::iterator_category; -#endif // TRANSITION, VSO-1002863 - template requires (!_Has_iter_types<_It> && _Cpp17_iterator<_It> && !_Cpp17_input_iterator<_It> // Implements the proposed resolution of LWG-3283: -#if 1 // TRANSITION, VSO-1002863 - && (!requires { typename _It::iterator_category; } - || derived_from<_Member_iterator_category<_It>, output_iterator_tag>)) -#else // ^^^ workaround / no workaround vvv && (!requires { typename _It::iterator_category; } || derived_from)) -#endif // TRANSITION, VSO-1002863 struct _Iterator_traits_base<_It> { using iterator_category = output_iterator_tag; using difference_type = @@ -1494,20 +1484,20 @@ _INLINE_VAR constexpr bool template constexpr void _Seek_wrapped(_Iter& _It, _UIter&& _UIt) { if constexpr (_Wrapped_seekable_v<_Iter, _UIter>) { - _It._Seek_to(static_cast<_UIter&&>(_UIt)); + _It._Seek_to(_STD forward<_UIter>(_UIt)); } else { - _It = static_cast<_UIter&&>(_UIt); + _It = _STD forward<_UIter>(_UIt); } } #else // ^^^ _HAS_IF_CONSTEXPR / !_HAS_IF_CONSTEXPR vvv template , int> = 0> constexpr void _Seek_wrapped(_Iter& _It, _UIter&& _UIt) { - _It._Seek_to(static_cast<_UIter&&>(_UIt)); + _It._Seek_to(_STD forward<_UIter>(_UIt)); } template , int> = 0> constexpr void _Seek_wrapped(_Iter& _It, _UIter&& _UIt) { - _It = static_cast<_UIter&&>(_UIt); + _It = _STD forward<_UIter>(_UIt); } template diff --git a/tests/std/tests/P0088R3_variant/test.cpp b/tests/std/tests/P0088R3_variant/test.cpp index 3a96506be06..2857e561b3a 100644 --- a/tests/std/tests/P0088R3_variant/test.cpp +++ b/tests/std/tests/P0088R3_variant/test.cpp @@ -6485,7 +6485,6 @@ namespace msvc { namespace derived_variant { void run_test() { -#ifndef __EDG__ // TRANSITION, VSO-1178211 // Extension: std::visit accepts types derived from a specialization of variant. { struct my_variant : std::variant { @@ -6538,7 +6537,6 @@ namespace msvc { } catch (std::bad_variant_access&) { } } -#endif // TRANSITION, VSO-1178211 } } // namespace derived_variant diff --git a/tests/std/tests/P0896R4_P1614R2_comparisons/test.cpp b/tests/std/tests/P0896R4_P1614R2_comparisons/test.cpp index 31a3665198a..4f100192065 100644 --- a/tests/std/tests/P0896R4_P1614R2_comparisons/test.cpp +++ b/tests/std/tests/P0896R4_P1614R2_comparisons/test.cpp @@ -417,9 +417,7 @@ constexpr void ordering_test_cases() { test_strongly_ordered(13U, u8'x'); #endif // __cpp_char8_t test_strongly_ordered(13U, u'x'); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1062618 test_strongly_ordered(13U, U'x'); -#endif // TRANSITION, VSO-1062618 test_strongly_ordered(scoped{13}, scoped{42}); test_strongly_ordered(unscoped{13}, unscoped{42}); diff --git a/tests/std/tests/P0896R4_ranges_alg_heap/test.cpp b/tests/std/tests/P0896R4_ranges_alg_heap/test.cpp index d938ff02434..ac24c5645f2 100644 --- a/tests/std/tests/P0896R4_ranges_alg_heap/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_heap/test.cpp @@ -108,16 +108,11 @@ struct make_and_sort_heap_test { ASSERT(!is_heap(wrapped, less{}, get_first)); -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 - if constexpr (!ranges::contiguous_range) -#endif // TRANSITION, VSO-938163 - { - make_heap(wrapped, less{}, get_first); - ASSERT(is_heap(wrapped, less{}, get_first)); - - sort_heap(wrapped, less{}, get_first); - ASSERT(is_sorted(wrapped, less{}, get_first)); - } + make_heap(wrapped, less{}, get_first); + ASSERT(is_heap(wrapped, less{}, get_first)); + + sort_heap(wrapped, less{}, get_first); + ASSERT(is_sorted(wrapped, less{}, get_first)); } { @@ -126,16 +121,11 @@ struct make_and_sort_heap_test { ASSERT(!is_heap(wrapped.begin(), wrapped.end(), less{}, get_first)); -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 - if constexpr (!ranges::contiguous_range) -#endif // TRANSITION, VSO-938163 - { - make_heap(wrapped.begin(), wrapped.end(), less{}, get_first); - ASSERT(is_heap(wrapped.begin(), wrapped.end(), less{}, get_first)); + make_heap(wrapped.begin(), wrapped.end(), less{}, get_first); + ASSERT(is_heap(wrapped.begin(), wrapped.end(), less{}, get_first)); - sort_heap(wrapped.begin(), wrapped.end(), less{}, get_first); - ASSERT(is_sorted(wrapped.begin(), wrapped.end(), less{}, get_first)); - } + sort_heap(wrapped.begin(), wrapped.end(), less{}, get_first); + ASSERT(is_sorted(wrapped.begin(), wrapped.end(), less{}, get_first)); } } }; @@ -192,34 +182,24 @@ struct push_and_pop_heap_test { auto buff = initial_values; const Range wrapped{buff}; -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 - if constexpr (!ranges::contiguous_range) -#endif // TRANSITION, VSO-938163 - { - pop_heap(wrapped, less{}, get_first); - ASSERT(equal(wrapped, expectedPopped)); + pop_heap(wrapped, less{}, get_first); + ASSERT(equal(wrapped, expectedPopped)); - push_heap(wrapped, less{}, get_first); - ASSERT(equal(wrapped, expectedPushed)); - } + push_heap(wrapped, less{}, get_first); + ASSERT(equal(wrapped, expectedPushed)); } { auto buff = initial_values; const Range wrapped{buff}; -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 - if constexpr (!ranges::contiguous_range) -#endif // TRANSITION, VSO-938163 - { - pop_heap(wrapped.begin(), wrapped.end(), less{}, get_first); - ASSERT(is_heap(expectedPopped.begin(), expectedPopped.end() - 1, less{}, get_first)); - ASSERT(equal(wrapped.begin(), wrapped.end(), expectedPopped.begin(), expectedPopped.end())); - - push_heap(wrapped.begin(), wrapped.end(), less{}, get_first); - ASSERT(is_heap(expectedPushed, less{}, get_first)); - ASSERT(equal(wrapped.begin(), wrapped.end(), expectedPushed.begin(), expectedPushed.end())); - } + pop_heap(wrapped.begin(), wrapped.end(), less{}, get_first); + ASSERT(is_heap(expectedPopped.begin(), expectedPopped.end() - 1, less{}, get_first)); + ASSERT(equal(wrapped.begin(), wrapped.end(), expectedPopped.begin(), expectedPopped.end())); + + push_heap(wrapped.begin(), wrapped.end(), less{}, get_first); + ASSERT(is_heap(expectedPushed, less{}, get_first)); + ASSERT(equal(wrapped.begin(), wrapped.end(), expectedPushed.begin(), expectedPushed.end())); } } }; diff --git a/tests/std/tests/P0896R4_ranges_alg_move/test.cpp b/tests/std/tests/P0896R4_ranges_alg_move/test.cpp index dbd4e70a55f..9bf09c04d34 100644 --- a/tests/std/tests/P0896R4_ranges_alg_move/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_move/test.cpp @@ -37,36 +37,30 @@ struct instantiator { template > Write> static constexpr void call() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 -#pragma warning(suppress : 4127) // conditional expression is constant - if (!ranges::contiguous_range || !is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 + using ranges::move, ranges::move_result, ranges::equal, ranges::iterator_t; { - using ranges::move, ranges::move_result, ranges::equal, ranges::iterator_t; - { - int_wrapper input[3] = {13, 55, 12345}; - int_wrapper output[3] = {-2, -2, -2}; - Read wrapped_input{input}; + int_wrapper input[3] = {13, 55, 12345}; + int_wrapper output[3] = {-2, -2, -2}; + Read wrapped_input{input}; - auto result = move(wrapped_input, Write{output}); - STATIC_ASSERT(same_as, Write>>); - assert(result.in == wrapped_input.end()); - assert(result.out.peek() == output + 3); - assert(equal(output, expected_output)); - assert(equal(input, expected_input)); - } - { - int_wrapper input[3] = {13, 55, 12345}; - int_wrapper output[3] = {-2, -2, -2}; - Read wrapped_input{input}; + auto result = move(wrapped_input, Write{output}); + STATIC_ASSERT(same_as, Write>>); + assert(result.in == wrapped_input.end()); + assert(result.out.peek() == output + 3); + assert(equal(output, expected_output)); + assert(equal(input, expected_input)); + } + { + int_wrapper input[3] = {13, 55, 12345}; + int_wrapper output[3] = {-2, -2, -2}; + Read wrapped_input{input}; - auto result = move(wrapped_input.begin(), wrapped_input.end(), Write{output}); - STATIC_ASSERT(same_as, Write>>); - assert(result.in == wrapped_input.end()); - assert(result.out.peek() == output + 3); - assert(equal(output, expected_output)); - assert(equal(input, expected_input)); - } + auto result = move(wrapped_input.begin(), wrapped_input.end(), Write{output}); + STATIC_ASSERT(same_as, Write>>); + assert(result.in == wrapped_input.end()); + assert(result.out.peek() == output + 3); + assert(equal(output, expected_output)); + assert(equal(input, expected_input)); } } }; diff --git a/tests/std/tests/P0896R4_ranges_alg_move_backward/test.cpp b/tests/std/tests/P0896R4_ranges_alg_move_backward/test.cpp index 06c17f7953f..30ccd3d19e4 100644 --- a/tests/std/tests/P0896R4_ranges_alg_move_backward/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_move_backward/test.cpp @@ -42,50 +42,44 @@ struct instantiator { template static constexpr void call() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 -#pragma warning(suppress : 4127) // conditional expression is constant - if (!ranges::contiguous_range || !is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 - { - // For the second range, we need an iterator to the end; it's expedient to simply ignore ranges with - // differing iterator and sentinel types (i.e., ranges that don't satisfy common_range). - if constexpr (ranges::common_range) { - using ranges::move_backward, ranges::move_backward_result, ranges::equal, ranges::iterator_t; - - { // Validate range overload - int_wrapper input[] = {13, 42, 1729}; - int_wrapper output[] = {-2, -2, -2}; - R1 wrapped_input{input}; - R2 wrapped_output{output}; - same_as, iterator_t>> auto result = - move_backward(wrapped_input, wrapped_output.end()); - assert(result.in == wrapped_input.end()); - assert(result.out == wrapped_output.begin()); - assert(equal(output, expected_output, ranges::equal_to{}, &int_wrapper::val)); - assert(equal(input, expected_input, ranges::equal_to{}, &int_wrapper::val)); - } - { // Validate iterator + sentinel overload - int_wrapper input[] = {13, 42, 1729}; - int_wrapper output[] = {-2, -2, -2}; - R1 wrapped_input{input}; - R2 wrapped_output{output}; - same_as, iterator_t>> auto result = - move_backward(wrapped_input.begin(), wrapped_input.end(), wrapped_output.end()); - assert(result.in == wrapped_input.end()); - assert(result.out == wrapped_output.begin()); - assert(equal(output, expected_output, ranges::equal_to{}, &int_wrapper::val)); - assert(equal(input, expected_input, ranges::equal_to{}, &int_wrapper::val)); - } - { // Validate overlapping ranges - int_wrapper io[] = {0, 1, 2, 42}; - R1 wrapped_input{span{io}.first<3>()}; - R2 wrapped_output{span{io}.last<3>()}; - same_as, iterator_t>> auto result = - move_backward(wrapped_input, wrapped_output.end()); - assert(result.in == wrapped_input.end()); - assert(result.out == wrapped_output.begin()); - assert(equal(io, expected_overlapping, ranges::equal_to{}, &int_wrapper::val)); - } + // For the second range, we need an iterator to the end; it's expedient to simply ignore ranges with + // differing iterator and sentinel types (i.e., ranges that don't satisfy common_range). + if constexpr (ranges::common_range) { + using ranges::move_backward, ranges::move_backward_result, ranges::equal, ranges::iterator_t; + + { // Validate range overload + int_wrapper input[] = {13, 42, 1729}; + int_wrapper output[] = {-2, -2, -2}; + R1 wrapped_input{input}; + R2 wrapped_output{output}; + same_as, iterator_t>> auto result = + move_backward(wrapped_input, wrapped_output.end()); + assert(result.in == wrapped_input.end()); + assert(result.out == wrapped_output.begin()); + assert(equal(output, expected_output, ranges::equal_to{}, &int_wrapper::val)); + assert(equal(input, expected_input, ranges::equal_to{}, &int_wrapper::val)); + } + { // Validate iterator + sentinel overload + int_wrapper input[] = {13, 42, 1729}; + int_wrapper output[] = {-2, -2, -2}; + R1 wrapped_input{input}; + R2 wrapped_output{output}; + same_as, iterator_t>> auto result = + move_backward(wrapped_input.begin(), wrapped_input.end(), wrapped_output.end()); + assert(result.in == wrapped_input.end()); + assert(result.out == wrapped_output.begin()); + assert(equal(output, expected_output, ranges::equal_to{}, &int_wrapper::val)); + assert(equal(input, expected_input, ranges::equal_to{}, &int_wrapper::val)); + } + { // Validate overlapping ranges + int_wrapper io[] = {0, 1, 2, 42}; + R1 wrapped_input{span{io}.first<3>()}; + R2 wrapped_output{span{io}.last<3>()}; + same_as, iterator_t>> auto result = + move_backward(wrapped_input, wrapped_output.end()); + assert(result.in == wrapped_input.end()); + assert(result.out == wrapped_output.begin()); + assert(equal(io, expected_overlapping, ranges::equal_to{}, &int_wrapper::val)); } } } diff --git a/tests/std/tests/P0896R4_ranges_alg_nth_element/test.cpp b/tests/std/tests/P0896R4_ranges_alg_nth_element/test.cpp index 36b3f936650..8d34d35fc8f 100644 --- a/tests/std/tests/P0896R4_ranges_alg_nth_element/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_nth_element/test.cpp @@ -22,57 +22,51 @@ struct instantiator { template static constexpr void call() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 -#pragma warning(suppress : 4127) // conditional expression is constant - if (!ranges::contiguous_range || !is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 - { - using ranges::nth_element, ranges::all_of, ranges::find, ranges::iterator_t, ranges::less, ranges::none_of, - ranges::size; - - P input[size(keys)]; - const auto init = [&] { - for (size_t j = 0; j < size(keys); ++j) { - input[j] = P{keys[j], static_cast(10 + j)}; - } - }; + using ranges::nth_element, ranges::all_of, ranges::find, ranges::iterator_t, ranges::less, ranges::none_of, + ranges::size; - // Validate range overload - for (int i = 0; i < int{size(keys)}; ++i) { - init(); - const R wrapped{input}; - const auto nth = wrapped.begin() + i; - const same_as> auto result = nth_element(wrapped, nth, less{}, get_first); - assert(result == wrapped.end()); - assert((*nth == P{i, static_cast(10 + (find(keys, i) - keys))})); - if (nth != wrapped.end()) { - assert(all_of(wrapped.begin(), nth, [&](auto&& x) { return get_first(x) <= get_first(*nth); })); - assert(all_of(nth, wrapped.end(), [&](auto&& x) { return get_first(*nth) <= get_first(x); })); - } + P input[size(keys)]; + const auto init = [&] { + for (size_t j = 0; j < size(keys); ++j) { + input[j] = P{keys[j], static_cast(10 + j)}; } + }; - // Validate iterator overload - for (int i = 0; i < int{size(keys)}; ++i) { - init(); - const R wrapped{input}; - const auto nth = wrapped.begin() + i; - const same_as> auto result = - nth_element(wrapped.begin(), nth, wrapped.end(), less{}, get_first); - assert(result == wrapped.end()); - assert((input[i] == P{i, static_cast(10 + (find(keys, i) - keys))})); - if (nth != wrapped.end()) { - assert(all_of(wrapped.begin(), nth, [&](auto&& x) { return get_first(x) <= get_first(*nth); })); - assert(all_of(nth, wrapped.end(), [&](auto&& x) { return get_first(*nth) <= get_first(x); })); - } + // Validate range overload + for (int i = 0; i < int{size(keys)}; ++i) { + init(); + const R wrapped{input}; + const auto nth = wrapped.begin() + i; + const same_as> auto result = nth_element(wrapped, nth, less{}, get_first); + assert(result == wrapped.end()); + assert((*nth == P{i, static_cast(10 + (find(keys, i) - keys))})); + if (nth != wrapped.end()) { + assert(all_of(wrapped.begin(), nth, [&](auto&& x) { return get_first(x) <= get_first(*nth); })); + assert(all_of(nth, wrapped.end(), [&](auto&& x) { return get_first(*nth) <= get_first(x); })); } + } - { - // Validate empty range - const R range{}; - const same_as> auto result = nth_element(range, range.begin(), less{}, get_first); - assert(result == range.end()); + // Validate iterator overload + for (int i = 0; i < int{size(keys)}; ++i) { + init(); + const R wrapped{input}; + const auto nth = wrapped.begin() + i; + const same_as> auto result = + nth_element(wrapped.begin(), nth, wrapped.end(), less{}, get_first); + assert(result == wrapped.end()); + assert((input[i] == P{i, static_cast(10 + (find(keys, i) - keys))})); + if (nth != wrapped.end()) { + assert(all_of(wrapped.begin(), nth, [&](auto&& x) { return get_first(x) <= get_first(*nth); })); + assert(all_of(nth, wrapped.end(), [&](auto&& x) { return get_first(*nth) <= get_first(x); })); } } + + { + // Validate empty range + const R range{}; + const same_as> auto result = nth_element(range, range.begin(), less{}, get_first); + assert(result == range.end()); + } } }; diff --git a/tests/std/tests/P0896R4_ranges_alg_partial_sort/test.cpp b/tests/std/tests/P0896R4_ranges_alg_partial_sort/test.cpp index 3023ee38e28..cd414cad286 100644 --- a/tests/std/tests/P0896R4_ranges_alg_partial_sort/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_partial_sort/test.cpp @@ -21,34 +21,28 @@ struct instantiator { template static constexpr void call() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 -#pragma warning(suppress : 4127) // conditional expression is constant - if (!ranges::contiguous_range || !is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 - { - using ranges::partial_sort, ranges::equal, ranges::iterator_t, ranges::less, ranges::next, ranges::size; - - { // Validate range overload - for (size_t i = 0; i <= size(sorted); ++i) { - P elements[] = {{7, 10}, {5, 11}, {1, 12}, {3, 13}, {6, 14}, {4, 15}, {0, 16}, {2, 17}}; - const R range{elements}; - const auto middle = next(range.begin(), static_cast(i)); - const same_as> auto result = partial_sort(range, middle, less{}, get_first); - assert(result == range.end()); - assert(equal(range.begin(), middle, sorted + 0, sorted + i)); - } + using ranges::partial_sort, ranges::equal, ranges::iterator_t, ranges::less, ranges::next, ranges::size; + + { // Validate range overload + for (size_t i = 0; i <= size(sorted); ++i) { + P elements[] = {{7, 10}, {5, 11}, {1, 12}, {3, 13}, {6, 14}, {4, 15}, {0, 16}, {2, 17}}; + const R range{elements}; + const auto middle = next(range.begin(), static_cast(i)); + const same_as> auto result = partial_sort(range, middle, less{}, get_first); + assert(result == range.end()); + assert(equal(range.begin(), middle, sorted + 0, sorted + i)); } + } - { // Validate iterator overload - for (size_t i = 0; i <= size(sorted); ++i) { - P elements[] = {{7, 10}, {5, 11}, {1, 12}, {3, 13}, {6, 14}, {4, 15}, {0, 16}, {2, 17}}; - const R range{elements}; - const auto middle = next(range.begin(), static_cast(i)); - const same_as> auto result = - partial_sort(range.begin(), middle, range.end(), less{}, get_first); - assert(result == range.end()); - assert(equal(range.begin(), middle, sorted + 0, sorted + i)); - } + { // Validate iterator overload + for (size_t i = 0; i <= size(sorted); ++i) { + P elements[] = {{7, 10}, {5, 11}, {1, 12}, {3, 13}, {6, 14}, {4, 15}, {0, 16}, {2, 17}}; + const R range{elements}; + const auto middle = next(range.begin(), static_cast(i)); + const same_as> auto result = + partial_sort(range.begin(), middle, range.end(), less{}, get_first); + assert(result == range.end()); + assert(equal(range.begin(), middle, sorted + 0, sorted + i)); } } } diff --git a/tests/std/tests/P0896R4_ranges_alg_partial_sort_copy/test.cpp b/tests/std/tests/P0896R4_ranges_alg_partial_sort_copy/test.cpp index c757fa93519..e7ba82b960a 100644 --- a/tests/std/tests/P0896R4_ranges_alg_partial_sort_copy/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_partial_sort_copy/test.cpp @@ -33,37 +33,31 @@ constexpr P expected[] = {{0, 16}, {1, 12}, {2, 17}, {3, 13}, {4, 15}, {5, 11}}; struct instantiator1 { template static constexpr void call() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 -#pragma warning(suppress : 4127) // conditional expression is constant - if ((!ranges::contiguous_range && !ranges::contiguous_range) || !is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 - { - using ranges::partial_sort_copy, ranges::partial_sort_copy_result, ranges::equal, ranges::iterator_t, - ranges::less, ranges::min, ranges::next, ranges::size; - - P output[2 * size(source)]; - constexpr int sizes[] = {0, int{size(source) / 2}, int{size(source)}, int{2 * size(source)}}; - - { // Validate range overload - for (const int& i : sizes) { - In range1{source}; - Out range2{span{output}.first(static_cast(i))}; - const same_as, iterator_t>> auto result = - partial_sort_copy(range1, range2, less{}, get_first, get_first); - assert(result.in == range1.end()); - const auto n = min(i, int{size(source)}); - assert(result.out == range2.begin() + n); - assert(equal(range2.begin(), range2.begin() + n, expected, expected + n)); - } - - // also with empty input - In range1{}; - Out range2{output}; + using ranges::partial_sort_copy, ranges::partial_sort_copy_result, ranges::equal, ranges::iterator_t, + ranges::less, ranges::min, ranges::next, ranges::size; + + P output[2 * size(source)]; + constexpr int sizes[] = {0, int{size(source) / 2}, int{size(source)}, int{2 * size(source)}}; + + { // Validate range overload + for (const int& i : sizes) { + In range1{source}; + Out range2{span{output}.first(static_cast(i))}; const same_as, iterator_t>> auto result = partial_sort_copy(range1, range2, less{}, get_first, get_first); assert(result.in == range1.end()); - assert(result.out == range2.begin()); + const auto n = min(i, int{size(source)}); + assert(result.out == range2.begin() + n); + assert(equal(range2.begin(), range2.begin() + n, expected, expected + n)); } + + // also with empty input + In range1{}; + Out range2{output}; + const same_as, iterator_t>> auto result = + partial_sort_copy(range1, range2, less{}, get_first, get_first); + assert(result.in == range1.end()); + assert(result.out == range2.begin()); } } }; @@ -71,39 +65,32 @@ struct instantiator1 { struct instantiator2 { template static constexpr void call() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 -#pragma warning(suppress : 4127) // conditional expression is constant - if ((!ranges::contiguous_range && !ranges::contiguous_range) || !is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 - { - using ranges::partial_sort_copy, ranges::partial_sort_copy_result, ranges::equal, ranges::iterator_t, - ranges::less, ranges::min, ranges::next, ranges::size; - - P output[2 * size(source)]; - constexpr int sizes[] = {0, int{size(source) / 2}, int{size(source)}, int{2 * size(source)}}; - - { // Validate iterator overload - for (const int& i : sizes) { - In range1{source}; - Out range2{span{output}.first(static_cast(i))}; - const same_as, iterator_t>> auto result = - partial_sort_copy( - range1.begin(), range1.end(), range2.begin(), range2.end(), less{}, get_first, get_first); - assert(result.in == range1.end()); - const auto n = min(i, int{size(source)}); - assert(result.out == range2.begin() + n); - assert(equal(range2.begin(), range2.begin() + n, expected, expected + n)); - } - - // also with empty input - In range1{}; - Out range2{output}; + using ranges::partial_sort_copy, ranges::partial_sort_copy_result, ranges::equal, ranges::iterator_t, + ranges::less, ranges::min, ranges::next, ranges::size; + + P output[2 * size(source)]; + constexpr int sizes[] = {0, int{size(source) / 2}, int{size(source)}, int{2 * size(source)}}; + + { // Validate iterator overload + for (const int& i : sizes) { + In range1{source}; + Out range2{span{output}.first(static_cast(i))}; const same_as, iterator_t>> auto result = partial_sort_copy( range1.begin(), range1.end(), range2.begin(), range2.end(), less{}, get_first, get_first); assert(result.in == range1.end()); - assert(result.out == range2.begin()); + const auto n = min(i, int{size(source)}); + assert(result.out == range2.begin() + n); + assert(equal(range2.begin(), range2.begin() + n, expected, expected + n)); } + + // also with empty input + In range1{}; + Out range2{output}; + const same_as, iterator_t>> auto result = partial_sort_copy( + range1.begin(), range1.end(), range2.begin(), range2.end(), less{}, get_first, get_first); + assert(result.in == range1.end()); + assert(result.out == range2.begin()); } } }; diff --git a/tests/std/tests/P0896R4_ranges_alg_partition/test.cpp b/tests/std/tests/P0896R4_ranges_alg_partition/test.cpp index c7807e78c3d..01bff413f27 100644 --- a/tests/std/tests/P0896R4_ranges_alg_partition/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_partition/test.cpp @@ -76,42 +76,35 @@ struct partition_test { } } -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 - if (!is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 - { - if constexpr (ranges::forward_range) { - { // Validate range overloads of partition, is_partitioned, partition_point - auto pairs = elements; - const Range range{pairs}; - const auto mid = ranges::next(range.begin(), 4); - - { - auto result = partition(range, is_even, get_first); - ASSERT(result.begin() == mid); - ASSERT(result.end() == range.end()); - } - ASSERT( - is_permutation(subrange{range.begin(), mid}, array{0, 2, 4, 6}, ranges::equal_to{}, get_first)); - ASSERT(is_partitioned(range, is_even, get_first)); - ASSERT(partition_point(range, is_even, get_first) == mid); + if constexpr (ranges::forward_range) { + { // Validate range overloads of partition, is_partitioned, partition_point + auto pairs = elements; + const Range range{pairs}; + const auto mid = ranges::next(range.begin(), 4); + + { + auto result = partition(range, is_even, get_first); + ASSERT(result.begin() == mid); + ASSERT(result.end() == range.end()); } + ASSERT(is_permutation(subrange{range.begin(), mid}, array{0, 2, 4, 6}, ranges::equal_to{}, get_first)); + ASSERT(is_partitioned(range, is_even, get_first)); + ASSERT(partition_point(range, is_even, get_first) == mid); + } + + { // Validate iterator overloads of partition, is_partitioned, partition_point + auto pairs = elements; + const Range range{pairs}; + const auto mid = ranges::next(range.begin(), 4); - { // Validate iterator overloads of partition, is_partitioned, partition_point - auto pairs = elements; - const Range range{pairs}; - const auto mid = ranges::next(range.begin(), 4); - - { - auto result = partition(range.begin(), range.end(), is_even, get_first); - ASSERT(result.begin() == mid); - ASSERT(result.end() == range.end()); - } - ASSERT( - is_permutation(subrange{range.begin(), mid}, array{0, 2, 4, 6}, ranges::equal_to{}, get_first)); - ASSERT(is_partitioned(range.begin(), range.end(), is_even, get_first)); - ASSERT(partition_point(range.begin(), range.end(), is_even, get_first) == mid); + { + auto result = partition(range.begin(), range.end(), is_even, get_first); + ASSERT(result.begin() == mid); + ASSERT(result.end() == range.end()); } + ASSERT(is_permutation(subrange{range.begin(), mid}, array{0, 2, 4, 6}, ranges::equal_to{}, get_first)); + ASSERT(is_partitioned(range.begin(), range.end(), is_even, get_first)); + ASSERT(partition_point(range.begin(), range.end(), is_even, get_first) == mid); } } } diff --git a/tests/std/tests/P0896R4_ranges_alg_permutations/test.cpp b/tests/std/tests/P0896R4_ranges_alg_permutations/test.cpp index 6b8cd0037e5..c169e8212fa 100644 --- a/tests/std/tests/P0896R4_ranges_alg_permutations/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_permutations/test.cpp @@ -236,26 +236,21 @@ struct empty_range_test { }; int main() { -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-938163 STATIC_ASSERT((test_bidi(), true)); + test_bidi(); STATIC_ASSERT((test_bidi, int_wrapper>(), true)); STATIC_ASSERT((test_bidi, int_wrapper>(), true)); STATIC_ASSERT((test_bidi, int_wrapper>(), true)); - - STATIC_ASSERT((test_bidi, int_wrapper>(), true)); - STATIC_ASSERT((test_bidi, int_wrapper>(), true)); - STATIC_ASSERT((test_bidi, int_wrapper>(), true)); -#endif // TRANSITION, VSO-938163 - - test_bidi(); - test_bidi, int_wrapper>(); test_bidi, int_wrapper>(); test_bidi, int_wrapper>(); test_bidi, int_wrapper>(); test_bidi, int_wrapper>(); + STATIC_ASSERT((test_bidi, int_wrapper>(), true)); + STATIC_ASSERT((test_bidi, int_wrapper>(), true)); + STATIC_ASSERT((test_bidi, int_wrapper>(), true)); test_bidi, int_wrapper>(); test_bidi, int_wrapper>(); test_bidi, int_wrapper>(); diff --git a/tests/std/tests/P0896R4_ranges_alg_remove/test.cpp b/tests/std/tests/P0896R4_ranges_alg_remove/test.cpp index 3ddb3c33703..769c64d6ab4 100644 --- a/tests/std/tests/P0896R4_ranges_alg_remove/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_remove/test.cpp @@ -21,44 +21,38 @@ struct instantiator { template static constexpr void call() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 -#pragma warning(suppress : 4127) // conditional expression is constant - if (!ranges::contiguous_range || !is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 - { - using ranges::remove, ranges::subrange, ranges::equal, ranges::iterator_t; - - size_t projectionCounter = 0; - auto projection = [&projectionCounter](const P& val) { - ++projectionCounter; - return val.second; - }; - - { // Validate iterator + sentinel overload - P input[5] = {{0, 99}, {1, 47}, {2, 99}, {3, 47}, {4, 99}}; - Read wrapped_input{input}; - - auto result = remove(wrapped_input.begin(), wrapped_input.end(), 47, projection); - STATIC_ASSERT(same_as>>); - assert(result.begin() == next(wrapped_input.begin(), 3)); - assert(result.end() == wrapped_input.end()); - assert(equal(expected, span{input}.first<3>())); - assert(projectionCounter == ranges::size(input)); - } + using ranges::remove, ranges::subrange, ranges::equal, ranges::iterator_t; + + size_t projectionCounter = 0; + auto projection = [&projectionCounter](const P& val) { + ++projectionCounter; + return val.second; + }; + + { // Validate iterator + sentinel overload + P input[5] = {{0, 99}, {1, 47}, {2, 99}, {3, 47}, {4, 99}}; + Read wrapped_input{input}; + + auto result = remove(wrapped_input.begin(), wrapped_input.end(), 47, projection); + STATIC_ASSERT(same_as>>); + assert(result.begin() == next(wrapped_input.begin(), 3)); + assert(result.end() == wrapped_input.end()); + assert(equal(expected, span{input}.first<3>())); + assert(projectionCounter == ranges::size(input)); + } - projectionCounter = 0; + projectionCounter = 0; - { // Validate range overload - P input[5] = {{0, 99}, {1, 47}, {2, 99}, {3, 47}, {4, 99}}; - Read wrapped_input{input}; + { // Validate range overload + P input[5] = {{0, 99}, {1, 47}, {2, 99}, {3, 47}, {4, 99}}; + Read wrapped_input{input}; - auto result = remove(wrapped_input, 47, projection); - STATIC_ASSERT(same_as>>); - assert(result.begin() == next(wrapped_input.begin(), 3)); - assert(result.end() == wrapped_input.end()); - assert(equal(expected, span{input}.first<3>())); - assert(projectionCounter == ranges::size(input)); - } + auto result = remove(wrapped_input, 47, projection); + STATIC_ASSERT(same_as>>); + assert(result.begin() == next(wrapped_input.begin(), 3)); + assert(result.end() == wrapped_input.end()); + assert(equal(expected, span{input}.first<3>())); + assert(projectionCounter == ranges::size(input)); } } }; diff --git a/tests/std/tests/P0896R4_ranges_alg_remove_if/test.cpp b/tests/std/tests/P0896R4_ranges_alg_remove_if/test.cpp index 863a0e28917..386f93e0dfa 100644 --- a/tests/std/tests/P0896R4_ranges_alg_remove_if/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_remove_if/test.cpp @@ -23,44 +23,38 @@ struct instantiator { template static constexpr void call() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 -#pragma warning(suppress : 4127) // conditional expression is constant - if (!ranges::contiguous_range || !is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 - { - using ranges::remove_if, ranges::subrange, ranges::equal, ranges::iterator_t; + using ranges::remove_if, ranges::subrange, ranges::equal, ranges::iterator_t; - size_t projectionCounter = 0; - auto projection = [&projectionCounter](const P& val) { - ++projectionCounter; - return val.second; - }; + size_t projectionCounter = 0; + auto projection = [&projectionCounter](const P& val) { + ++projectionCounter; + return val.second; + }; - { // Validate iterator + sentinel overload - P input[5] = {{0, 99}, {1, 47}, {2, 99}, {3, 47}, {4, 99}}; - Read wrapped_input{input}; + { // Validate iterator + sentinel overload + P input[5] = {{0, 99}, {1, 47}, {2, 99}, {3, 47}, {4, 99}}; + Read wrapped_input{input}; - auto result = remove_if(wrapped_input.begin(), wrapped_input.end(), matches, projection); - STATIC_ASSERT(same_as>>); - assert(result.begin() == next(wrapped_input.begin(), 3)); - assert(result.end() == wrapped_input.end()); - assert(equal(expected, span{input}.first<3>())); - assert(projectionCounter == ranges::size(input)); - } + auto result = remove_if(wrapped_input.begin(), wrapped_input.end(), matches, projection); + STATIC_ASSERT(same_as>>); + assert(result.begin() == next(wrapped_input.begin(), 3)); + assert(result.end() == wrapped_input.end()); + assert(equal(expected, span{input}.first<3>())); + assert(projectionCounter == ranges::size(input)); + } - projectionCounter = 0; + projectionCounter = 0; - { // Validate range overload - P input[5] = {{0, 99}, {1, 47}, {2, 99}, {3, 47}, {4, 99}}; - Read wrapped_input{input}; + { // Validate range overload + P input[5] = {{0, 99}, {1, 47}, {2, 99}, {3, 47}, {4, 99}}; + Read wrapped_input{input}; - auto result = remove_if(wrapped_input, matches, projection); - STATIC_ASSERT(same_as>>); - assert(result.begin() == next(wrapped_input.begin(), 3)); - assert(result.end() == wrapped_input.end()); - assert(equal(expected, span{input}.first<3>())); - assert(projectionCounter == ranges::size(input)); - } + auto result = remove_if(wrapped_input, matches, projection); + STATIC_ASSERT(same_as>>); + assert(result.begin() == next(wrapped_input.begin(), 3)); + assert(result.end() == wrapped_input.end()); + assert(equal(expected, span{input}.first<3>())); + assert(projectionCounter == ranges::size(input)); } } }; diff --git a/tests/std/tests/P0896R4_ranges_alg_reverse/test.cpp b/tests/std/tests/P0896R4_ranges_alg_reverse/test.cpp index 53d0251a472..11b78e69cc6 100644 --- a/tests/std/tests/P0896R4_ranges_alg_reverse/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_reverse/test.cpp @@ -151,33 +151,21 @@ struct test_vector { }; int main() { -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-938163 STATIC_ASSERT((test_bidi(), true)); -#endif // TRANSITION, VSO-938163 test_bidi(); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-938163 STATIC_ASSERT((test_contiguous>(), true)); -#endif // TRANSITION, VSO-938163 test_contiguous>(); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-938163 STATIC_ASSERT((test_contiguous>(), true)); -#endif // TRANSITION, VSO-938163 test_contiguous>(); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-938163 STATIC_ASSERT((test_contiguous>(), true)); -#endif // TRANSITION, VSO-938163 test_contiguous>(); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-938163 STATIC_ASSERT((test_contiguous>(), true)); -#endif // TRANSITION, VSO-938163 test_contiguous>(); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-938163 STATIC_ASSERT((test_contiguous>(), true)); -#endif // TRANSITION, VSO-938163 test_contiguous>(); } diff --git a/tests/std/tests/P0896R4_ranges_alg_rotate/test.cpp b/tests/std/tests/P0896R4_ranges_alg_rotate/test.cpp index 511a83c0b98..8337cef3f5b 100644 --- a/tests/std/tests/P0896R4_ranges_alg_rotate/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_rotate/test.cpp @@ -45,8 +45,6 @@ struct instantiator { }; int main() { -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-938163 STATIC_ASSERT((test_fwd(), true)); -#endif // TRANSITION, VSO-938163 test_fwd(); } diff --git a/tests/std/tests/P0896R4_ranges_alg_sort/test.cpp b/tests/std/tests/P0896R4_ranges_alg_sort/test.cpp index 88c838a4eba..8c01b10ec60 100644 --- a/tests/std/tests/P0896R4_ranges_alg_sort/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_sort/test.cpp @@ -23,34 +23,29 @@ struct instantiator { template static constexpr void call() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 - if constexpr (!ranges::contiguous_range) -#endif // TRANSITION, VSO-938163 - { - using ranges::sort, ranges::is_sorted, ranges::iterator_t, ranges::less; - - { // Validate range overload - auto buff = input; - const R range{buff}; - const same_as> auto result = sort(range, less{}, get_first); - assert(result == range.end()); - assert(is_sorted(range, less{}, get_first)); - } - - { // Validate iterator overload - auto buff = input; - const R range{buff}; - const same_as> auto result = sort(range.begin(), range.end(), less{}, get_first); - assert(result == range.end()); - assert(is_sorted(range.begin(), range.end(), less{}, get_first)); - } - - { // Validate empty range - const R range{}; - const same_as> auto result = sort(range, less{}, get_first); - assert(result == range.end()); - assert(is_sorted(range, less{}, get_first)); - } + using ranges::sort, ranges::is_sorted, ranges::iterator_t, ranges::less; + + { // Validate range overload + auto buff = input; + const R range{buff}; + const same_as> auto result = sort(range, less{}, get_first); + assert(result == range.end()); + assert(is_sorted(range, less{}, get_first)); + } + + { // Validate iterator overload + auto buff = input; + const R range{buff}; + const same_as> auto result = sort(range.begin(), range.end(), less{}, get_first); + assert(result == range.end()); + assert(is_sorted(range.begin(), range.end(), less{}, get_first)); + } + + { // Validate empty range + const R range{}; + const same_as> auto result = sort(range, less{}, get_first); + assert(result == range.end()); + assert(is_sorted(range, less{}, get_first)); } } }; diff --git a/tests/std/tests/P0896R4_ranges_alg_swap_ranges/test.cpp b/tests/std/tests/P0896R4_ranges_alg_swap_ranges/test.cpp index 534280d29d1..17aea1f6ce2 100644 --- a/tests/std/tests/P0896R4_ranges_alg_swap_ranges/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_swap_ranges/test.cpp @@ -98,9 +98,7 @@ constexpr void run_tests() { } int main() { -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-938163 STATIC_ASSERT((run_tests(), true)); -#endif // TRANSITION, VSO-938163 run_tests(); } #endif // TEST_EVERYTHING diff --git a/tests/std/tests/P0896R4_ranges_alg_unique/test.cpp b/tests/std/tests/P0896R4_ranges_alg_unique/test.cpp index 3da1a4923e9..8e1ab7324c0 100644 --- a/tests/std/tests/P0896R4_ranges_alg_unique/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_unique/test.cpp @@ -28,40 +28,35 @@ struct instantiator { template static constexpr void call() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 - if constexpr (!ranges::contiguous_range) -#endif // TRANSITION, VSO-938163 - { - using ranges::unique, ranges::subrange, ranges::equal, ranges::size, ranges::iterator_t; + using ranges::unique, ranges::subrange, ranges::equal, ranges::size, ranges::iterator_t; - size_t comparisonCounter = 0; - const auto countedEq = make_counter(comparisonCounter); + size_t comparisonCounter = 0; + const auto countedEq = make_counter(comparisonCounter); - { // Validate iterator + sentinel overload - P input[6] = {{0, 99}, {1, 47}, {2, 47}, {3, 99}, {4, 47}, {5, 47}}; - ReadWrite wrapped_input{input}; + { // Validate iterator + sentinel overload + P input[6] = {{0, 99}, {1, 47}, {2, 47}, {3, 99}, {4, 47}, {5, 47}}; + ReadWrite wrapped_input{input}; - auto result = unique(wrapped_input.begin(), wrapped_input.end(), countedEq, get_second); - STATIC_ASSERT(same_as>>); - assert(result.begin() == next(wrapped_input.begin(), 4)); - assert(result.end() == wrapped_input.end()); - assert(equal(expected, span{input}.first<4>())); - assert(comparisonCounter == size(input) - 1); - } + auto result = unique(wrapped_input.begin(), wrapped_input.end(), countedEq, get_second); + STATIC_ASSERT(same_as>>); + assert(result.begin() == next(wrapped_input.begin(), 4)); + assert(result.end() == wrapped_input.end()); + assert(equal(expected, span{input}.first<4>())); + assert(comparisonCounter == size(input) - 1); + } - comparisonCounter = 0; + comparisonCounter = 0; - { // Validate range overload - P input[6] = {{0, 99}, {1, 47}, {2, 47}, {3, 99}, {4, 47}, {5, 47}}; - ReadWrite wrapped_input{input}; + { // Validate range overload + P input[6] = {{0, 99}, {1, 47}, {2, 47}, {3, 99}, {4, 47}, {5, 47}}; + ReadWrite wrapped_input{input}; - auto result = unique(wrapped_input, countedEq, get_second); - STATIC_ASSERT(same_as>>); - assert(result.begin() == next(wrapped_input.begin(), 4)); - assert(result.end() == wrapped_input.end()); - assert(equal(expected, span{input}.first<4>())); - assert(comparisonCounter == size(input) - 1); - } + auto result = unique(wrapped_input, countedEq, get_second); + STATIC_ASSERT(same_as>>); + assert(result.begin() == next(wrapped_input.begin(), 4)); + assert(result.end() == wrapped_input.end()); + assert(equal(expected, span{input}.first<4>())); + assert(comparisonCounter == size(input) - 1); } } }; diff --git a/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp b/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp index f748c811daf..3ad80d1b8fa 100644 --- a/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp +++ b/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp @@ -1173,9 +1173,7 @@ namespace iterator_cust_swap_test { STATIC_ASSERT(noexcept(ranges::iter_swap(&i0, &i1))); return true; } -#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-938163 STATIC_ASSERT(test()); -#endif // TRANSITION, VSO-938163 template struct swap_proxy_ref { @@ -1277,9 +1275,6 @@ namespace iterator_cust_swap_test { assert(i1 == 42); } -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 - if (!std::is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 { // Validate iter_swap bullet 3 to defend against regression of GH-1067 "ranges::iter_swap is broken" int i = 42; diff --git a/tests/std/tests/P0896R4_views_drop/test.cpp b/tests/std/tests/P0896R4_views_drop/test.cpp index aae2ce6f41b..d2795e28e09 100644 --- a/tests/std/tests/P0896R4_views_drop/test.cpp +++ b/tests/std/tests/P0896R4_views_drop/test.cpp @@ -184,9 +184,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { const bool is_empty = ranges::empty(expected); // Validate deduction guide -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 same_as> auto r = drop_view{forward(rng), 4}; using R = decltype(r); STATIC_ASSERT(ranges::view); @@ -442,17 +439,16 @@ constexpr void move_only_test() { } constexpr void output_range_test() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 - if (!is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 - { - using R = test::range; - int some_writable_ints[] = {0, 1, 2, 3}; - STATIC_ASSERT(same_as>); - ranges::fill(R{some_writable_ints} | views::drop(2), 42); - assert(ranges::equal(some_writable_ints, initializer_list{0, 1, 42, 42})); - } + using R = test::range; + int some_writable_ints[] = {0, 1, 2, 3}; + STATIC_ASSERT(same_as>); +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1217687 + ranges::fill(views::drop(R{some_writable_ints}, 2), 42); +#else // ^^^ workaround / no workaround vvv + ranges::fill(R{some_writable_ints} | views::drop(2), 42); +#endif // TRANSITION, VSO-1217687 + assert(ranges::equal(some_writable_ints, initializer_list{0, 1, 42, 42})); } int main() { diff --git a/tests/std/tests/P0896R4_views_take/test.cpp b/tests/std/tests/P0896R4_views_take/test.cpp index b0d35fc3900..cb18fa20929 100644 --- a/tests/std/tests/P0896R4_views_take/test.cpp +++ b/tests/std/tests/P0896R4_views_take/test.cpp @@ -183,9 +183,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { const bool is_empty = ranges::empty(expected); // Validate deduction guide -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 same_as> auto r = take_view{forward(rng), 4}; using R = decltype(r); STATIC_ASSERT(ranges::view); @@ -460,9 +457,9 @@ constexpr void move_only_test() { } constexpr void output_range_test() { -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-938163 +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1132704 if (!is_constant_evaluated()) -#endif // TRANSITION, VSO-938163 +#endif // TRANSITION, VSO-1132704 { using R = test::range; @@ -470,10 +467,18 @@ constexpr void output_range_test() { STATIC_ASSERT(same_as>); // How do I implement "Fill up to n elements in {output range} with {value}"? +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1217687 + ranges::fill(views::take(R{some_writable_ints}, 99999), 42); +#else // ^^^ workaround / no workaround vvv ranges::fill(R{some_writable_ints} | views::take(99999), 42); +#endif // TRANSITION, VSO-1217687 assert(ranges::equal(some_writable_ints, initializer_list{42, 42, 42, 42})); +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, VSO-1217687 + ranges::fill(views::take(R{some_writable_ints}, 3), 13); +#else // ^^^ workaround / no workaround vvv ranges::fill(R{some_writable_ints} | views::take(3), 13); +#endif // TRANSITION, VSO-1217687 assert(ranges::equal(some_writable_ints, initializer_list{13, 13, 13, 42})); } } diff --git a/tests/std/tests/P0896R4_views_transform/test.cpp b/tests/std/tests/P0896R4_views_transform/test.cpp index fb03a17c0f0..a683ba68583 100644 --- a/tests/std/tests/P0896R4_views_transform/test.cpp +++ b/tests/std/tests/P0896R4_views_transform/test.cpp @@ -159,9 +159,6 @@ constexpr bool test_one(Rng&& rng, Expected&& expected) { const bool is_empty = ranges::empty(expected); // Validate deduction guide -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, DevCom-1159442 - (void) 42; -#endif // TRANSITION, DevCom-1159442 same_as auto r = transform_view{forward(rng), add8}; using R = decltype(r); STATIC_ASSERT(ranges::view);