coveo::linq
Implementation of .NET-like LINQ operators in C++
|
Functions to start a LINQ expression. More...
Functions | |
template<typename Seq > | |
auto | coveo::linq::from (Seq &&seq) -> decltype(std::forward< Seq >(seq)) |
Standard LINQ expression entry point. More... | |
template<typename It > | |
auto | coveo::linq::from_range (It ibeg, It iend) -> decltype(enumerate_range(std::move(ibeg), std::move(iend))) |
LINQ expression entry point from iterators. More... | |
template<typename IntT > | |
auto | coveo::linq::from_int_range (IntT first, std::size_t count) -> coveo::enumerable< const typename std::decay< IntT >::type > |
LINQ expression entry point from range of numbers. More... | |
template<typename T > | |
auto | coveo::linq::from_repeated (const T &value, std::size_t count) -> coveo::enumerable< const typename std::decay< T >::type > |
LINQ expression entry point from a repeated value. More... | |
An "entry point" is a function that provides the initial sequence on which to apply LINQ operators. It also provides a nice look to the expression, a bit like a database query.
The usual entry point for a LINQ expression is coveo::linq::from()
, which simply returns the sequence passed in. Other entry points generate a sequence for use in the expression.
auto coveo::linq::from | ( | Seq && | seq | ) | -> decltype(std::forward<Seq>(seq)) |
Standard entry point for a LINQ expression. Specifies the initial sequence on which the first operator will be applied. After this, use coveo::linq::operator|()
to chain LINQ operators and apply them in a specific order (see chaining).
Use like this:
auto coveo::linq::from_range | ( | It | ibeg, |
It | iend | ||
) | -> decltype(enumerate_range(std::move(ibeg), std::move(iend))) |
Entry point for a LINQ expression that produces a sequence of elements delimited by two iterators. After this, use coveo::linq::operator|()
to chain LINQ operators and apply them in a specific order (see chaining).
Use like this:
auto coveo::linq::from_int_range | ( | IntT | first, |
std::size_t | count | ||
) | -> coveo::enumerable<const typename std::decay<IntT>::type> |
Entry point for a LINQ expression that produces a sequence of incrementing numbers from a starting point. After this, use coveo::linq::operator|()
to chain LINQ operators and apply them in a specific order (see chaining).
Use like this:
auto coveo::linq::from_repeated | ( | const T & | value, |
std::size_t | count | ||
) | -> coveo::enumerable<const typename std::decay<T>::type> |
Entry point for a LINQ expression that produces a sequence created by repeating a given value multiple times.. After this, use coveo::linq::operator|()
to chain LINQ operators and apply them in a specific order (see chaining).
Use like this: