| ||||||||||||||||||||||
| Range primitives | |||||||
| |||||||
| Range concepts | |||||||||||||||||||
| |||||||||||||||||||
| Range factories | |||||||||
| |||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper items | |||||||||||||||||
| |||||||||||||||||
constexprauto end() requires(!/*simple-view*/<V>); | (1) | (since C++20) |
constexprauto end()const requiresranges::range<const V>; | (2) | (since C++20) |
Returns a sentinel or an iterator representing the end of thedrop_view.
#include <algorithm>#include <iostream>#include <iterator>#include <ranges> int main(){namespace ranges= std::ranges;constexprchar url[]{"https://cppreference.com"}; constauto p=std::distance(ranges::begin(url),ranges::find(url,'/'));auto site=ranges::drop_view{url, p+2};// drop the prefix "https://" for(auto it= site.begin(); it!= site.end();++it)std::cout<<*it;std::cout<<'\n';}
Output:
cppreference.com
| returns an iterator to the beginning (public member function)[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] |