| ||||||||||||||||||||||
| Range primitives | |||||||
| |||||||
| Range concepts | |||||||||||||||||||
| |||||||||||||||||||
| Range factories | |||||||||
| |||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper items | |||||||||||||||||
| |||||||||||||||||
constexprconst Pred& pred()const; | (since C++20) | |
Returns a reference to the stored predicatepred_.
If*this does not store a predicate (e.g. an exception is thrown on the assignment to*this, which copy-constructs or move-constructs aPred), the behavior is undefined.
Contents |
(none)
A reference to the stored predicate.
#include <ranges> int main(){staticconstexprint a[]{1,2,3,4,5};constexprauto v= a| std::views::take_while([](int x){return x<4;});constauto pred= v.pred(); static_assert(pred(3));}
| returns a copy of the underlying (adapted) view (public member function)[edit] |