coveo::linq
Implementation of .NET-like LINQ operators in C++
|
Filters a sequence. More...
Functions | |
template<typename Pred > | |
auto | coveo::linq::where (Pred &&pred) -> detail::where_impl< detail::indexless_selector_proxy< Pred >> |
Filters sequence elements using predicate. More... | |
template<typename Pred > | |
auto | coveo::linq::where_with_index (Pred &&pred) -> detail::where_impl< Pred > |
Filters sequence elements using predicate and element index. More... | |
The where
operator (and its siblings) filter the elements in a sequence, returning a new sequence containing only the elements that satisfy a predicate.
.NET equivalent: Where
auto coveo::linq::where | ( | Pred && | pred | ) | -> detail::where_impl<detail::indexless_selector_proxy<Pred>> |
Returns a sequence that contains only the elements from the source sequence that satisfy the given predicate. Order of the elements is preserved.
Use like this:
pred | Predicate to satisfy. |
pred
returned true
. auto coveo::linq::where_with_index | ( | Pred && | pred | ) | -> detail::where_impl<Pred> |
Returns a sequence that contains only the elements from the source sequence that satisfy the given predicate. Order of the elements is preserved.
The predicate receives two arguments: a sequence element and its position in the sequence.
Use like this:
pred | Predicate to satisfy. |
pred
returned true
.