diff --git a/stl/inc/compare b/stl/inc/compare index 360b6d8a2b4..d40440c5a1b 100644 --- a/stl/inc/compare +++ b/stl/inc/compare @@ -776,7 +776,7 @@ namespace _Compare_partial_order_fallback { concept _Can_fallback_eq_lt_twice = requires(_Ty1& _Left, _Ty2& _Right) { { _Left == _Right } -> _Implicitly_convertible_to; { _Left < _Right } -> _Implicitly_convertible_to; - { _Right < _Left } -> _Implicitly_convertible_to; // missing requirement in N4861, see LWG-3465 + { _Right < _Left } -> _Implicitly_convertible_to; }; // clang-format on diff --git a/stl/inc/iterator b/stl/inc/iterator index 0539de6cdfd..39452a5bd75 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -1105,7 +1105,6 @@ public: // [counted.iter.elem] _NODISCARD constexpr decltype(auto) operator*() noexcept(noexcept(*_Current)) /* strengthened */ { #if _ITERATOR_DEBUG_LEVEL != 0 - // Per proposed resolution of LWG-3472 _STL_VERIFY(_Length > 0, "counted_iterator dereference beyond end of range"); #endif // _ITERATOR_DEBUG_LEVEL != 0 return *_Current; @@ -1114,7 +1113,6 @@ public: _NODISCARD constexpr decltype(auto) operator*() const noexcept(noexcept(*_Current)) /* strengthened */ requires _Dereferenceable { #if _ITERATOR_DEBUG_LEVEL != 0 - // Per proposed resolution of LWG-3472 _STL_VERIFY(_Length > 0, "counted_iterator dereference beyond end of range"); #endif // _ITERATOR_DEBUG_LEVEL != 0 return *_Current; diff --git a/stl/inc/ranges b/stl/inc/ranges index a6eeefed238..577cdd0d323 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -584,7 +584,7 @@ namespace ranges { // clang-format off template requires constructible_from<_Ty, _Types...> - constexpr explicit single_view(in_place_t, _Types&&... _Args) noexcept( // explicit per LWG-3428 + constexpr explicit single_view(in_place_t, _Types&&... _Args) noexcept( is_nothrow_constructible_v<_Ty, _Types...>) // strengthened // clang-format on : _Val{in_place, _STD forward<_Types>(_Args)...} {} @@ -1393,8 +1393,7 @@ namespace ranges { _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ - requires sized_sentinel_for, iterator_t<_Base>> { // constraints per LWG issue - // unnumbered as of 2020-09-03 + requires sized_sentinel_for, iterator_t<_Base>> { #if _ITERATOR_DEBUG_LEVEL != 0 _Left._Same_range(_Right); #endif // _ITERATOR_DEBUG_LEVEL != 0 @@ -1749,8 +1748,8 @@ namespace ranges { } }; - template // Per P/R of LWG-3447 - take_view(_Rng&&, range_difference_t<_Rng>)->take_view>; + template + take_view(_Rng&&, range_difference_t<_Rng>) -> take_view>; namespace views { // VARIABLE views::take @@ -1889,7 +1888,7 @@ namespace ranges { // clang-format off template - requires sentinel_for<_Base_sentinel, _Maybe_const_iter<_OtherConst>> // Per Resolution of LWG-3449 + requires sentinel_for<_Base_sentinel, _Maybe_const_iter<_OtherConst>> _NODISCARD friend constexpr bool operator==( const _Maybe_const_iter<_OtherConst>& _Left, const _Sentinel& _Right) { // clang-format on @@ -1952,7 +1951,7 @@ namespace ranges { // clang-format off _NODISCARD constexpr auto begin() const noexcept( noexcept(_RANGES begin(_Range))) /* strengthened */ requires range - && indirect_unary_predicate> { // Per Resolution of LWG-3450 + && indirect_unary_predicate> { // clang-format on return _RANGES begin(_Range); } @@ -1972,7 +1971,6 @@ namespace ranges { _NODISCARD constexpr auto end() const noexcept( noexcept(_RANGES end(_Range)) && is_nothrow_move_constructible_v<_Sentinel>) /* strengthened */ requires range && indirect_unary_predicate> { - // Per Resolution of LWG-3450 // clang-format on #if _CONTAINER_DEBUG_LEVEL > 0 _STL_VERIFY(_Pred, "value-initialized take_while_view cannot call end"); @@ -2052,7 +2050,7 @@ namespace ranges { } // clang-format off - _NODISCARD constexpr auto begin() // constraints per proposed resolution of LWG-3482 + _NODISCARD constexpr auto begin() requires (!(_Simple_view<_Vw> && random_access_range && sized_range)) { // clang-format on if constexpr (sized_range<_Vw> && random_access_range<_Vw>) { @@ -2098,7 +2096,7 @@ namespace ranges { } // clang-format off - _NODISCARD constexpr auto begin() const // constraints per proposed resolution of LWG-3482 + _NODISCARD constexpr auto begin() const requires random_access_range && sized_range { // clang-format on const auto _Offset = (_STD min)(_RANGES distance(_Range), _Count); @@ -2363,7 +2361,6 @@ namespace ranges { common_view() = default; constexpr explicit common_view(_Vw _Base_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened : _Base(_STD move(_Base_)) {} - // converting constructor template omitted per LWG-3405 _NODISCARD constexpr _Vw base() const& noexcept( is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ requires copy_constructible<_Vw> { @@ -2827,7 +2824,7 @@ namespace ranges { _NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left, const _Iterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */ - requires sized_sentinel_for, iterator_t<_Base>> { // Per LWG-3483 + requires sized_sentinel_for, iterator_t<_Base>> { return _Left._Current - _Right._Current; } }; @@ -2867,7 +2864,7 @@ namespace ranges { } // clang-format off - template // Per resolution of LWG-3406 + template requires sentinel_for, iterator_t<_Maybe_const<_OtherConst, _Vw>>> _NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left, const _Sentinel& _Right) noexcept(noexcept(_Get_current(_Left) == _Right._Last)) /* strengthened */ { @@ -2876,7 +2873,7 @@ namespace ranges { } // clang-format off - template // Per resolution of LWG-3406 + template requires sized_sentinel_for, iterator_t<_Maybe_const<_OtherConst, _Vw>>> _NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> operator-( const _Iterator<_OtherConst>& _Left, const _Sentinel& _Right) noexcept( @@ -2886,7 +2883,7 @@ namespace ranges { } // clang-format off - template // Per resolution of LWG-3406 + template requires sized_sentinel_for, iterator_t<_Maybe_const<_OtherConst, _Vw>>> _NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> operator-( const _Sentinel& _Left, const _Iterator<_OtherConst>& _Right) noexcept( @@ -2922,14 +2919,14 @@ namespace ranges { _NODISCARD constexpr _Iterator begin() const noexcept(noexcept(_RANGES begin(_Range)) && is_nothrow_move_constructible_v>) /* strengthened */ - requires range { // Per resolution of LWG-3406 + requires range { return _Iterator{_RANGES begin(_Range)}; } // clang-format off _NODISCARD constexpr auto end() noexcept(noexcept( _RANGES end(_Range)) && is_nothrow_move_constructible_v>) /* strengthened */ - requires (!_Simple_view<_Vw>) { // Per resolution of LWG-3406 + requires (!_Simple_view<_Vw>) { // clang-format on if constexpr (common_range<_Vw>) { return _Iterator{_RANGES end(_Range)}; diff --git a/stl/inc/xutility b/stl/inc/xutility index ca2499bd1c7..acdfe28d346 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -413,7 +413,7 @@ template <_Has_member_element_type _Ty> struct indirectly_readable_traits<_Ty> : _Cond_value_type {}; // clang-format off -template <_Has_member_value_type _Ty> // Per LWG-3446 +template <_Has_member_value_type _Ty> requires _Has_member_element_type<_Ty> && same_as, remove_cv_t> struct indirectly_readable_traits<_Ty> : _Cond_value_type {}; @@ -473,7 +473,7 @@ struct _Iter_traits_difference { // clang-format off template -concept _Cpp17_iterator = // per LWG-3420 +concept _Cpp17_iterator = requires(_It __i) { { *__i } -> _Can_reference; { ++__i } -> same_as<_It&>; @@ -765,7 +765,7 @@ concept indirectly_writable = requires(_It&& __i, _Ty&& __t) { // CONCEPT _Integer_like // clang-format off template -concept _Integer_like = _Is_nonbool_integral<_Ty>; // per the proposed resolution of LWG-3467 +concept _Integer_like = _Is_nonbool_integral<_Ty>; // CONCEPT _Signed_integer_like template @@ -778,7 +778,7 @@ using _Make_unsigned_like_t = make_unsigned_t<_Ty>; // ALIAS TEMPLATE _Make_signed_like_t template -using _Make_signed_like_t = make_signed_t<_Ty>; // per the proposed resolution of LWG-3403 +using _Make_signed_like_t = make_signed_t<_Ty>; // CONCEPT weakly_incrementable // clang-format off @@ -1912,7 +1912,6 @@ public: // clang-format off template #ifdef __cpp_lib_concepts - // Per LWG-3435 requires (!is_same_v<_Other, _BidIt>) && convertible_to #endif // __cpp_lib_concepts _CONSTEXPR17 reverse_iterator(const reverse_iterator<_Other>& _Right) noexcept( @@ -1921,7 +1920,6 @@ public: template #ifdef __cpp_lib_concepts - // Per LWG-3435 requires (!is_same_v<_Other, _BidIt>) && convertible_to && assignable_from<_BidIt&, const _Other&> #endif // __cpp_lib_concepts @@ -3333,7 +3331,7 @@ namespace ranges { inline constexpr _Distance_fn distance{_Not_quite_object::_Construct_tag{}}; // VARIABLE ranges::ssize - class _Ssize_fn { // Per the proposed resolution of LWG-3403 + class _Ssize_fn { public: // clang-format off template @@ -4006,7 +4004,6 @@ public: // clang-format off template #ifdef __cpp_lib_concepts - // per LWG-3435 requires (!is_same_v<_Other, _Iter>) && convertible_to #endif // __cpp_lib_concepts _CONSTEXPR17 move_iterator(const move_iterator<_Other>& _Right) noexcept( @@ -4015,7 +4012,6 @@ public: template #ifdef __cpp_lib_concepts - // per LWG-3435 requires (!is_same_v<_Other, _Iter>) && convertible_to && assignable_from<_Iter&, const _Other&> #endif // __cpp_lib_concepts diff --git a/tests/std/tests/P0896R4_counted_iterator_death/test.cpp b/tests/std/tests/P0896R4_counted_iterator_death/test.cpp index 523490ee19f..436658e2a0e 100644 --- a/tests/std/tests/P0896R4_counted_iterator_death/test.cpp +++ b/tests/std/tests/P0896R4_counted_iterator_death/test.cpp @@ -51,7 +51,7 @@ void test_case_operator_dereference_value_initialized_iterator() { void test_case_operator_dereference_end_iterator() { counted_iterator cit{globalArray, 0}; - (void) (*cit); // cannot dereference end counted_iterator (per proposed resolution of LWG-3472) + (void) (*cit); // cannot dereference end counted_iterator } void test_case_operator_preincrement_value_initialized_iterator() {