| ||||||||||||||||||||||
| Range primitives | |||||||
| |||||||
| Range concepts | |||||||||||||||||||
| |||||||||||||||||||
| Range factories | |||||||||
| |||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper items | |||||||||||||||||
| |||||||||||||||||
constexprauto end() requiresranges::forward_range<V>&&ranges::common_range<V>; | (1) | (since C++20) |
constexprauto end()const; | (2) | (since C++20) |
Returns an iterator or sometimes a sentinel representing the end of theview. Letbase_ be the underlying view.
outer_iterator or astd::default_sentinel.Equivalent to:
ifconstexpr(ranges::forward_range<V>&&ranges::forward_range<const V>&&ranges::common_range<const V>)return/*outer_iterator*/<true>{*this,ranges::end(base_)};elsereturnstd::default_sentinel;
Anouter_iterator or astd::default_sentinel representing the end of theview.
#include <iostream>#include <ranges>#include <string_view> int main(){constexprstd::string_view keywords{"false float for friend"}; std::ranges::lazy_split_view kw{keywords,' '};constauto count= std::ranges::distance(kw.begin(), kw.end());std::cout<<"Words count: "<< count<<'\n';}
Output:
Words count: 4
| returns an iterator to the beginning (public member function)[edit] | |
| returns an iterator or a sentinel to the end (public member function of std::ranges::split_view<V,Pattern>)[edit] | |
(C++20) | returns an iterator to the beginning of a range (customization point object)[edit] |
(C++20) | returns a sentinel indicating the end of a range (customization point object)[edit] |