coveo::linq
Implementation of .NET-like LINQ operators in C++
|
How to chain LINQ operators into an expression. More...
Functions | |
template<typename Seq , typename Op > | |
auto | coveo::linq::operator| (Seq &&seq, Op &&op) -> decltype(std::forward< Op >(op)(std::forward< Seq >(seq))) |
Applies LINQ operators and allows chaining. More... | |
In order to create powerful LINQ expressions, operators need to be chained together so as to be applied in a specific order. To do this, coveo::linq::operator|()
has been overloaded. Every LINQ operator returns a function object that is applied on the current sequence by coveo::linq::operator|()
. By aligning the instances of | in the code, LINQ expressions are easy to read:
auto coveo::linq::operator| | ( | Seq && | seq, |
Op && | op | ||
) | -> decltype(std::forward<Op>(op)(std::forward<Seq>(seq))) |
Applies a given LINQ operator to the current sequence. Can be used multiple times to chain many operators in a specific order.
Use like this: