namespace std::ranges {
template<input_range V, size_t N>
requires view<V> && has-tuple-element<range_value_t<V>, N> &&
has-tuple-element<remove_reference_t<range_reference_t<V>>, N>
template<bool Const>
class elements_view<V, N>::sentinel {
private:
using Base = conditional_t<Const, const V, V>;
sentinel_t<Base> end_ = sentinel_t<Base>();
public:
sentinel() = default;
constexpr explicit sentinel(sentinel_t<Base> end);
constexpr sentinel(sentinel<!Const> other)
requires Const && convertible_to<sentinel_t<V>, sentinel_t<Base>>;
constexpr sentinel_t<Base> base() const;
friend constexpr bool operator==(const iterator<Const>& x, const sentinel& y);
friend constexpr range_difference_t<Base>
operator-(const iterator<Const>& x, const sentinel& y)
requires sized_sentinel_for<sentinel_t<Base>, iterator_t<Base>>;
friend constexpr range_difference_t<Base>
operator-(const sentinel& x, const iterator<Const>& y)
requires sized_sentinel_for<sentinel_t<Base>, iterator_t<Base>>;
};
}
constexpr explicit sentinel(sentinel_t<Base> end);
Effects:
Initializes
end_ with
end. constexpr sentinel(sentinel<!Const> other)
requires Const && convertible_to<sentinel_t<V>, sentinel_t<Base>>;
Effects:
Initializes
end_ with
std::move(other.end_). constexpr sentinel_t<Base> base() const;
Effects:
Equivalent to: return end_;
friend constexpr bool operator==(const iterator<Const>& x, const sentinel& y);
Effects:
Equivalent to: return x.current_ == y.end_;
friend constexpr range_difference_t<Base>
operator-(const iterator<Const>& x, const sentinel& y)
requires sized_sentinel_for<sentinel_t<Base>, iterator_t<Base>>;
Effects:
Equivalent to: return x.current_ - y.end_;
friend constexpr range_difference_t<Base>
operator-(const sentinel& x, const iterator<Const>& y)
requires sized_sentinel_for<sentinel_t<Base>, iterator_t<Base>>;
Effects:
Equivalent to: return x.end_ - y.current_;