std::ranges::repeat_view<W, Bound>::iterator
ranges::repeat_view <W, Bound>::iterator
is the type of the iterators returned by begin()
and end()
of ranges::repeat_view <W, Bound>.
Contents
- 1 Nested types
- 2 Data members
- 3 Member functions
- 4 std::ranges::repeat_view::iterator::iterator
- 5 std::ranges::repeat_view::iterator::operator*
- 6 std::ranges::repeat_view::iterator::operator[]
- 7 std::ranges::repeat_view::iterator::operator++
- 8 std::ranges::repeat_view::iterator::operator--
- 9 std::ranges::repeat_view::iterator::operator+=
- 10 std::ranges::repeat_view::iterator::operator-=
- 11 operator==, <=>(std::ranges::repeat_view::iterator)
- 12 operator+(std::ranges::repeat_view::iterator)
- 13 operator-(std::ranges::repeat_view::iterator)
[edit] Nested types
Exposition-only types
index-type
std::conditional_t <std::same_as <Bound, std::unreachable_sentinel_t >,
std::ptrdiff_t, Bound>(exposition-only member type*)
Iterator property types
iterator_concept
std::random_access_iterator_tag
iterator_category
std::random_access_iterator_tag
value_type
W
difference_type
std::conditional_t <is-signed-integer-like <index-type
>,
index-type
,
iota-diff-t <index-type
>>
[edit] Data members
value_
a pointer to the value to repeat(exposition-only member object*)
index-type
current_
the current position(exposition-only member object*)
[edit] Member functions
std::ranges::repeat_view::iterator::iterator
( const W* value, /*index-type*/ b = /*index-type*/() );
(exposition only*)
Constructs an iterator. Overload (2) is called by begin()
and end()
of ranges::repeat_view
.
std::ranges::repeat_view::iterator::operator*
Returns *value_
.
std::ranges::repeat_view::iterator::operator[]
Returns *(*this + n).
std::ranges::repeat_view::iterator::operator++
current_
; return *this;.std::ranges::repeat_view::iterator::operator--
current_
; return *this;.Bound
is not std::unreachable_sentinel_t and current_
is non-positive, the behavior is undefined.std::ranges::repeat_view::iterator::operator+=
Equivalent to current_
+= n; return *this;.
If Bound
is not std::unreachable_sentinel_t and current_
+ n is negative, the behavior is undefined.
std::ranges::repeat_view::iterator::operator-=
Equivalent to current_
-= n; return *this;.
If Bound
is not std::unreachable_sentinel_t and current_
- n is negative, the behavior is undefined.
[edit] Non-member functions
operator==, <=>(std::ranges::repeat_view::iterator)
( const /*iterator*/& x, const /*iterator*/& y );
( const /*iterator*/& x, const /*iterator*/& y );
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)
( /*iterator*/ i, difference_type n );
( difference_type n, /*iterator*/ i );
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)
( /*iterator*/ i, difference_type n );
( const /*iterator*/& x, const /*iterator*/& y );
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.
[edit] Notes
iterator
is always random_access_iterator
.