Skip to content
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
2 changes: 1 addition & 1 deletion stl/inc/compare
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>;
{ _Left < _Right } -> _Implicitly_convertible_to<bool>;
{ _Right < _Left } -> _Implicitly_convertible_to<bool>; // missing requirement in N4861, see LWG-3465
{ _Right < _Left } -> _Implicitly_convertible_to<bool>;
};
// clang-format on

Expand Down
2 changes: 0 additions & 2 deletions stl/inc/iterator
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -1114,7 +1113,6 @@ public:
_NODISCARD constexpr decltype(auto) operator*() const noexcept(noexcept(*_Current)) /* strengthened */
requires _Dereferenceable<const _Iter> {
#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;
Expand Down
31 changes: 14 additions & 17 deletions stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ namespace ranges {
// clang-format off
template <class... _Types>
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)...} {}
Expand Down Expand Up @@ -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>, iterator_t<_Base>> { // constraints per LWG issue
// unnumbered as of 2020-09-03
requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>> {
#if _ITERATOR_DEBUG_LEVEL != 0
_Left._Same_range(_Right);
#endif // _ITERATOR_DEBUG_LEVEL != 0
Expand Down Expand Up @@ -1749,8 +1748,8 @@ namespace ranges {
}
};

template <class _Rng> // Per P/R of LWG-3447
take_view(_Rng&&, range_difference_t<_Rng>)->take_view<views::all_t<_Rng>>;
template <class _Rng>
take_view(_Rng&&, range_difference_t<_Rng>) -> take_view<views::all_t<_Rng>>;

namespace views {
// VARIABLE views::take
Expand Down Expand Up @@ -1889,7 +1888,7 @@ namespace ranges {

// clang-format off
template <bool _OtherConst = !_Const>
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
Expand Down Expand Up @@ -1952,7 +1951,7 @@ namespace ranges {
// clang-format off
_NODISCARD constexpr auto begin() const noexcept(
noexcept(_RANGES begin(_Range))) /* strengthened */ requires range<const _Vw>
&& indirect_unary_predicate<const _Pr, iterator_t<const _Vw>> { // Per Resolution of LWG-3450
&& indirect_unary_predicate<const _Pr, iterator_t<const _Vw>> {
// clang-format on
return _RANGES begin(_Range);
}
Expand All @@ -1972,7 +1971,6 @@ namespace ranges {
_NODISCARD constexpr auto end() const noexcept(
noexcept(_RANGES end(_Range)) && is_nothrow_move_constructible_v<_Sentinel<true>>) /* strengthened */
requires range<const _Vw> && indirect_unary_predicate<const _Pr, iterator_t<const _Vw>> {
// Per Resolution of LWG-3450
// clang-format on
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Pred, "value-initialized take_while_view cannot call end");
Expand Down Expand Up @@ -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<const _Vw> && sized_range<const _Vw>)) {
// clang-format on
if constexpr (sized_range<_Vw> && random_access_range<_Vw>) {
Expand Down Expand Up @@ -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<const _Vw> && sized_range<const _Vw> {
// clang-format on
const auto _Offset = (_STD min)(_RANGES distance(_Range), _Count);
Expand Down Expand Up @@ -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> {
Expand Down Expand Up @@ -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>, iterator_t<_Base>> { // Per LWG-3483
requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>> {
return _Left._Current - _Right._Current;
}
};
Expand Down Expand Up @@ -2867,7 +2864,7 @@ namespace ranges {
}

// clang-format off
template <bool _OtherConst> // Per resolution of LWG-3406
template <bool _OtherConst>
requires sentinel_for<sentinel_t<_Base>, 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 */ {
Expand All @@ -2876,7 +2873,7 @@ namespace ranges {
}

// clang-format off
template <bool _OtherConst> // Per resolution of LWG-3406
template <bool _OtherConst>
requires sized_sentinel_for<sentinel_t<_Base>, 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(
Expand All @@ -2886,7 +2883,7 @@ namespace ranges {
}

// clang-format off
template <bool _OtherConst> // Per resolution of LWG-3406
template <bool _OtherConst>
requires sized_sentinel_for<sentinel_t<_Base>, 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(
Expand Down Expand Up @@ -2922,14 +2919,14 @@ namespace ranges {
_NODISCARD constexpr _Iterator<true> begin() const
noexcept(noexcept(_RANGES begin(_Range))
&& is_nothrow_move_constructible_v<iterator_t<const _Vw>>) /* strengthened */
requires range<const _Vw> { // Per resolution of LWG-3406
requires range<const _Vw> {
return _Iterator<true>{_RANGES begin(_Range)};
}

// clang-format off
_NODISCARD constexpr auto end() noexcept(noexcept(
_RANGES end(_Range)) && is_nothrow_move_constructible_v<sentinel_t<_Vw>>) /* strengthened */
requires (!_Simple_view<_Vw>) { // Per resolution of LWG-3406
requires (!_Simple_view<_Vw>) {
// clang-format on
if constexpr (common_range<_Vw>) {
return _Iterator<false>{_RANGES end(_Range)};
Expand Down
14 changes: 5 additions & 9 deletions stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ template <_Has_member_element_type _Ty>
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::element_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<typename _Ty::value_type>, remove_cv_t<typename _Ty::element_type>>
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::value_type> {};
Expand Down Expand Up @@ -473,7 +473,7 @@ struct _Iter_traits_difference<false> {

// clang-format off
template <class _It>
concept _Cpp17_iterator = // per LWG-3420
concept _Cpp17_iterator =
requires(_It __i) {
{ *__i } -> _Can_reference;
{ ++__i } -> same_as<_It&>;
Expand Down Expand Up @@ -765,7 +765,7 @@ concept indirectly_writable = requires(_It&& __i, _Ty&& __t) {
// CONCEPT _Integer_like
// clang-format off
template <class _Ty>
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 <class _Ty>
Expand All @@ -778,7 +778,7 @@ using _Make_unsigned_like_t = make_unsigned_t<_Ty>;

// ALIAS TEMPLATE _Make_signed_like_t
template <class _Ty>
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
Expand Down Expand Up @@ -1912,7 +1912,6 @@ public:
// clang-format off
template <class _Other>
#ifdef __cpp_lib_concepts
// Per LWG-3435
requires (!is_same_v<_Other, _BidIt>) && convertible_to<const _Other&, _BidIt>
#endif // __cpp_lib_concepts
_CONSTEXPR17 reverse_iterator(const reverse_iterator<_Other>& _Right) noexcept(
Expand All @@ -1921,7 +1920,6 @@ public:

template <class _Other>
#ifdef __cpp_lib_concepts
// Per LWG-3435
requires (!is_same_v<_Other, _BidIt>) && convertible_to<const _Other&, _BidIt>
&& assignable_from<_BidIt&, const _Other&>
#endif // __cpp_lib_concepts
Expand Down Expand Up @@ -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 <class _Rng>
Expand Down Expand Up @@ -4006,7 +4004,6 @@ public:
// clang-format off
template <class _Other>
#ifdef __cpp_lib_concepts
// per LWG-3435
requires (!is_same_v<_Other, _Iter>) && convertible_to<const _Other&, _Iter>
#endif // __cpp_lib_concepts
_CONSTEXPR17 move_iterator(const move_iterator<_Other>& _Right) noexcept(
Expand All @@ -4015,7 +4012,6 @@ public:

template <class _Other>
#ifdef __cpp_lib_concepts
// per LWG-3435
requires (!is_same_v<_Other, _Iter>) && convertible_to<const _Other&, _Iter>
&& assignable_from<_Iter&, const _Other&>
#endif // __cpp_lib_concepts
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P0896R4_counted_iterator_death/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void test_case_operator_dereference_value_initialized_iterator() {

void test_case_operator_dereference_end_iterator() {
counted_iterator<int*> 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() {
Expand Down