Files
2025-10-25 03:02:53 +03:00

3.1 KiB
Raw Permalink Blame History

[range.iota.sentinel]

25 Ranges library [ranges]

25.6 Range factories [range.factories]

25.6.4 Iota view [range.iota]

25.6.4.4 Class iota_view::sentinel [range.iota.sentinel]

🔗

namespace std::ranges {template<weakly_incrementable W, semiregular Bound>requires weakly-equality-comparable-with<W, Bound> && copyablestruct iota_view<W, Bound>::sentinel {private: Bound bound_ = Bound(); // exposition onlypublic:sentinel() = default; constexpr explicit sentinel(Bound bound); friend constexpr bool operator==(const iterator& x, const sentinel& y); friend constexpr iter_difference_t operator-(const iterator& x, const sentinel& y)requires sized_sentinel_for<Bound, W>; friend constexpr iter_difference_t operator-(const sentinel& x, const iterator& y)requires sized_sentinel_for<Bound, W>; };}

🔗

constexpr explicit sentinel(Bound bound);

1

#

Effects: Initializes bound_ with bound.

🔗

friend constexpr bool operator==(const iterator& x, const sentinel& y);

2

#

Effects: Equivalent to: return x.value_ == y.bound_;

🔗

friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8Concept sized_­sentinel_­for[iterator.concept.sizedsentinel]")<Bound, W>;

3

#

Effects: Equivalent to: return x.value_ - y.bound_;

🔗

friend constexpr iter_difference_t<W> operator-(const sentinel& x, const iterator& y) requires [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8Concept sized_­sentinel_­for[iterator.concept.sizedsentinel]")<Bound, W>;

4

#

Effects: Equivalent to: return -(y - x);