Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 33 additions & 29 deletions source/ranges.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5741,11 +5741,13 @@
private:
using @\exposidnc{Parent}@ = @\exposidnc{maybe-const}@<Const, join_view>; // \expos
using @\exposidnc{Base}@ = @\exposidnc{maybe-const}@<Const, V>; // \expos
using @\exposidnc{InnerBase}@ = range_reference_t<@\exposidnc{Base}@>; // \expos

using @\exposidnc{OuterIter}@ = iterator_t<@\exposidnc{Base}@>; // \expos
using @\exposidnc{InnerIter}@ = iterator_t<range_reference_t<@\exposidnc{Base}@>>; // \expos
using @\exposidnc{InnerIter}@ = iterator_t<@\exposidnc{InnerBase}@>; // \expos

static constexpr bool @\exposidnc{ref-is-glvalue}@ = // \expos
is_reference_v<range_reference_t<@\exposidnc{Base}@>>;
is_reference_v<@\exposid{InnerBase}@>;

@\exposidnc{OuterIter}@ @\exposid{outer_}@ = @\exposidnc{OuterIter}@(); // \expos
@\exposidnc{InnerIter}@ @\exposid{inner_}@ = @\exposidnc{InnerIter}@(); // \expos
Expand All @@ -5756,7 +5758,7 @@
public:
using iterator_concept = @\seebelow@;
using iterator_category = @\seebelow@; // not always present
using value_type = range_value_t<range_reference_t<@\exposid{Base}@>>;
using value_type = range_value_t<@\exposid{InnerBase}@>;
using difference_type = @\seebelow@;

@\exposid{iterator}@() requires @\libconcept{default_initializable}@<@\exposid{OuterIter}@> &&
Expand All @@ -5776,21 +5778,21 @@
constexpr void operator++(int);
constexpr @\exposid{iterator}@ operator++(int)
requires @\exposid{ref-is-glvalue}@ && @\libconcept{forward_range}@<@\exposid{Base}@> &&
@\libconcept{forward_range}@<range_reference_t<@\exposid{Base}@>>;
@\libconcept{forward_range}@<@\exposid{InnerBase}@>;

constexpr @\exposid{iterator}@& operator--()
requires @\exposid{ref-is-glvalue}@ && @\libconcept{bidirectional_range}@<@\exposid{Base}@> &&
@\libconcept{bidirectional_range}@<range_reference_t<@\exposid{Base}@>> &&
@\libconcept{common_range}@<range_reference_t<@\exposid{Base}@>>;
@\libconcept{bidirectional_range}@<@\exposid{InnerBase}@> &&
@\libconcept{common_range}@<@\exposid{InnerBase}@>;

constexpr @\exposid{iterator}@ operator--(int)
requires @\exposid{ref-is-glvalue}@ && @\libconcept{bidirectional_range}@<@\exposid{Base}@> &&
@\libconcept{bidirectional_range}@<range_reference_t<@\exposid{Base}@>> &&
@\libconcept{common_range}@<range_reference_t<@\exposid{Base}@>>;
@\libconcept{bidirectional_range}@<@\exposid{InnerBase}@> &&
@\libconcept{common_range}@<@\exposid{InnerBase}@>;

friend constexpr bool operator==(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y)
requires @\exposid{ref-is-glvalue}@ && @\libconcept{equality_comparable}@<iterator_t<@\exposid{Base}@>> &&
@\libconcept{equality_comparable}@<iterator_t<range_reference_t<@\exposid{Base}@>>>;
requires @\exposid{ref-is-glvalue}@ && @\libconcept{equality_comparable}@<@\exposid{OuterIter}@> &&
@\libconcept{equality_comparable}@<@\exposid{InnerIter}@>;

