| Iterator concepts | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Iterator primitives | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Algorithm concepts and utilities | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Indirect callable concepts | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Common algorithm requirements | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Utilities | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Iterator adaptors | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
| Non-member functions | ||||
(C++20)(C++20) | ||||
operator==(default_sentinel_t) (C++20) | ||||
(C++20) | ||||
(C++20) | ||||
(C++20) | ||||
(C++20) | ||||
| Helper classes | ||||
friendconstexprbool operator==( const counted_iterator& x,std::default_sentinel_t); | (since C++20) | |
Checks if the underlyinglength (i.e. distance to the end) is equal to0.
This function template is not visible to ordinaryunqualified orqualified lookup, and can only be found byargument-dependent lookup when std::counted_iterator<I> is an associated class of the arguments.
The!= operator issynthesized fromoperator==.
Contents |
| x | - | an iterator adaptor |
true ifx.count() is equal to0,false otherwise.
#include <initializer_list>#include <iterator> int main(){staticconstexprauto v={1,2,3,4};constexprstd::counted_iterator<std::initializer_list<int>::iterator> it1{v.begin(),3}, it2{v.begin(),0}; static_assert(it1!=std::default_sentinel); static_assert(it2==std::default_sentinel); static_assert(std::default_sentinel!= it1); static_assert(std::default_sentinel== it2);}
(C++20) | compares the distances to the end (function template)[edit] |