tables::column::distinct

template <is_primitive_type P>
column<P> column<P>::distinct() const

Return column containing the unique elements in order of first occurrence.

Complexity

Same as std::set.

Example

Code

#include <cpptables/table.hh>

using namespace tables;
using namespace std;

void column_distinct()
{
  const column<string_view> xs ({ "foo", "bar", "bar" });
  const auto ys = xs.distinct();
  
  cout << ys << "\n";
}

Output

foo bar