|
10055 | 10055 |
|
10056 | 10056 | \pnum
|
10057 | 10057 | \tcode{chunk_by_view} takes a \libconcept{view} and a predicate, and
|
10058 |
| -splits the \libconcept{view} into subranges |
| 10058 | +splits the \libconcept{view} into \tcode{subrange}s |
10059 | 10059 | between each pair of adjacent elements
|
10060 | 10060 | for which the predicate returns \tcode{false}.
|
10061 | 10061 |
|
|
10079 | 10079 | }
|
10080 | 10080 | cout << "] ";
|
10081 | 10081 | }
|
10082 |
| -// The above prints: [1, 2, 2, 3] [0, 4, 5] [2] |
10083 | 10082 | \end{codeblock}
|
| 10083 | +The above prints: \tcode{[1, 2, 2, 3] [0, 4, 5] [2]} |
10084 | 10084 | \end{example}
|
10085 | 10085 |
|
10086 | 10086 | \rSec3[range.chunk.by.view]{Class template \tcode{chunk_by_view}}
|
|
10089 | 10089 | namespace std::ranges {
|
10090 | 10090 | template<@\libconcept{forward_range}@ V, @\libconcept{indirect_binary_predicate}@<iterator_t<V>, iterator_t<V>> Pred>
|
10091 | 10091 | requires @\libconcept{view}@<V> && is_object_v<Pred>
|
10092 |
| - class chunk_by_view : public view_interface<chunk_by_view<V, Pred>>{ |
| 10092 | + class chunk_by_view : public view_interface<chunk_by_view<V, Pred>> { |
10093 | 10093 | V @\exposid{base_}@ = V(); // \expos
|
10094 | 10094 | @\exposid{copyable-box}@<Pred> @\exposid{pred_}@ = Pred(); // \expos
|
10095 | 10095 |
|
|
10126 | 10126 | \pnum
|
10127 | 10127 | \effects
|
10128 | 10128 | Initializes \exposid{base_} with \tcode{std::move(base)} and
|
10129 |
| -@\exposid{pred_}@ with \tcode{std::move(pred)}. |
| 10129 | +\exposid{pred_} with \tcode{std::move(pred)}. |
10130 | 10130 | \end{itemdescr}
|
10131 | 10131 |
|
| 10132 | +\indexlibrarymember{pred}{chunk_by_view}% |
10132 | 10133 | \begin{itemdecl}
|
10133 | 10134 | constexpr const Pred& pred() const;
|
10134 | 10135 | \end{itemdecl}
|
|
10140 | 10141 | \end{itemdescr}
|
10141 | 10142 |
|
10142 | 10143 | \begin{itemdecl}
|
10143 |
| -constexpr iterator begin(); |
| 10144 | +constexpr @\exposid{iterator}@ begin(); |
10144 | 10145 | \end{itemdecl}
|
10145 | 10146 |
|
10146 | 10147 | \begin{itemdescr}
|
|
10155 | 10156 | \pnum
|
10156 | 10157 | \remarks
|
10157 | 10158 | In order to provide
|
10158 |
| -the amortized constant-time complexity required by the range concept, |
| 10159 | +the amortized constant-time complexity required by the \libconcept{range} concept, |
10159 | 10160 | this function caches the result within the \tcode{chunk_by_view}
|
10160 | 10161 | for use on subsequent calls.
|
10161 | 10162 | \end{itemdescr}
|
@@ -10209,11 +10210,11 @@
|
10209 | 10210 |
|
10210 | 10211 | \pnum
|
10211 | 10212 | \returns
|
10212 |
| -An \exposid{iterator} \tcode{i} |
| 10213 | +An iterator \tcode{i} |
10213 | 10214 | in the range \range{ranges::begin(\exposid{base_})}{current} such that:
|
10214 | 10215 | \begin{itemize}
|
10215 | 10216 | \item
|
10216 |
| -\tcode{ranges::adjacent_find(i, current, not_fn(ref(*\exposid{pred_})))} is equal to \exposid{current}; and |
| 10217 | +\tcode{ranges::adjacent_find(i, current, not_fn(ref(*\exposid{pred_})))} is equal to \tcode{current}; and |
10217 | 10218 | \item
|
10218 | 10219 | if \tcode{i} is not equal to \tcode{ranges::begin(\exposid{base_})},
|
10219 | 10220 | then \tcode{bool(invoke(*\exposid{pred_}, *ranges::prev(i), *i))}
|
|
0 commit comments