Skip to content
Vlad Riscutia edited this page Nov 7, 2016 · 1 revision

Header pipe/algorithm.h, in namespace pipe::algorithm.

template <typename Predicate>
auto some(Predicate pred);

some returns an object which can act as a rhs when applying operator| to a lhs generator. When applied, it returns true if the given Predicate returns true for at least one element yielded by the input generator.

Example:

bool out = count() | take_n(6) | some([](auto& i) { return i < 3; });
// out is true
Clone this wiki locally