std::ranges::take_view<V>::end
From cppreference.com
constexpr auto end() requires (!__SimpleView<V>); |
(1) | (since C++20) |
constexpr auto begin() const requires ranges::range<const V>; |
(2) | (since C++20) |
Returns a sentinel or an iterator representing the end of the take_view
. The end of the take_view
is either one past the count
-th element in the underlying range, or the end of the underlying range if the latter has less than count
elements.
1) Returns a take_view::/*sentinel*/<false>, a std::default_sentinel_t, or a ranges::range_iterator_t<V>.
2) Returns a take_view::/*sentinel*/<true>, a std::default_sentinel_t, or a ranges::range_iterator_t<const V>.
Overload (1) does not participate in overload resolution if V
is a simple view (that is, if V
and const V
are views with the same iterator and sentinel types).
Parameters
(none)
Return value
The result depends on the concepts satisfied by V
(for overload (1)) or const V
(for overload (2)).
Let base_ be the underlying view.
The underlying view satisfies ... | random_access_range | ||
---|---|---|---|
yes | no | ||
sized_range | yes | ranges::begin(base_) + size() | std::default_sentinel |
no |
1) /*sentinel*/<false>{ranges::end(base_)}
2) /*sentinel*/<true>{ranges::end(base_)}
|
Example
This section is incomplete Reason: no example |
See also
returns an iterator to the beginning (public member function) | |
(C++20) |
iterator adaptor that tracks the distance to the end of the range (class template) |
compares a sentinel with an iterator returned from take_view::begin (function) |