coveo::linq
Implementation of .NET-like LINQ operators in C++
|
Zips two sequences by combining corresponding elements. More...
Functions | |
template<typename Seq2 , typename ResultSelector > | |
auto | coveo::linq::zip (Seq2 &&seq2, ResultSelector &&result_sel) -> detail::zip_impl< Seq2, ResultSelector > |
Zips two sequences. More... | |
The zip
operator scans two source sequences and and passes elements with the same index to a result selector, then produces a sequence containing the results returned by that selector.
.NET equivalent: Zip
auto coveo::linq::zip | ( | Seq2 && | seq2, |
ResultSelector && | result_sel | ||
) | -> detail::zip_impl<Seq2, ResultSelector> |
Scans two source sequences and calls the provided result selector with elements of the two sequences that have the same index. Then, produces a sequence of the results returned by that selector. The resulting sequence will be as long as the shortest of the two input sequences.
Use like this:
seq2 | Second sequence to scan. The first sequence is the one to which the operator is applied, e.g. the one passed to coveo::linq::from() . |
result_sel | Selector used to "zip" two corresponding sequence elements. |