coveo::linq
Implementation of .NET-like LINQ operators in C++
Functions

Reverses elements in a sequence. More...

Functions

template<typename = void>
auto coveo::linq::reverse () -> detail::reverse_impl<>
 Reverses elements in sequence. More...
 

Detailed Description

The reverse operator, as its name implies, scans a sequence a produces a new sequence in which the elements are reversed.

.NET equivalent: Reverse

Function Documentation

◆ reverse()

template<typename = void>
auto coveo::linq::reverse ( ) -> detail::reverse_impl<>

Produces a new sequence in which elements in the source sequence are in reverse order.

Use like this:

const std::vector<int> NUMS = { 42, 23, 66, 11, 7 };
using namespace coveo::linq;
auto seq = from(NUMS)
| reverse();
// seq == { 7, 11, 66, 23, 42 }
Returns
(Once applied) Sequence of elements in reverse order.