Skip to content

Commit 560bcea

Browse files
Remove comments for resolved LWG issues (#1456)
Co-authored-by: Stephan T. Lavavej <[email protected]>
1 parent ff4c45b commit 560bcea

File tree

5 files changed

+21
-30
lines changed

5 files changed

+21
-30
lines changed

stl/inc/compare

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ namespace _Compare_partial_order_fallback {
776776
concept _Can_fallback_eq_lt_twice = requires(_Ty1& _Left, _Ty2& _Right) {
777777
{ _Left == _Right } -> _Implicitly_convertible_to<bool>;
778778
{ _Left < _Right } -> _Implicitly_convertible_to<bool>;
779-
{ _Right < _Left } -> _Implicitly_convertible_to<bool>; // missing requirement in N4861, see LWG-3465
779+
{ _Right < _Left } -> _Implicitly_convertible_to<bool>;
780780
};
781781
// clang-format on
782782

stl/inc/iterator

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,6 @@ public:
11051105
// [counted.iter.elem]
11061106
_NODISCARD constexpr decltype(auto) operator*() noexcept(noexcept(*_Current)) /* strengthened */ {
11071107
#if _ITERATOR_DEBUG_LEVEL != 0
1108-
// Per proposed resolution of LWG-3472
11091108
_STL_VERIFY(_Length > 0, "counted_iterator dereference beyond end of range");
11101109
#endif // _ITERATOR_DEBUG_LEVEL != 0
11111110
return *_Current;
@@ -1114,7 +1113,6 @@ public:
11141113
_NODISCARD constexpr decltype(auto) operator*() const noexcept(noexcept(*_Current)) /* strengthened */
11151114
requires _Dereferenceable<const _Iter> {
11161115
#if _ITERATOR_DEBUG_LEVEL != 0
1117-
// Per proposed resolution of LWG-3472
11181116
_STL_VERIFY(_Length > 0, "counted_iterator dereference beyond end of range");
11191117
#endif // _ITERATOR_DEBUG_LEVEL != 0
11201118
return *_Current;

stl/inc/ranges

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ namespace ranges {
584584
// clang-format off
585585
template <class... _Types>
586586
requires constructible_from<_Ty, _Types...>
587-
constexpr explicit single_view(in_place_t, _Types&&... _Args) noexcept( // explicit per LWG-3428
587+
constexpr explicit single_view(in_place_t, _Types&&... _Args) noexcept(
588588
is_nothrow_constructible_v<_Ty, _Types...>) // strengthened
589589
// clang-format on
590590
: _Val{in_place, _STD forward<_Types>(_Args)...} {}
@@ -1393,8 +1393,7 @@ namespace ranges {
13931393

13941394
_NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left,
13951395
const _Iterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */
1396-
requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>> { // constraints per LWG issue
1397-
// unnumbered as of 2020-09-03
1396+
requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>> {
13981397
#if _ITERATOR_DEBUG_LEVEL != 0
13991398
_Left._Same_range(_Right);
14001399
#endif // _ITERATOR_DEBUG_LEVEL != 0
@@ -1749,8 +1748,8 @@ namespace ranges {
17491748
}
17501749
};
17511750

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

17551754
namespace views {
17561755
// VARIABLE views::take
@@ -1889,7 +1888,7 @@ namespace ranges {
18891888

18901889
// clang-format off
18911890
template <bool _OtherConst = !_Const>
1892-
requires sentinel_for<_Base_sentinel, _Maybe_const_iter<_OtherConst>> // Per Resolution of LWG-3449
1891+
requires sentinel_for<_Base_sentinel, _Maybe_const_iter<_OtherConst>>
18931892
_NODISCARD friend constexpr bool operator==(
18941893
const _Maybe_const_iter<_OtherConst>& _Left, const _Sentinel& _Right) {
18951894
// clang-format on
@@ -1952,7 +1951,7 @@ namespace ranges {
19521951
// clang-format off
19531952
_NODISCARD constexpr auto begin() const noexcept(
19541953
noexcept(_RANGES begin(_Range))) /* strengthened */ requires range<const _Vw>
1955-
&& indirect_unary_predicate<const _Pr, iterator_t<const _Vw>> { // Per Resolution of LWG-3450
1954+
&& indirect_unary_predicate<const _Pr, iterator_t<const _Vw>> {
19561955
// clang-format on
19571956
return _RANGES begin(_Range);
19581957
}
@@ -1972,7 +1971,6 @@ namespace ranges {
19721971
_NODISCARD constexpr auto end() const noexcept(
19731972
noexcept(_RANGES end(_Range)) && is_nothrow_move_constructible_v<_Sentinel<true>>) /* strengthened */
19741973
requires range<const _Vw> && indirect_unary_predicate<const _Pr, iterator_t<const _Vw>> {
1975-
// Per Resolution of LWG-3450
19761974
// clang-format on
19771975
#if _CONTAINER_DEBUG_LEVEL > 0
19781976
_STL_VERIFY(_Pred, "value-initialized take_while_view cannot call end");
@@ -2052,7 +2050,7 @@ namespace ranges {
20522050
}
20532051

20542052
// clang-format off
2055-
_NODISCARD constexpr auto begin() // constraints per proposed resolution of LWG-3482
2053+
_NODISCARD constexpr auto begin()
20562054
requires (!(_Simple_view<_Vw> && random_access_range<const _Vw> && sized_range<const _Vw>)) {
20572055
// clang-format on
20582056
if constexpr (sized_range<_Vw> && random_access_range<_Vw>) {
@@ -2098,7 +2096,7 @@ namespace ranges {
20982096
}
20992097

21002098
// clang-format off
2101-
_NODISCARD constexpr auto begin() const // constraints per proposed resolution of LWG-3482
2099+
_NODISCARD constexpr auto begin() const
21022100
requires random_access_range<const _Vw> && sized_range<const _Vw> {
21032101
// clang-format on
21042102
const auto _Offset = (_STD min)(_RANGES distance(_Range), _Count);
@@ -2363,7 +2361,6 @@ namespace ranges {
23632361
common_view() = default;
23642362
constexpr explicit common_view(_Vw _Base_) noexcept(is_nothrow_move_constructible_v<_Vw>) // strengthened
23652363
: _Base(_STD move(_Base_)) {}
2366-
// converting constructor template omitted per LWG-3405
23672364

23682365
_NODISCARD constexpr _Vw base() const& noexcept(
23692366
is_nothrow_copy_constructible_v<_Vw>) /* strengthened */ requires copy_constructible<_Vw> {
@@ -2827,7 +2824,7 @@ namespace ranges {
28272824

28282825
_NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left,
28292826
const _Iterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */
2830-
requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>> { // Per LWG-3483
2827+
requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>> {
28312828
return _Left._Current - _Right._Current;
28322829
}
28332830
};
@@ -2867,7 +2864,7 @@ namespace ranges {
28672864
}
28682865

28692866
// clang-format off
2870-
template <bool _OtherConst> // Per resolution of LWG-3406
2867+
template <bool _OtherConst>
28712868
requires sentinel_for<sentinel_t<_Base>, iterator_t<_Maybe_const<_OtherConst, _Vw>>>
28722869
_NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left,
28732870
const _Sentinel& _Right) noexcept(noexcept(_Get_current(_Left) == _Right._Last)) /* strengthened */ {
@@ -2876,7 +2873,7 @@ namespace ranges {
28762873
}
28772874

28782875
// clang-format off
2879-
template <bool _OtherConst> // Per resolution of LWG-3406
2876+
template <bool _OtherConst>
28802877
requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<_Maybe_const<_OtherConst, _Vw>>>
28812878
_NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> operator-(
28822879
const _Iterator<_OtherConst>& _Left, const _Sentinel& _Right) noexcept(
@@ -2886,7 +2883,7 @@ namespace ranges {
28862883
}
28872884

28882885
// clang-format off
2889-
template <bool _OtherConst> // Per resolution of LWG-3406
2886+
template <bool _OtherConst>
28902887
requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<_Maybe_const<_OtherConst, _Vw>>>
28912888
_NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> operator-(
28922889
const _Sentinel& _Left, const _Iterator<_OtherConst>& _Right) noexcept(
@@ -2922,14 +2919,14 @@ namespace ranges {
29222919
_NODISCARD constexpr _Iterator<true> begin() const
29232920
noexcept(noexcept(_RANGES begin(_Range))
29242921
&& is_nothrow_move_constructible_v<iterator_t<const _Vw>>) /* strengthened */
2925-
requires range<const _Vw> { // Per resolution of LWG-3406
2922+
requires range<const _Vw> {
29262923
return _Iterator<true>{_RANGES begin(_Range)};
29272924
}
29282925

29292926
// clang-format off
29302927
_NODISCARD constexpr auto end() noexcept(noexcept(
29312928
_RANGES end(_Range)) && is_nothrow_move_constructible_v<sentinel_t<_Vw>>) /* strengthened */
2932-
requires (!_Simple_view<_Vw>) { // Per resolution of LWG-3406
2929+
requires (!_Simple_view<_Vw>) {
29332930
// clang-format on
29342931
if constexpr (common_range<_Vw>) {
29352932
return _Iterator<false>{_RANGES end(_Range)};

stl/inc/xutility

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ template <_Has_member_element_type _Ty>
413413
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::element_type> {};
414414

415415
// clang-format off
416-
template <_Has_member_value_type _Ty> // Per LWG-3446
416+
template <_Has_member_value_type _Ty>
417417
requires _Has_member_element_type<_Ty>
418418
&& same_as<remove_cv_t<typename _Ty::value_type>, remove_cv_t<typename _Ty::element_type>>
419419
struct indirectly_readable_traits<_Ty> : _Cond_value_type<typename _Ty::value_type> {};
@@ -473,7 +473,7 @@ struct _Iter_traits_difference<false> {
473473

474474
// clang-format off
475475
template <class _It>
476-
concept _Cpp17_iterator = // per LWG-3420
476+
concept _Cpp17_iterator =
477477
requires(_It __i) {
478478
{ *__i } -> _Can_reference;
479479
{ ++__i } -> same_as<_It&>;
@@ -765,7 +765,7 @@ concept indirectly_writable = requires(_It&& __i, _Ty&& __t) {
765765
// CONCEPT _Integer_like
766766
// clang-format off
767767
template <class _Ty>
768-
concept _Integer_like = _Is_nonbool_integral<_Ty>; // per the proposed resolution of LWG-3467
768+
concept _Integer_like = _Is_nonbool_integral<_Ty>;
769769

770770
// CONCEPT _Signed_integer_like
771771
template <class _Ty>
@@ -778,7 +778,7 @@ using _Make_unsigned_like_t = make_unsigned_t<_Ty>;
778778

779779
// ALIAS TEMPLATE _Make_signed_like_t
780780
template <class _Ty>
781-
using _Make_signed_like_t = make_signed_t<_Ty>; // per the proposed resolution of LWG-3403
781+
using _Make_signed_like_t = make_signed_t<_Ty>;
782782

783783
// CONCEPT weakly_incrementable
784784
// clang-format off
@@ -1912,7 +1912,6 @@ public:
19121912
// clang-format off
19131913
template <class _Other>
19141914
#ifdef __cpp_lib_concepts
1915-
// Per LWG-3435
19161915
requires (!is_same_v<_Other, _BidIt>) && convertible_to<const _Other&, _BidIt>
19171916
#endif // __cpp_lib_concepts
19181917
_CONSTEXPR17 reverse_iterator(const reverse_iterator<_Other>& _Right) noexcept(
@@ -1921,7 +1920,6 @@ public:
19211920

19221921
template <class _Other>
19231922
#ifdef __cpp_lib_concepts
1924-
// Per LWG-3435
19251923
requires (!is_same_v<_Other, _BidIt>) && convertible_to<const _Other&, _BidIt>
19261924
&& assignable_from<_BidIt&, const _Other&>
19271925
#endif // __cpp_lib_concepts
@@ -3333,7 +3331,7 @@ namespace ranges {
33333331
inline constexpr _Distance_fn distance{_Not_quite_object::_Construct_tag{}};
33343332

33353333
// VARIABLE ranges::ssize
3336-
class _Ssize_fn { // Per the proposed resolution of LWG-3403
3334+
class _Ssize_fn {
33373335
public:
33383336
// clang-format off
33393337
template <class _Rng>
@@ -4006,7 +4004,6 @@ public:
40064004
// clang-format off
40074005
template <class _Other>
40084006
#ifdef __cpp_lib_concepts
4009-
// per LWG-3435
40104007
requires (!is_same_v<_Other, _Iter>) && convertible_to<const _Other&, _Iter>
40114008
#endif // __cpp_lib_concepts
40124009
_CONSTEXPR17 move_iterator(const move_iterator<_Other>& _Right) noexcept(
@@ -4015,7 +4012,6 @@ public:
40154012

40164013
template <class _Other>
40174014
#ifdef __cpp_lib_concepts
4018-
// per LWG-3435
40194015
requires (!is_same_v<_Other, _Iter>) && convertible_to<const _Other&, _Iter>
40204016
&& assignable_from<_Iter&, const _Other&>
40214017
#endif // __cpp_lib_concepts

tests/std/tests/P0896R4_counted_iterator_death/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void test_case_operator_dereference_value_initialized_iterator() {
5151

5252
void test_case_operator_dereference_end_iterator() {
5353
counted_iterator<int*> cit{globalArray, 0};
54-
(void) (*cit); // cannot dereference end counted_iterator (per proposed resolution of LWG-3472)
54+
(void) (*cit); // cannot dereference end counted_iterator
5555
}
5656

5757
void test_case_operator_preincrement_value_initialized_iterator() {

0 commit comments

Comments
 (0)