3.0 KiB
[range.take.sentinel]
25 Ranges library [ranges]
25.7 Range adaptors [range.adaptors]
25.7.10 Take view [range.take]
25.7.10.3 Class template take_view::sentinel [range.take.sentinel]
namespace std::ranges {template<view V>templateclass take_view::sentinel {private:using Base = maybe-const<Const, V>; // exposition onlytemplateusing CI = counted_iterator<iterator_t<maybe-const<OtherConst, V>>>; // exposition only sentinel_t<Base> end_ = sentinel_t<Base>(); // exposition onlypublic:sentinel() = default; constexpr explicit sentinel(sentinel_t<Base> end); constexpr sentinel(sentinel s)requires Const && convertible_to<sentinel_t, sentinel_t<Base>>; constexpr sentinel_t<Base> base() const; friend constexpr bool operator==(const CI& y, const sentinel& x); templaterequires sentinel_for<sentinel_t<Base>, iterator_t<maybe-const<OtherConst, V>>>friend constexpr bool operator==(const CI& y, const sentinel& x); };}
constexpr explicit sentinel(sentinel_t<Base> end);
Effects: Initializes end_ with end.
constexpr sentinel(sentinel<!Const> s) requires Const && [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_to [concept.convertible]")<sentinel_t<V>, sentinel_t<Base>>;
Effects: Initializes end_ with std::move(s.end_).
constexpr sentinel_t<Base> base() const;
Effects: Equivalent to: return end_;
`friend constexpr bool operator==(const CI& y, const sentinel& x);
template requires sentinel_for<sentinel_t, iterator_t<maybe-const<OtherConst, V>>> friend constexpr bool operator==(const CI& y, const sentinel& x); `
Effects: Equivalent to:return y.count() == 0 || y.base() == x.end_;