25 Iterators library [iterators]

25.5 Iterator adaptors [predef.iterators]

25.5.3 Constant iterators and sentinels [const.iterators]

25.5.3.5 Operations [const.iterators.ops]

constexpr basic_const_iterator(Iterator current);
Effects: Initializes current_ with std​::​move(current).
template<convertible_to<Iterator> U> constexpr basic_const_iterator(basic_const_iterator<U> current);
Effects: Initializes current_ with std​::​move(current.current_).
template<different-from<basic_const_iterator> T> requires convertible_to<T, Iterator> constexpr basic_const_iterator(T&& current);
Effects: Initializes current_ with std​::​forward<T>(current).
constexpr const Iterator& base() const & noexcept;
Effects: Equivalent to: return current_;
constexpr Iterator base() &&;
Effects: Equivalent to: return std​::​move(current_);
constexpr reference operator*() const;
Effects: Equivalent to: return static_cast<reference>(*current_);
constexpr const auto* operator->() const requires is_lvalue_reference_v<iter_reference_t<Iterator>> && same_as<remove_cvref_t<iter_reference_t<Iterator>>, value_type>;
Returns: If Iterator models contiguous_iterator, to_address(current_); otherwise, addressof(*current_).
constexpr basic_const_iterator& operator++();
Effects: Equivalent to: ++current_; return *this;
constexpr void operator++(int);
Effects: Equivalent to: ++current_;
constexpr basic_const_iterator operator++(int) requires forward_iterator<Iterator>;
Effects: Equivalent to: auto tmp = *this; ++*this; return tmp;
constexpr basic_const_iterator& operator--() requires bidirectional_iterator<Iterator>;
Effects: Equivalent to: --current_; return *this;
constexpr basic_const_iterator operator--(int) requires bidirectional_iterator<Iterator>;
Effects: Equivalent to: auto tmp = *this; --*this; return tmp;
constexpr basic_const_iterator& operator+=(difference_type n) requires random_access_iterator<Iterator>; constexpr basic_const_iterator& operator-=(difference_type n) requires random_access_iterator<Iterator>;
Let op be the operator.
Effects: Equivalent to: current_ op n; return *this;
constexpr reference operator[](difference_type n) const requires random_access_iterator<Iterator>
Effects: Equivalent to: return static_cast<reference>(current_[n]);
template<sentinel_for<Iterator> S> constexpr bool operator==(const S& s) const;
Effects: Equivalent to: return current_ == s;
template<not-a-const-iterator CI> requires constant-iterator<CI> && convertible_to<Iterator const&, CI> constexpr operator CI() const &;
Returns: current_.
template<not-a-const-iterator CI> requires constant-iterator<CI> && convertible_to<Iterator, CI> constexpr operator CI() &&;
Returns: std​::​move(current_).
constexpr bool operator<(const basic_const_iterator& y) const requires random_access_iterator<Iterator>; constexpr bool operator>(const basic_const_iterator& y) const requires random_access_iterator<Iterator>; constexpr bool operator<=(const basic_const_iterator& y) const requires random_access_iterator<Iterator>; constexpr bool operator>=(const basic_const_iterator& y) const requires random_access_iterator<Iterator>; constexpr auto operator<=>(const basic_const_iterator& y) const requires random_access_iterator<Iterator> && three_way_comparable<Iterator>;
Let op be the operator.
Effects: Equivalent to: return current_ op y.current_;
template<different-from<basic_const_iterator> I> constexpr bool operator<(const I& y) const requires random_access_iterator<Iterator> && totally_ordered_with<Iterator, I>; template<different-from<basic_const_iterator> I> constexpr bool operator>(const I& y) const requires random_access_iterator<Iterator> && totally_ordered_with<Iterator, I>; template<different-from<basic_const_iterator> I> constexpr bool operator<=(const I& y) const requires random_access_iterator<Iterator> && totally_ordered_with<Iterator, I>; template<different-from<basic_const_iterator> I> constexpr bool operator>=(const I& y) const requires random_access_iterator<Iterator> && totally_ordered_with<Iterator, I>; template<different-from<basic_const_iterator> I> constexpr auto operator<=>(const I& y) const requires random_access_iterator<Iterator> && totally_ordered_with<Iterator, I> && three_way_comparable_with<Iterator, I>;
Let op be the operator.
Effects: Equivalent to: return current_ op y;
template<not-a-const-iterator I> friend constexpr bool operator<(const I& x, const basic_const_iterator& y) requires random_access_iterator<Iterator> && totally_ordered_with<Iterator, I>; template<not-a-const-iterator I> friend constexpr bool operator>(const I& x, const basic_const_iterator& y) requires random_access_iterator<Iterator> && totally_ordered_with<Iterator, I>; template<not-a-const-iterator I> friend constexpr bool operator<=(const I& x, const basic_const_iterator& y) requires random_access_iterator<Iterator> && totally_ordered_with<Iterator, I>; template<not-a-const-iterator I> friend constexpr bool operator>=(const I& x, const basic_const_iterator& y) requires random_access_iterator<Iterator> && totally_ordered_with<Iterator, I>;
Let op be the operator.
Effects: Equivalent to: return x op y.current_;
friend constexpr basic_const_iterator operator+(const basic_const_iterator& i, difference_type n) requires random_access_iterator<Iterator>; friend constexpr basic_const_iterator operator+(difference_type n, const basic_const_iterator& i) requires random_access_iterator<Iterator>;
Effects: Equivalent to: return basic_const_iterator(i.current_ + n);
friend constexpr basic_const_iterator operator-(const basic_const_iterator& i, difference_type n) requires random_access_iterator<Iterator>;
Effects: Equivalent to: return basic_const_iterator(i.current_ - n);
template<sized_sentinel_for<Iterator> S> constexpr difference_type operator-(const S& y) const;
Effects: Equivalent to: return current_ - y;
template<not-a-const-iterator S> requires sized_sentinel_for<S, Iterator> friend constexpr difference_type operator-(const S& x, const basic_const_iterator& y);
Effects: Equivalent to: return x - y.current_;