tables::column::reverse

template <is_primitive_type P>
column<P> reverse() const

Return column with elements in reverse order.

Complexity

Linear

Example

Code

#include <cpptables/table.hh>

using namespace tables;
using namespace std;

void column_reverse()
{
  const column<unsigned> xs ({ 1, 2, 3, 4, 5});
  const column<unsigned> ys = xs.reverse();
  cout << ys << "\n";
}

Output

5 4 3 2 1