|
5822 | 5822 |
|
5823 | 5823 | \pnum
|
5824 | 5824 | \tcode{join_with_view} takes a \libconcept{view} and a delimiter, and
|
5825 |
| -flattens the view, |
| 5825 | +flattens the \libconcept{view}, |
5826 | 5826 | inserting every element of the delimiter
|
5827 | 5827 | in between elements of the \libconcept{view}.
|
5828 | 5828 | The delimiter can be a single element or a \libconcept{view} of elements.
|
|
5871 | 5871 | // when \tcode{!is_reference_v<\exposid{InnerRng}>}
|
5872 | 5872 | Pattern @\exposid{pattern_}@ = Pattern(); // \expos
|
5873 | 5873 |
|
| 5874 | + // \ref{range.join.with.iterator}, class template \tcode{join_with_view::\exposid{iterator}} |
5874 | 5875 | template<bool Const> struct @\exposid{iterator}@; // \expos
|
| 5876 | + // \ref{range.join.with.sentinel}, class template \tcode{join_with_view::\exposid{sentinel}} |
5875 | 5877 | template<bool Const> struct @\exposid{sentinel}@; // \expos
|
5876 | 5878 |
|
5877 | 5879 | public:
|
|
5901 | 5903 |
|
5902 | 5904 | constexpr auto end() {
|
5903 | 5905 | if constexpr (@\libconcept{forward_range}@<V> &&
|
5904 |
| - is_reference_v<InnerRng> && @\libconcept{forward_range}@<@\exposid{InnerRng}@> && |
| 5906 | + is_reference_v<@\exposid{InnerRng}@> && @\libconcept{forward_range}@<@\exposid{InnerRng}@> && |
5905 | 5907 | @\libconcept{common_range}@<V> && @\libconcept{common_range}@<@\exposid{InnerRng}@>)
|
5906 | 5908 | return @\exposid{iterator}@<@\exposconcept{simple-view}@<V> && @\exposconcept{simple-view}@<Pattern>>{*this, ranges::end(@\exposid{base_}@)};
|
5907 | 5909 | else
|
|
5910 | 5912 | constexpr auto end() const
|
5911 | 5913 | requires @\libconcept{input_range}@<const V> && @\libconcept{forward_range}@<const Pattern> &&
|
5912 | 5914 | is_reference_v<range_reference_t<const V>> {
|
5913 |
| - using @\exposid{InnerConstRng}@ = range_reference_t<const V>; |
5914 |
| - if constexpr (@\libconcept{forward_range}@<const V> && @\libconcept{forward_range}@<@\exposid{InnerConstRng}@> && |
5915 |
| - @\libconcept{common_range}@<const V> && common_range<@\exposid{InnerConstRng}@>) |
| 5915 | + using InnerConstRng = range_reference_t<const V>; |
| 5916 | + if constexpr (@\libconcept{forward_range}@<const V> && @\libconcept{forward_range}@<InnerConstRng> && |
| 5917 | + @\libconcept{common_range}@<const V> && common_range<InnerConstRng>) |
5916 | 5918 | return @\exposid{iterator}@<true>{*this, ranges::end(@\exposid{base_}@)};
|
5917 | 5919 | else
|
5918 | 5920 | return @\exposid{sentinel}@<true>{*this};
|
|
5922 | 5924 | template<class R, class P>
|
5923 | 5925 | join_with_view(R&&, P&&) -> join_with_view<views::all_t<R>, views::all_t<P>>;
|
5924 | 5926 |
|
5925 |
| - template<input_range R> |
| 5927 | + template<@\libconcept{input_range}@ R> |
5926 | 5928 | join_with_view(R&&, range_value_t<range_reference_t<R>>)
|
5927 | 5929 | -> join_with_view<views::all_t<R>, single_view<range_value_t<range_reference_t<R>>>>;
|
5928 | 5930 | }
|
|
5940 | 5942 | \end{itemdescr}
|
5941 | 5943 |
|
5942 | 5944 | \begin{itemdecl}
|
5943 |
| -template<input_range R> |
| 5945 | +template<@\libconcept{input_range}@ R> |
5944 | 5946 | requires @\libconcept{constructible_from}@<V, views::all_t<R>> &&
|
5945 | 5947 | @\libconcept{constructible_from}@<Pattern, single_view<range_value_t<@\exposid{InnerRng}@>>>
|
5946 | 5948 | constexpr join_with_view(R&& r, range_value_t<@\exposid{InnerRng}@> e);
|
|
6005 | 6007 | requires @\exposid{ref-is-glvalue}@ && @\libconcept{bidirectional_range}@<@\exposid{Base}@> &&
|
6006 | 6008 | @\exposconcept{bidirectional-common}@<@\exposid{InnerBase}@> && @\exposconcept{bidirectional-common}@<@\exposid{PatternBase}@>;
|
6007 | 6009 | constexpr @\exposid{iterator}@ operator--(int)
|
6008 |
| - requires @\exposid{ref-is-glvalue}@ && @\libconcept{bidirectional_range}@<Base> && |
| 6010 | + requires @\exposid{ref-is-glvalue}@ && @\libconcept{bidirectional_range}@<@\exposid{Base}@> && |
6009 | 6011 | @\exposconcept{bidirectional-common}@<@\exposid{InnerBase}@> && @\exposconcept{bidirectional-common}@<@\exposid{PatternBase}@>;
|
6010 | 6012 |
|
6011 | 6013 | friend constexpr bool operator==(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y)
|
|
6123 | 6125 | \effects
|
6124 | 6126 | Equivalent to:
|
6125 | 6127 | \begin{codeblock}
|
6126 |
| -if constexpr (ref-is-glvalue) |
| 6128 | +if constexpr (@\exposid{ref-is-glvalue}@) |
6127 | 6129 | return *x;
|
6128 | 6130 | else
|
6129 | 6131 | return *@\exposid{parent_}@->@\exposid{inner_}@;
|
|
6312 | 6314 | \effects
|
6313 | 6315 | Equivalent to:
|
6314 | 6316 | \begin{codeblock}
|
6315 |
| -iterator tmp = *this; |
| 6317 | +@\exposid{iterator}@ tmp = *this; |
6316 | 6318 | --*this;
|
6317 | 6319 | return tmp;
|
6318 | 6320 | \end{codeblock}
|
|
6359 | 6361 | \end{codeblock}
|
6360 | 6362 |
|
6361 | 6363 | \begin{itemdecl}
|
6362 |
| -constexpr explicit sentinel(Parent& parent); |
| 6364 | +constexpr explicit @\exposid{sentinel}@(@\exposid{Parent}@& parent); |
6363 | 6365 | \end{itemdecl}
|
6364 | 6366 |
|
6365 | 6367 | \begin{itemdescr}
|
|
0 commit comments