| ||||||||||||||||||||||
| Range primitives | |||||||
| |||||||
| Range concepts | |||||||||||||||||||
| |||||||||||||||||||
| Range factories | |||||||||
| |||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper items | |||||||||||||||||
| |||||||||||||||||
| Member functions | ||||
chunk_by_view::pred | ||||
| Deduction guides | ||||
| Iterator | ||||
constexprconst Pred& pred()const; | (since C++23) | |
Returns a reference to the containedPred object. Equivalent toreturn*pred_;.
The behavior is undefined ifpred_ does not contain a value.
(none)
A reference to the containedPred object.
#include <cassert>#include <concepts>#include <functional>#include <initializer_list>#include <ranges> int main(){constauto v={1,1,2,2,1,1,1};auto chunks= v| std::views::chunk_by(std::equal_to{});auto pred= chunks.pred(); static_assert(std::same_as<decltype(pred),std::equal_to<>>);assert(pred(v.begin()[0],1));}