|
334 | 334 | namespace views { inline constexpr @\unspecnc@ join = @\unspecnc@; } // freestanding
|
335 | 335 |
|
336 | 336 | // \ref{range.join.with}, join with view
|
337 |
| - template<class R, class P> |
338 |
| - concept @\exposconcept{compatible-joinable-ranges}@ = @\seebelow@; // \expos |
339 |
| - |
340 | 337 | template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
|
341 |
| - requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>> |
342 |
| - && @\libconcept{view}@<Pattern> |
343 |
| - && @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern> |
| 338 | + requires @\seebelow@ |
344 | 339 | class join_with_view; // freestanding
|
345 | 340 |
|
346 | 341 | namespace views { inline constexpr @\unspecnc@ join_with = @\unspecnc@; } // freestanding
|
|
369 | 364 | // \ref{range.concat}, concat view
|
370 | 365 | template<@\libconcept{input_range}@... Views>
|
371 | 366 | requires @\seebelow@
|
372 |
| - class concat_view; |
| 367 | + class concat_view; // freestanding |
373 | 368 |
|
374 |
| - namespace views { inline constexpr @\unspecnc@ concat = @\unspecnc@; } |
| 369 | + namespace views { inline constexpr @\unspecnc@ concat = @\unspecnc@; } // freestanding |
375 | 370 |
|
376 | 371 | // \ref{range.counted}, counted view
|
377 | 372 | namespace views { inline constexpr @\unspecnc@ counted = @\unspecnc@; } // freestanding
|
|
2668 | 2663 | Given subexpressions \tcode{E} and \tcode{F}, the expressions
|
2669 | 2664 | \tcode{views::iota(E)} and \tcode{views::iota(E, F)}
|
2670 | 2665 | are expression-equivalent to
|
2671 |
| -\tcode{iota_view(E)} and \tcode{iota_view(E, F)}, respectively. |
| 2666 | +\tcode{iota_view<decay_t<decltype((E))>>(E)} and \tcode{iota_view(E, F)}, |
| 2667 | +respectively. |
2672 | 2668 |
|
2673 | 2669 | \pnum
|
2674 | 2670 | \begin{example}
|
|
4520 | 4516 | The expression \tcode{views::as_rvalue(E)} is expression-equivalent to:
|
4521 | 4517 | \begin{itemize}
|
4522 | 4518 | \item
|
4523 |
| -\tcode{views::all(E)} if \tcode{\libconcept{same_as}<range_rvalue_reference_t<T>, range_reference_t<T>>} is \tcode{true}. |
| 4519 | +\tcode{views::all(E)} if |
| 4520 | +\tcode{T} models \libconcept{input_range} and |
| 4521 | +\tcode{\libconcept{same_as}<range_rvalue_reference_t<T>, range_reference_t<T>>} is \tcode{true}. |
4524 | 4522 | \item
|
4525 | 4523 | Otherwise, \tcode{as_rvalue_view(E)}.
|
4526 | 4524 | \end{itemize}
|
|
7023 | 7021 |
|
7024 | 7022 | \begin{codeblock}
|
7025 | 7023 | namespace std::ranges {
|
7026 |
| - template<class R, class P> |
7027 |
| - concept @\defexposconcept{compatible-joinable-ranges}@ = // \expos |
7028 |
| - @\libconcept{common_with}@<range_value_t<R>, range_value_t<P>> && |
7029 |
| - @\libconcept{common_reference_with}@<range_reference_t<R>, range_reference_t<P>> && |
7030 |
| - @\libconcept{common_reference_with}@<range_rvalue_reference_t<R>, range_rvalue_reference_t<P>>; |
7031 |
| - |
7032 | 7024 | template<class R>
|
7033 | 7025 | concept @\defexposconcept{bidirectional-common}@ = @\libconcept{bidirectional_range}@<R> && @\libconcept{common_range}@<R>; // \expos
|
7034 | 7026 |
|
7035 | 7027 | template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
|
7036 | 7028 | requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
|
7037 | 7029 | && @\libconcept{view}@<Pattern>
|
7038 |
| - && @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern> |
| 7030 | + && @\exposconcept{concatable}@<range_reference_t<V>, Pattern> |
7039 | 7031 | class join_with_view : public view_interface<join_with_view<V, Pattern>> {
|
7040 | 7032 | using @\exposid{InnerRng}@ = range_reference_t<V>; // \expos
|
7041 | 7033 |
|
|
7081 | 7073 | requires @\libconcept{forward_range}@<const V> &&
|
7082 | 7074 | @\libconcept{forward_range}@<const Pattern> &&
|
7083 | 7075 | is_reference_v<range_reference_t<const V>> &&
|
7084 |
| - @\libconcept{input_range}@<range_reference_t<const V>> { |
| 7076 | + @\libconcept{input_range}@<range_reference_t<const V>> && |
| 7077 | + @\exposconcept{concatable}@<range_reference_t<const V>, const Pattern> { |
7085 | 7078 | return @\exposid{iterator}@<true>{*this, ranges::begin(@\exposid{base_}@)};
|
7086 | 7079 | }
|
7087 | 7080 |
|
|
7096 | 7089 | constexpr auto end() const
|
7097 | 7090 | requires @\libconcept{forward_range}@<const V> && @\libconcept{forward_range}@<const Pattern> &&
|
7098 | 7091 | is_reference_v<range_reference_t<const V>> &&
|
7099 |
| - @\libconcept{input_range}@<range_reference_t<const V>> { |
| 7092 | + @\libconcept{input_range}@<range_reference_t<const V>> && |
| 7093 | + @\exposconcept{concatable}@<range_reference_t<const V>, const Pattern> { |
7100 | 7094 | using InnerConstRng = range_reference_t<const V>;
|
7101 | 7095 | if constexpr (@\libconcept{forward_range}@<InnerConstRng> &&
|
7102 | 7096 | @\libconcept{common_range}@<const V> && @\libconcept{common_range}@<InnerConstRng>)
|
|
7146 | 7140 | namespace std::ranges {
|
7147 | 7141 | template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
|
7148 | 7142 | requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
|
7149 |
| - && @\libconcept{view}@<Pattern> && @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern> |
| 7143 | + && @\libconcept{view}@<Pattern> && @\exposconcept{concatable}@<range_reference_t<V>, Pattern> |
7150 | 7144 | template<bool Const>
|
7151 | 7145 | class join_with_view<V, Pattern>::@\exposid{iterator}@ {
|
7152 | 7146 | using @\exposid{Parent}@ = @\exposid{maybe-const}@<Const, join_with_view>; // \expos
|
|
7553 | 7547 | namespace std::ranges {
|
7554 | 7548 | template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern>
|
7555 | 7549 | requires @\libconcept{view}@<V> && @\libconcept{input_range}@<range_reference_t<V>>
|
7556 |
| - && @\libconcept{view}@<Pattern> && @\exposconcept{compatible-joinable-ranges}@<range_reference_t<V>, Pattern> |
| 7550 | + && @\libconcept{view}@<Pattern> && @\exposconcept{concatable}@<range_reference_t<V>, Pattern> |
7557 | 7551 | template<bool Const>
|
7558 | 7552 | class join_with_view<V, Pattern>::@\exposid{sentinel}@ {
|
7559 | 7553 | using @\exposid{Parent}@ = @\exposid{maybe-const}@<Const, join_with_view>; // \expos
|
|
8483 | 8477 | Given a pack of subexpressions \tcode{Es...},
|
8484 | 8478 | the expression \tcode{views::concat(Es...)} is expression-equivalent to
|
8485 | 8479 | \begin{itemize}
|
8486 |
| -\item \tcode{views::all(Es...)} if \tcode{Es} is a pack with only one element, |
| 8480 | +\item \tcode{views::all(Es...)} if \tcode{Es} is a pack with only one element |
| 8481 | +whose type models \libconcept{input_range}, |
8487 | 8482 | \item otherwise, \tcode{concat_view(Es...)}.
|
8488 | 8483 | \end{itemize}
|
8489 | 8484 | \begin{example}
|
|
8987 | 8982 | \end{itemdecl}
|
8988 | 8983 |
|
8989 | 8984 | \begin{itemdescr}
|
| 8985 | +\pnum |
| 8986 | +\expects |
| 8987 | +\tcode{it.\exposid{it_}.valueless_by_exception()} is \tcode{false}. |
| 8988 | + |
8990 | 8989 | \pnum
|
8991 | 8990 | \effects
|
8992 | 8991 | Initializes \exposid{parent_} with \tcode{it.\exposid{parent_}}, and
|
|
12242 | 12241 | \begin{itemize}
|
12243 | 12242 | \item
|
12244 | 12243 | \tcode{((void)E, auto(views::empty<tuple<>>))}
|
12245 |
| -if \tcode{N} is equal to \tcode{0}, |
| 12244 | +if \tcode{N} is equal to \tcode{0} and |
| 12245 | +\tcode{decltype((E))} models \libconcept{forward_range}, |
12246 | 12246 | \item
|
12247 | 12247 | otherwise, \tcode{adjacent_view<views::all_t<decltype((E))>, N>(E)}.
|
12248 | 12248 | \end{itemize}
|
|
12875 | 12875 | a constant expression \tcode{N}:
|
12876 | 12876 | \begin{itemize}
|
12877 | 12877 | \item
|
12878 |
| -If \tcode{N} is equal to \tcode{0}, |
| 12878 | +If \tcode{N} is equal to \tcode{0} and |
| 12879 | +\tcode{decltype((E))} models \libconcept{forward_range}, |
12879 | 12880 | \tcode{views::adjacent_transform<N>(E, F)} is expression-equivalent to
|
12880 | 12881 | \tcode{((void)E, views::zip_transform(F))},
|
12881 | 12882 | except that the evaluations of \tcode{E} and \tcode{F} are
|
|
0 commit comments