25 Ranges library [ranges]

25.6 Range factories [range.factories]

25.6.5 Repeat view [range.repeat]

25.6.5.3 Class repeat_view​::​iterator [range.repeat.iterator]

namespace std::ranges { template<move_constructible T, semiregular Bound> requires (is_object_v<T> && same_as<T, remove_cv_t<T>> && (integer-like-with-usable-difference-type<Bound> || same_as<Bound, unreachable_sentinel_t>)) class repeat_view<T, Bound>::iterator { private: using index-type = // exposition only conditional_t<same_as<Bound, unreachable_sentinel_t>, ptrdiff_t, Bound>; const T* value_ = nullptr; // exposition only index-type current_ = index-type(); // exposition only constexpr explicit iterator(const T* value, index-type b = index-type()); // exposition only public: using iterator_concept = random_access_iterator_tag; using iterator_category = random_access_iterator_tag; using value_type = T; using difference_type = see below; iterator() = default; constexpr const T& operator*() const noexcept; constexpr iterator& operator++(); constexpr iterator operator++(int); constexpr iterator& operator--(); constexpr iterator operator--(int); constexpr iterator& operator+=(difference_type n); constexpr iterator& operator-=(difference_type n); constexpr const T& operator[](difference_type n) const noexcept; friend constexpr bool operator==(const iterator& x, const iterator& y); friend constexpr auto operator<=>(const iterator& x, const iterator& y); friend constexpr iterator operator+(iterator i, difference_type n); friend constexpr iterator operator+(difference_type n, iterator i); friend constexpr iterator operator-(iterator i, difference_type n); friend constexpr difference_type operator-(const iterator& x, const iterator& y); }; }
If is-signed-integer-like<index-type> is true, the member typedef-name difference_type denotes index-type.
Otherwise, it denotes IOTA-DIFF-T(index-type) ([range.iota.view]).
constexpr explicit iterator(const T* value, index-type b = index-type());
Preconditions: If Bound is not unreachable_sentinel_t, b  ≥ 0.
Effects: Initializes value_ with value and current_ with b.
constexpr const T& operator*() const noexcept;
Effects: Equivalent to: return *value_;
constexpr iterator& operator++();
Effects: Equivalent to: ++current_; return *this;
constexpr iterator operator++(int);
Effects: Equivalent to: auto tmp = *this; ++*this; return tmp;
constexpr iterator& operator--();
Preconditions: If Bound is not unreachable_sentinel_t, .
Effects: Equivalent to: --current_; return *this;
constexpr iterator operator--(int);
Effects: Equivalent to: auto tmp = *this; --*this; return tmp;
constexpr iterator& operator+=(difference_type n);
Preconditions: If Bound is not unreachable_sentinel_t, .
Effects: Equivalent to: current_ += n; return *this;
constexpr iterator& operator-=(difference_type n);
Preconditions: If Bound is not unreachable_sentinel_t, .
Effects: Equivalent to: current_ -= n; return *this;
constexpr const T& operator[](difference_type n) const noexcept;
Effects: Equivalent to: return *(*this + n);
friend constexpr bool operator==(const iterator& x, const iterator& y);
Effects: Equivalent to: return x.current_ == y.current_;
friend constexpr auto operator<=>(const iterator& x, const iterator& y);
Effects: Equivalent to: return x.current_ <=> y.current_;
friend constexpr iterator operator+(iterator i, difference_type n); friend constexpr iterator operator+(difference_type n, iterator i);
Effects: Equivalent to: i += n; return i;
friend constexpr iterator operator-(iterator i, difference_type n);
Effects: Equivalent to: i -= n; return i;
friend constexpr difference_type operator-(const iterator& x, const iterator& y);
Effects: Equivalent to: return static_cast<difference_type>(x.current_) - static_cast<difference_type>(y.current_);