tables::column::rtake

template <is_primitive_type P>
column<P> rtake(const std::size_t n) const

Returns last n elements of column or full column if n is more than size of column. Same as reverse().take(N).reverse().

Complexity

Linear

Example

Code

#include <cpptables/table.hh>

using namespace tables;
using namespace std;

void column_rtake()
{
  constexpr unsigned none = prim_traits<unsigned>::none;

  const column<unsigned> xs ({ 1, 2, 3, 4, 5, none});

  cout << xs.rtake(2) << "\n";
}

Output

5 none