On this page
std::ranges::repeat_view<W, Bound>::iterator
|
(since C++23) (exposition only*) |
The return type of repeat_view::begin.
Member types
| Member type | Definition |
|---|---|
index-type |
|
iterator_concept |
std::random_access_iterator_tag |
iterator_category |
std::random_access_iterator_tag |
value_type |
W |
difference_type |
|
Data members
| Member name | Definition |
|---|---|
value_ (private) |
A pointer of type const W* that holds the pointer to the value to repeat.(exposition-only member object*) |
current_ (private) |
An object of type /*index-type*/ that holds the current position.(exposition-only member object*) |
Member functions
|
(constructor)
(C++23)
|
constructs an iterator (public member function) |
|
operator*
(C++23)
|
returns the current subrange (public member function) |
|
operator[]
(C++23)
|
accesses an element by index (public member function) |
|
operator++operator++(int)operator--operator--(int)operator+=operator-=
(C++23)
|
advances or decrements the underlying iterator (public member function) |
std::ranges::repeat_view::iterator::iterator
|
(1) | (since C++23) |
|
(2) | (since C++23) (exposition only*) |
value_withnullptr_tvia its default member initializer;index_via its default member initializer (= /*index-type*/()).
value_ with value and bound_ with b. If Bound is not std::unreachable_sentinel_t then b must be non-negative. This constructor is not a part of the public interface.
std::ranges::repeat_view::iterator::operator*
|
(since C++23) |
Equivalent to return *value_;.
std::ranges::repeat_view::iterator::operator[]
|
(since C++23) |
Equivalent to return *(*this + n);.
std::ranges::repeat_view::iterator::operator++
|
(1) | (since C++23) |
|
(2) | (since C++23) |
++current_; return *this;.
auto tmp = *this; ++*this; return tmp;.
std::ranges::repeat_view::iterator::operator--
|
(1) | (since C++23) |
|
(2) | (since C++23) |
--current_; return *this;. If Bound is not std::unreachable_sentinel_t then bound_ must be positive.
auto tmp = *this; --*this; return tmp;.
std::ranges::repeat_view::iterator::operator+=
|
(since C++23) |
Equivalent to current_ += n; return *this;. If Bound is not std::unreachable_sentinel_t then (bound_ + n) must be non-negative.
std::ranges::repeat_view::iterator::operator-=
|
(since C++23) |
Equivalent to current_ -= n; return *this;. If Bound is not std::unreachable_sentinel_t, then (bound_ - n) must be non-negative.
Non-member functions
|
operator==operator<=>
(C++23)
|
compares the underlying iterators (function) |
|
operator+operator-
(C++23)
|
performs iterator arithmetic (function) |
operator==, <=>(std::ranges::repeat_view::iterator)
|
(1) | (since C++23) |
|
(2) | (since C++23) |
x.current_ == y.current_.
x.current_ <=> y.current_.
The != operator is synthesized from operator==.
These functions are not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when iterator is an associated class of the arguments.
operator+(std::ranges::repeat_view::iterator)
|
(1) | (since C++23) |
|
(2) | (since C++23) |
Equivalent to i += n; return i;.
These functions are not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when iterator is an associated class of the arguments.
operator-(std::ranges::repeat_view::iterator)
|
(1) | (since C++23) |
|
(2) | (since C++23) |
i -= n; return i;.
return static_cast<difference_type>(x.current_) - static_cast<difference_type>(y.current_);.
These functions are not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when iterator is an associated class of the arguments.
Notes
iterator is always random_access_iterator.
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/ranges/repeat_view/iterator