friend constexpr decltype(auto) iter_move(const @\exposid{iterator}@& i)
noexcept(noexcept(ranges::iter_move(i.@\exposid{inner_}@))) {
Expand All @@ -5809,11 +5811,11 @@
\begin{itemize}
\item If \exposid{ref-is-glvalue} is \tcode{true},
\exposid{Base} models \libconcept{bidirectional_range}, and
\tcode{range_reference_t<\exposid{Base}>} models
both \libconcept{bidirectional_range} and \libconcept{common_range},
\exposid{InnerBase} models
both \libconcept{bi\-directional_range} and \libconcept{common_range},
then \tcode{iterator_concept} denotes \tcode{bidirectio\-nal_iterator_tag}.
\item Otherwise, if \exposid{ref-is-glvalue} is \tcode{true} and
\exposid{Base} and \tcode{range_reference_t<\exposid{Base}>}
\exposid{Base} and \exposid{InnerBase}
each model \libconceptx{for\-ward_range}{forward_range}, then \tcode{iterator_concept} denotes
\tcode{forward_iterator_tag}.
\item Otherwise, \tcode{iterator_concept} denotes \tcode{input_iterator_tag}.
Expand All @@ -5823,18 +5825,18 @@
The member \grammarterm{typedef-name} \tcode{iterator_category} is defined
if and only if \exposid{ref-is-glvalue} is \tcode{true},
\exposid{Base} models \libconcept{forward_range}, and
\tcode{range_reference_t<\exposid{Base}>} models \libconcept{forward_range}.
\exposid{InnerBase} models \libconcept{forward_range}.
In that case,
\tcode{iterator::iter\-ator_category} is defined as follows:
\begin{itemize}
\item Let \placeholder{OUTERC} denote
\tcode{iterator_traits<iterator_t<\exposid{Base}>>::iterator_category}, and
\tcode{iterator_traits<\exposid{OuterIter}>::iterator_category}, and
let \placeholder{INNERC} denote
\tcode{iterator_traits<iterator_t<range_reference_t<\exposid{Base}>>>::iterator_category}.
\tcode{iterator_traits<\exposid{InnerIter}>::iterator_category}.
\item If
\placeholder{OUTERC} and \placeholder{INNERC} each model
\tcode{\libconcept{derived_from}<bidirectional_iterator_tag>} and
\tcode{range_reference_t<\exposid{Base}>} models \libconcept{common_range},
\exposid{InnerBase} models \libconcept{common_range},
\tcode{iterator_category} denotes \tcode{bidirectional_iterator_tag}.
\item Otherwise, if
\placeholder{OUTERC} and \placeholder{INNERC} each model
Expand All @@ -5849,7 +5851,7 @@
\begin{codeblock}
common_type_t<
range_difference_t<@\exposid{Base}@>,
range_difference_t<range_reference_t<@\exposid{Base}@>>>
range_difference_t<@\exposid{InnerBase}@>>
\end{codeblock}

\pnum
Expand All @@ -5865,7 +5867,7 @@
\effects
Equivalent to:
\begin{codeblock}
auto update_inner = [this](const iterator_t<@\exposid{Base}@>& x) -> auto&& {
auto update_inner = [this](const @\exposid{OuterIter}@& x) -> auto&& {
if constexpr (@\exposid{ref-is-glvalue}@) // \tcode{*x} is a reference
return *x;
else
Expand Down Expand Up @@ -5964,7 +5966,7 @@
\begin{itemdecl}
constexpr @\exposid{iterator}@ operator++(int)
requires @\exposid{ref-is-glvalue}@ && @\libconcept{forward_range}@<@\exposid{Base}@> &&
@\libconcept{forward_range}@<range_reference_t<@\exposid{Base}@>>;
@\libconcept{forward_range}@<@\exposid{InnerBase}@>;
\end{itemdecl}

\begin{itemdescr}
Expand All @@ -5982,8 +5984,8 @@
\begin{itemdecl}
constexpr @\exposid{iterator}@& operator--()
requires @\exposid{ref-is-glvalue}@ && @\libconcept{bidirectional_range}@<@\exposid{Base}@> &&
@\libconcept{bidirectional_range}@<range_reference_t<@\exposid{Base}@>> &&
@\libconcept{common_range}@<range_reference_t<@\exposid{Base}@>>;
@\libconcept{bidirectional_range}@<@\exposid{InnerBase}@> &&
@\libconcept{common_range}@<@\exposid{InnerBase}@>;
\end{itemdecl}

\begin{itemdescr}
Expand All @@ -6004,8 +6006,8 @@
\begin{itemdecl}
constexpr @\exposid{iterator}@ operator--(int)
requires @\exposid{ref-is-glvalue}@ && @\libconcept{bidirectional_range}@<@\exposid{Base}@> &&
@\libconcept{bidirectional_range}@<range_reference_t<@\exposid{Base}@>> &&
@\libconcept{common_range}@<range_reference_t<@\exposid{Base}@>>;
@\libconcept{bidirectional_range}@<@\exposid{InnerBase}@> &&
@\libconcept{common_range}@<@\exposid{InnerBase}@>;
\end{itemdecl}

\begin{itemdescr}
Expand All @@ -6022,8 +6024,8 @@
\indexlibrarymember{operator==}{join_view::iterator}%
\begin{itemdecl}
friend constexpr bool operator==(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y)
requires @\exposid{ref-is-glvalue}@ && @\libconcept{equality_comparable}@<iterator_t<@\exposid{Base}@>> &&
@\libconcept{equality_comparable}@<iterator_t<range_reference_t<@\exposid{Base}@>>>;
requires @\exposid{ref-is-glvalue}@ && @\libconcept{equality_comparable}@<@\exposid{OuterIter}@> &&
@\libconcept{equality_comparable}@<@\exposid{InnerIter}@>;
\end{itemdecl}

\begin{itemdescr}
Expand Down Expand Up @@ -6191,6 +6193,7 @@
@\exposconcept{simple-view}@<V> && is_reference_v<@\exposid{InnerRng}@> && @\exposconcept{simple-view}@<Pattern>;
return @\exposid{iterator}@<use_const>{*this, ranges::begin(@\exposid{base_}@)};
}

constexpr auto begin() const
requires @\libconcept{input_range}@<const V> &&
@\libconcept{forward_range}@<const Pattern> &&
Expand All @@ -6206,6 +6209,7 @@
else
return @\exposid{sentinel}@<@\exposconcept{simple-view}@<V> && @\exposconcept{simple-view}@<Pattern>>{*this};
}

constexpr auto end() const
requires @\libconcept{input_range}@<const V> && @\libconcept{forward_range}@<const Pattern> &&
is_reference_v<range_reference_t<const V>> {
Expand Down Expand Up @@ -6263,7 +6267,7 @@
class join_with_view<V, Pattern>::@\exposid{iterator}@ {
using @\exposid{Parent}@ = @\exposid{maybe-const}@<Const, join_with_view>; // \expos
using @\exposid{Base}@ = @\exposid{maybe-const}@<Const, V>; // \expos
using @\exposid{InnerBase}@ = range_reference_t<Base>; // \expos
using @\exposid{InnerBase}@ = range_reference_t<@\exposid{Base}@>; // \expos
using @\exposid{PatternBase}@ = @\exposid{maybe-const}@<Const, Pattern>; // \expos

using @\exposid{OuterIter}@ = iterator_t<@\exposid{Base}@>; // \expos
Expand All @@ -6276,7 +6280,7 @@
@\exposid{OuterIter}@ @\exposid{outer_it_}@ = @\exposid{OuterIter}@(); // \expos
variant<@\exposid{PatternIter}@, @\exposid{InnerIter}@> @\exposid{inner_it_}@; // \expos

constexpr @\exposid{iterator}@(@\exposid{Parent}@& parent, iterator_t<@\exposid{Base}@> outer); // \expos
constexpr @\exposid{iterator}@(@\exposid{Parent}@& parent, @\exposid{OuterIter}@ outer); // \expos
constexpr auto&& @\exposid{update-inner}@(const @\exposid{OuterIter}@&); // \expos
constexpr auto&& @\exposid{get-inner}@(const @\exposid{OuterIter}@&); // \expos
constexpr void @\exposid{satisfy}@(); // \expos
Expand Down Expand Up @@ -6466,7 +6470,7 @@
\end{itemdescr}

\begin{itemdecl}
constexpr iterator(@\exposid{Parent}@& parent, iterator_t<@\exposid{Base}@> outer);
constexpr iterator(@\exposid{Parent}@& parent, @\exposid{OuterIter}@ outer);
\end{itemdecl}

\begin{itemdescr}
Expand Down