coveo::linq
Implementation of .NET-like LINQ operators in C++
|
Checks if a sequence has elements. More...
Functions | |
template<typename = void> | |
auto | coveo::linq::any () -> detail::any_impl_0<> |
Checks for any element. More... | |
template<typename Pred > | |
auto | coveo::linq::any (const Pred &pred) -> detail::any_impl_1< Pred > |
Checks for any element that satisfy a predicate. More... | |
The any
operator checks if a sequence has elements, or if it has elements that satisfy a given predicate.
This is a terminal operator.
.NET equivalent: Any
auto coveo::linq::any | ( | ) | -> detail::any_impl_0<> |
Checks if a sequence has elements.
Use like this:
true
if sequence has at least one element. auto coveo::linq::any | ( | const Pred & | pred | ) | -> detail::any_impl_1<Pred> |
Checks if a sequence has at least one element that satisfy a predicate. The predicate is called with each element and must return true
if the element satisfy the predicate. The final result indicates if there's at least one element that satisfy the predicate.
Works on empty sequences (returns false
in such a case).
Use like this:
pred | Predicate to satisfy. |
true
if at least one element in sequence satisfies pred
.