std::ranges::elements_view<V,N>::iterator

From cppreference.com
 
 
Ranges library
Range access
Range conversions
(C++23)
Range primitives



Dangling iterator handling
Range concepts
Views

Range factories
Range adaptors
Range generators
Range adaptor objects
Range adaptor closure objects
Helper items
(until C++23)(C++23)


 
 
template< bool Const >
class /*iterator*/;
(exposition only*)

The return type of elements_view::begin, and of elements_view::end when the underlying view is a common_range.

The type /*iterator*/<true> is returned by the const-qualified overloads. The type /*iterator*/<false> is returned by the non-const-qualified overloads.

Member types

Member type Definition
Base (private) const V if Const is true, otherwise V.
(exposition-only member type*)
iterator_concept Denotes:
iterator_category Not defined, if Base does not model forward_range. Otherwise,
value_type std::remove_cvref_t<std::tuple_element_t<N, ranges::range_value_t<Base>>>
difference_type ranges::range_difference_t<Base>

Data members

Typical implementations of /*iterator*/ hold only one non-static data member:

  • current_ (exposition only*) - An iterator of type ranges::iterator_t<Base> to current element of underlying sequence.

Member functions

constructs an iterator
(public member function)
(C++20)
returns the underlying iterator
(public member function)
(C++20)
accesses the Nth tuple element
(public member function)
accesses an element by index
(public member function)
advances or decrements the underlying iterator
(public member function)

Non-member functions

compares the underlying iterators
(function)
performs iterator arithmetic
(function)

Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior
P2259R1 C++20 member iterator_category is always defined defined only if Base models forward_range
LWG 3555 C++20 the definition of iterator_concept ignores const made to consider

See also

(C++20)
the return type of ranges::transform_view::begin, and of ranges::transform_view::end when the underlying view is a common_range
(private member class template)