From 2ff4d3447b1b5142b7e81e03fe76666b82de5267 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 16 Mar 2020 13:10:19 -0700 Subject: [PATCH] P1871R1 disable_sized_sentinel_for (#607) Rename the variable template `disable_sized_sentinel` to `disable_sized_sentinel_for` for consistency with the name of the associated concept `sized_sentinel_for`. Addresses #39. --- stl/inc/xutility | 11 +++++++---- stl/inc/yvals_core.h | 1 + .../tests/P0896R4_ranges_iterator_machinery/test.cpp | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/stl/inc/xutility b/stl/inc/xutility index 8e4bd47071..a52f1c15aa 100644 --- a/stl/inc/xutility +++ b/stl/inc/xutility @@ -744,17 +744,20 @@ concept input_or_output_iterator = requires(_It __i) { // CONCEPT sentinel_for template -concept sentinel_for = semiregular<_Se> && input_or_output_iterator<_It> && _Weakly_equality_comparable_with<_Se, _It>; +concept sentinel_for = semiregular<_Se> + && input_or_output_iterator<_It> + && _Weakly_equality_comparable_with<_Se, _It>; // clang-format on -// VARIABLE TEMPLATE disable_sized_sentinel +// VARIABLE TEMPLATE disable_sized_sentinel_for template -inline constexpr bool disable_sized_sentinel = false; +inline constexpr bool disable_sized_sentinel_for = false; // CONCEPT sized_sentinel_for // clang-format off template -concept sized_sentinel_for = sentinel_for<_Se, _It> && !disable_sized_sentinel, remove_cv_t<_It>> +concept sized_sentinel_for = sentinel_for<_Se, _It> + && !disable_sized_sentinel_for, remove_cv_t<_It>> && requires(const _It& __i, const _Se& __s) { { __s - __i } -> same_as>; { __i - __s } -> same_as>; diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index b4750163bf..b3ba75dddd 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -191,6 +191,7 @@ // P1716R3 Range Comparison Algorithms Are Over-Constrained // P1754R1 Rename Concepts To standard_case // P1870R1 Rename forwarding-range To borrowed_range (Was safe_range before LWG-3379) +// P1871R1 disable_sized_sentinel_for // P1872R0 span Should Have size_type, Not index_type // P1878R1 Constraining Readable Types // P1956R1 has_single_bit(), bit_ceil(), bit_floor(), bit_width() diff --git a/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp b/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp index 2ea0b9e2d9..36b95a3104 100644 --- a/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp +++ b/tests/std/tests/P0896R4_ranges_iterator_machinery/test.cpp @@ -228,7 +228,7 @@ std::iter_difference_t> operator-( // clang-format on template -inline constexpr bool std::disable_sized_sentinel, I> = true; +inline constexpr bool std::disable_sized_sentinel_for, I> = true; inline constexpr std::size_t sized_sentinel_archetype_max = 12;