| ||||||||||||||||||||||
| Range primitives | |||||||
| |||||||
| Range concepts | |||||||||||||||||||
| |||||||||||||||||||
| Range factories | |||||||||
| |||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper items | |||||||||||||||||
| |||||||||||||||||
| Member functions | ||||
slide_view::end | ||||
(C++26) | ||||
| Deduction guides | ||||
| Iterator | ||||
| Member functions | ||||
| Non-member functions | ||||
| Sentinel | ||||
| Member functions | ||||
| Non-member functions | ||||
constexprauto end() requires(!(/*simple-view*/<V>&&/*slide-caches-nothing*/<const V>)); | (1) | (since C++23) |
constexprauto end()const requires/*slide-caches-nothing*/<const V>; | (2) | (since C++23) |
Returns asentinel or aniterator representing the end of theslide_view.
base_ andn_ be the underlying data members. Equivalent to:slide-caches-nothing,return iterator<false>(ranges::begin(base_)+ranges::range_difference_t<V>(size()), n_);.slide-caches-last,return iterator<false>(ranges::prev(ranges::end(base_), n_-1,ranges::begin(base_)), n_);.common_range,return iterator<false>(ranges::end(base_),ranges::end(base_), n_);.slide-caches-last, this function caches the result within thecached_end_ for use on subsequent calls. This is necessary to provide the amortized constant-time complexity required by therange.Contents |
(none)
Asentinel or aniterator representing the end of theslide_view.
#include <iostream>#include <ranges> int main(){staticconstexprauto source={'A','B','C','D'}; for(constauto subrange: source| std::views::slide(3)){std::cout<<"[ ";for(auto it= subrange.begin(); it!= subrange.end();++it)std::cout<<*it<<' ';std::cout<<"]\n";}}
Output:
[ A B C ][ B C D ]
| 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] |