| ||||||||||||||||||||||
| Range primitives | |||||||
| |||||||
| Range concepts | |||||||||||||||||||
| |||||||||||||||||||
| Range factories | |||||||||
| |||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper items | |||||||||||||||||
| |||||||||||||||||
| Member functions | ||||
slide_view::begin | ||||
(C++26) | ||||
| Deduction guides | ||||
| Iterator | ||||
| Member functions | ||||
| Non-member functions | ||||
| Sentinel | ||||
| Member functions | ||||
| Non-member functions | ||||
constexprauto begin() requires(!(/*simple-view*/<V>&&/*slide-caches-nothing*/<const V>)); | (1) | (since C++23) |
constexprauto begin()const requires/*slide-caches-nothing*/<const V>; | (2) | (since C++23) |
Returns an iterator to the first element of theslide_view.
return iterator<false>(ranges::begin(base_), ranges::next(ranges::begin(base_), n_ -1,ranges::end(base_)), n_);
iterator<false>(ranges::begin(base_), n_);.slide-caches-first this function caches the result within thecached_begin_ for use on subsequent calls. This is necessary to provide the amortized constant-time complexity required by therange. iterator<true>(ranges::begin(base_), n_);.Contents |
(none)
Aniterator to the first element ofslide_view, which points to then_-sized subrange of the underlying view type:V for overload(1) orconst V for overload(2).
#include <iostream>#include <ranges>#include <string_view>usingnamespace std::literals; int main(){staticconstexprauto source={"∀x"sv,"∃y"sv,"ε"sv,"δ"sv};auto view{std::ranges::slide_view(source,2)};constauto subrange{*(view.begin())};for(std::string_viewconst s: subrange)std::cout<< s<<' ';std::cout<<'\n';}
Output:
∀x ∃y
| returns an iterator or a sentinel to the end (public member function)[edit] | |
(C++23) | compares a sentinel with an iterator returned fromslide_view::begin (function)[edit] |