From 9fd617167097cceacf4db5a328e98348daa66366 Mon Sep 17 00:00:00 2001 From: slymz Date: Tue, 6 Jun 2023 21:28:24 -0700 Subject: [PATCH] renamed concat-random-access and concat-bidirectional to concat-is-random-access and concat-is-bidirectional, respectively --- concat.lwg.feedback.md | 2 ++ concat.md | 60 +++++++++++++++++++++--------------------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/concat.lwg.feedback.md b/concat.lwg.feedback.md index 115726f..fb1e85e 100644 --- a/concat.lwg.feedback.md +++ b/concat.lwg.feedback.md @@ -82,6 +82,8 @@ synopsis) after zip and cartesian_product was in. Wants to make sure we don't define it again. (But we don't. So...) - Hui: Maybe they meant that we should add `Const` as template parameter for concepts like `concat-random-access` and `concat-bidirectional`, like what they did for `all-random-access` etc. So that we don't repeat the `maybe_const` in the every usage of `concat-random-access`? What do you think? + - Levent: Sounds right! Also the naming can be more consistent with https://eel.is/c++draft/range.cartesian#view, + `concat-is-random-access` instead of `concat-random-access` etc. - [TODO] do we want to avoid emplacing ranges we don't need to use? - Hui: Good point. I think this refers to `advance_fwd` and `advance_bwd`. Maybe we can do something smarter. diff --git a/concat.md b/concat.md index 9bfc8ca..d2f5817 100644 --- a/concat.md +++ b/concat.md @@ -477,7 +477,7 @@ namespace std::ranges { concept @_concatable_@ = @*see below*@; // exposition only template - concept @_concat-random-access_@ = // exposition only + concept @_concat-is-random-access_@ = // exposition only ((random_access_range && sized_range)&&...); template @@ -486,7 +486,7 @@ namespace std::ranges { (sized_range && random_access_range); template - concept @_concat-bidirectional_@ = @*see below*@; // exposition only + concept @_concat-is-bidirectional_@ = @*see below*@; // exposition only template requires (view && ...) && (sizeof...(Views) > 0) && @@ -577,12 +577,12 @@ concept @_concatable_@ = requires { // exposition only ```cpp template -concept @_concat-bidirectional_@ = @*see below*@; // exposition only +concept @_concat-is-bidirectional_@ = @*see below*@; // exposition only ``` :::bq -[3]{.pnum} `@_concat-bidirectional_@` is modeled by `Rs...`, if and only if, +[3]{.pnum} `@_concat-is-bidirectional_@` is modeled by `Rs...`, if and only if, - [3.1]{.pnum} The last element of `Rs...` models `bidirectional_range`, - [3.2]{.pnum} And, all except the last element of `Rs...` model `@_constant-time-reversible_@`. @@ -719,19 +719,19 @@ namespace std::ranges{ requires @*all-forward*@; constexpr @_iterator_@& operator--() - requires @_concat-bidirectional_@<@_maybe-const_@...>; + requires @_concat-is-bidirectional_@<@_maybe-const_@...>; constexpr @_iterator_@ operator--(int) - requires @_concat-bidirectional_@<@_maybe-const_@...>; + requires @_concat-is-bidirectional_@<@_maybe-const_@...>; constexpr @_iterator_@& operator+=(difference_type n) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; constexpr @_iterator_@& operator-=(difference_type n) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; constexpr decltype(auto) operator[](difference_type n) const - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; friend constexpr bool operator==(const @_iterator_@& x, const @_iterator_@& y) requires(equality_comparable>>&&...); @@ -755,22 +755,22 @@ namespace std::ranges{ (three_way_comparable<@_maybe-const_@> &&...)); friend constexpr @_iterator_@ operator+(const @_iterator_@& it, difference_type n) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; friend constexpr @_iterator_@ operator+(difference_type n, const @_iterator_@& it) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; friend constexpr @_iterator_@ operator-(const @_iterator_@& it, difference_type n) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; friend constexpr difference_type operator-(const @_iterator_@& x, const @_iterator_@& y) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; friend constexpr difference_type operator-(const @_iterator_@& x, default_sentinel_t) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; friend constexpr difference_type operator-(default_sentinel_t, const @_iterator_@& x) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; friend constexpr decltype(auto) iter_move(const iterator& it) noexcept(@*see below*@); @@ -783,10 +783,10 @@ namespace std::ranges{ [1]{.pnum} `@_iterator_@::iterator_concept` is defined as follows: -- [1.1]{.pnum} If `@_concat-random-access_@<@_maybe-const_@...>` +- [1.1]{.pnum} If `@_concat-is-random-access_@<@_maybe-const_@...>` is modeled, then `iterator_concept` denotes `random_access_iterator_tag`. - [1.2]{.pnum} Otherwise, if - `@_concat-bidirectional_@<@_maybe-const_@...>` is modeled, then + `@_concat-is-bidirectional_@<@_maybe-const_@...>` is modeled, then `iterator_concept` denotes `bidirectional_iterator_tag`. - [1.3]{.pnum} Otherwise, if `@*all-forward*@` is modeled, then `iterator_concept` denotes `forward_iterator_tag`. @@ -801,10 +801,10 @@ namespace std::ranges{ - [2.2]{.pnum} Otherwise, let `Cs` denote the pack of types `iterator_traits>>::iterator_category...`. - [2.2.1]{.pnum} If - `(derived_from && ...) && @_concat-random-access_@<@_maybe-const_@...>` + `(derived_from && ...) && @_concat-is-random-access_@<@_maybe-const_@...>` is true, `iterator_category` denotes `random_access_iterator_tag`. - [2.2.2]{.pnum} Otherwise, if - `(derived_from && ...) && @_concat-bidirectional_@<@_maybe-const_@...>` + `(derived_from && ...) && @_concat-is-bidirectional_@<@_maybe-const_@...>` is true, `iterator_category` denotes `bidirectional_iterator_tag`. - [2.2.3]{.pnum} Otherwise, If `(derived_from && ...)` is true, `iterator_category` denotes `forward_iterator_tag`. - [2.2.4]{.pnum} Otherwise, `iterator_category` denotes `input_iterator_tag`. @@ -1011,7 +1011,7 @@ return tmp; ```cpp constexpr @_iterator_@& operator--() - requires @_concat-bidirectional_@<@_maybe-const_@...>; + requires @_concat-is-bidirectional_@<@_maybe-const_@...>; ``` :::bq @@ -1029,7 +1029,7 @@ return *this; ```cpp constexpr @_iterator_@ operator--(int) - requires @_concat-bidirectional_@<@_maybe-const_@...>; + requires @_concat-is-bidirectional_@<@_maybe-const_@...>; ``` :::bq @@ -1046,7 +1046,7 @@ return tmp; ```cpp constexpr @_iterator_@& operator+=(difference_type n) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; ``` :::bq @@ -1068,7 +1068,7 @@ return *this; ```cpp constexpr @_iterator_@& operator-=(difference_type n) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; ``` :::bq @@ -1086,7 +1086,7 @@ return *this; ```cpp constexpr decltype(auto) operator[](difference_type n) const - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; ``` :::bq @@ -1168,7 +1168,7 @@ return x.@*it_*@ @*op*@ y.@*it_*@; ```cpp friend constexpr @_iterator_@ operator+(const @_iterator_@& it, difference_type n) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; ``` :::bq @@ -1185,7 +1185,7 @@ return @_iterator_@{it} += n; ```cpp friend constexpr @_iterator_@ operator+(difference_type n, const @_iterator_@& it) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; ``` :::bq @@ -1202,7 +1202,7 @@ return it + n; ```cpp friend constexpr @_iterator_@ operator-(const @_iterator_@& it, difference_type n) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; ``` :::bq @@ -1219,7 +1219,7 @@ return @*iterator*@{it} -= n; ```cpp friend constexpr difference_type operator-(const @_iterator_@& x, const @_iterator_@& y) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; ``` :::bq @@ -1259,7 +1259,7 @@ denote `y.@*it_*@.index()` ```cpp friend constexpr difference_type operator-(const @_iterator_@& x, default_sentinel_t) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; ``` :::bq @@ -1281,7 +1281,7 @@ return -(static_cast(@*d~x~*@) + static_cast(s ```cpp friend constexpr difference_type operator-(default_sentinel_t, const @_iterator_@& x) - requires @_concat-random-access_@<@_maybe-const_@...>; + requires @_concat-is-random-access_@<@_maybe-const_@...>; ``` :::bq