std::ranges::join_with_view<V,Pattern>::iterator
class /*iterator*/
ranges::join_with_view <V, Pattern>::iterator
is the type of the iterators returned by begin()
and end()
of ranges::join_with_view <V, Pattern>.
The state of an iterator of this class is managed as if there are two nested iterators:
- an outer iterator into the parent range *
parent_
- If
Base
modelsforward_range
, it isouter_it_
. - Otherwise, it is
parent_
->outer_it_
.
- If
- an inner iterator
inner_it_
into the pattern rangeparent_
->pattern_
or into a child range of the parent range
This iterator class has the invariant that the inner iterator is always dereferenceable unless the outer iterator is not dereferenceable. When an iterator is constructed, incremented or decremented, its outer iterator might be adjusted to hold the invariant.
Contents
[edit] Template parameters
[edit] Nested types
Exposition-only types
Iterator property types
value_type
std::common_type_t <ranges::range_value_t <InnerBase
>,
ranges::range_value_t <PatternBase
>>
difference_type
std::common_type_t <ranges::range_difference_t <Base
>,
ranges::range_difference_t <InnerBase
>,
ranges::range_difference_t <PatternBase
>>
[edit] Determining the iterator concept
iterator_concept
is defined as follows:
- If all following conditions are satisfied,
iterator_concept
denotes std::bidirectional_iterator_tag :- std::is_reference_v <
InnerBase
> is true. -
Base
modelsbidirectional_range
. -
InnerBase
andPatternBase
each modelcommon_range
.
- std::is_reference_v <
- Otherwise, if all following conditions are satisfied,
iterator_concept
denotes std::forward_iterator_tag :- std::is_reference_v <
InnerBase
> is true. -
Base
andInnerBase
each modelforward_range
.
- std::is_reference_v <
- Otherwise,
iterator_concept
denotes std::input_iterator_tag .
[edit] Determining the iterator category
Given the following types:
- Let
OuterC
be std::iterator_traits <OuterIter
>::iterator_category. - Let
InnerC
be std::iterator_traits <InnerIter
>::iterator_category. - Let
PatternC
be std::iterator_traits <PatternIter
>::iterator_category.
iterator_category
is defined if and only if std::is_reference_v <InnerBase
> is true, and Base
and InnerBase
each model forward_range
. In this case, it is defined as follows:
- If std::is_reference_v <std::common_reference_t <ranges::range_reference_t <
InnerBase
>,PatternBase
>> is false,iterator_category
denotes std::input_iterator_tag . - Otherwise, if all following conditions are satisfied,
iterator_category
denotes std::bidirectional_iterator_tag :-
OuterC
,InnerC
, andPatternC
each model std::derived_from <std::bidirectional_iterator_tag >. -
InnerBase
andPatternBase
each modelcommon_range
.
-
- Otherwise, if
OuterC
,InnerC
, andPatternC
each model std::derived_from <std::forward_iterator_tag >,iterator_category
denotes std::forward_iterator_tag . - Otherwise,
iterator_category
denotes std::input_iterator_tag .
[edit] Data members
OuterIter
outer_it_
(present only if
Base
models forward_range
)
the outer iterator(exposition-only member object*)
PatternIter
,
InnerIter
> inner_it_
the inner iterator(exposition-only member object*)
[edit] Member functions
[edit] Non-member functions
(function)