| ||||||||||||||||||||||
| Range primitives | |||||||
| |||||||
| Range concepts | |||||||||||||||||||
| |||||||||||||||||||
| Range factories | |||||||||
| |||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper items | |||||||||||||||||
| |||||||||||||||||
| Member functions | ||||
stride_view::begin | ||||
(C++26) | ||||
| Deduction guides | ||||
| Iterator | ||||
| Member functions | ||||
| Non-member functions | ||||
constexprauto begin() requires(!__simple_view<V>); | (1) | (since C++23) |
constexprauto begin()const requiresranges::range<const V>; | (2) | (since C++23) |
Returns aniterator to the first element of thestride_view.
Overload(1) does not participate in overload resolution ifV is asimple view (that is, ifV andconst V are views with the same iterator and sentinel types).
Contents |
(none)
Iterator to the first element of the view.
A link to test:Compiler Explorer.
#include <print>#include <ranges> int main(){constexprauto v={'A','B','C'};constauto x= v| std::views::stride(2);constauto y= v| std::views::reverse| std::views::stride(2);constauto z= v| std::views::stride(2)| std::views::reverse;std::println("{} {} {}",*x.begin(),*y.begin(),*z.begin());}
Output:
A C C
| returns an iterator or a sentinel to the end (public member function)[edit] |