coveo::linq
Implementation of .NET-like LINQ operators in C++
|
Performs a set intersection of two sequences. More...
Functions | |
template<typename Seq2 > | |
auto | coveo::linq::intersect (Seq2 &&seq2) -> detail::intersect_impl< Seq2, detail::less<>> |
Performs set intersection of two sequences. More... | |
template<typename Seq2 , typename Pred > | |
auto | coveo::linq::intersect (Seq2 &&seq2, Pred &&pred) -> detail::intersect_impl< Seq2, Pred > |
Performs set intersection of two sequences using predicate. More... | |
The intersect
operator returns all elements in the first sequence that are also found in the second sequence (essentially a set intersection). The elements are returned in the order that they appear in the first sequence.
.NET equivalent: Intersect
auto coveo::linq::intersect | ( | Seq2 && | seq2 | ) | -> detail::intersect_impl<Seq2, detail::less<>> |
Returns a sequence containing all elements from the first source sequence that are also in the second source sequence (essentially a set intersection). Elements are returned in the order that they appear in the first sequence.
Elements are found using operator<()
to compare them.
Use like this:
seq2 | Second source sequence. |
seq2
. auto coveo::linq::intersect | ( | Seq2 && | seq2, |
Pred && | pred | ||
) | -> detail::intersect_impl<Seq2, Pred> |
Returns a sequence containing all elements from the first source sequence that are also in the second source sequence (essentially a set intersection). Elements are returned in the order that they appear in the first sequence.
Elements are found using the provided predicate to compare them. The predicate must provide a strict ordering of the elements, like std::less
.
Use like this:
seq2 | Second source sequence. |
pred | Predicate used to compare the elements. |
seq2
.