coveo::linq
Implementation of .NET-like LINQ operators in C++
|
Projects elements in a sequence into another form. More...
Functions | |
template<typename Selector > | |
auto | coveo::linq::select (Selector &&sel) -> detail::select_impl< detail::indexless_selector_proxy< Selector >> |
Projects elements in sequence into another form. More... | |
template<typename Selector > | |
auto | coveo::linq::select_with_index (Selector &&sel) -> detail::select_impl< Selector > |
Projects elements in sequence into another form using element index. More... | |
template<typename Selector > | |
auto | coveo::linq::select_many (Selector &&sel) -> detail::select_many_impl< detail::indexless_selector_proxy< Selector >> |
Projects elements in sequence into many values and flattens them. More... | |
template<typename Selector > | |
auto | coveo::linq::select_many_with_index (Selector &&sel) -> detail::select_many_impl< Selector > |
Projects elements in sequence into many values using element index and flattens them. More... | |
The select
operator scans a sequence and projects each of its element into another form using a selector, returning a sequence of the results. A little similar to std::transform()
.
.NET equivalent: Select / SelectMany
auto coveo::linq::select | ( | Selector && | sel | ) | -> detail::select_impl<detail::indexless_selector_proxy<Selector>> |
Produces a new sequence by projecting each element in the source sequence into another form, a little like std::transform()
.
Use like this:
sel | Selector used to project each element in source sequence into another form. |
auto coveo::linq::select_with_index | ( | Selector && | sel | ) | -> detail::select_impl<Selector> |
Produces a new sequence by projecting each element in the source sequence into another form, a little like std::transform()
. The selector receives, as second argument, the index of the element in the source sequence.
Use like this:
sel | Selector used to project each element in source sequence into another form. Receives index of element as second argument. |
auto coveo::linq::select_many | ( | Selector && | sel | ) | -> detail::select_many_impl<detail::indexless_selector_proxy<Selector>> |
Produces a new sequence by projecting each element in the source sequence into a sequence of new values, then flattens all those sequences.
Use like this:
sel | Selector used to project each element in source sequence into a sequence of values. |
auto coveo::linq::select_many_with_index | ( | Selector && | sel | ) | -> detail::select_many_impl<Selector> |
Produces a new sequence by projecting each element in the source sequence into a sequence of new values, then flattens all those sequences. The selector receives, as second argument, the index of the element in the source sequence.
Use like this:
sel | Selector used to project each element in source sequence into a sequence of values. Receives index of element as second argument. |