tables::table::except

template <typename... Ts,is_primitive_type... Ps>
inline
table<std::pair<Ts,Ps>...>
table<std::pair<Ts,Ps>...>::except(const table_t& xt) const

Returns table with all rows that are not in t.

Example

Code

#include <cpptables/table.hh>
#include <iostream>

using namespace tables;
using namespace std;

struct c0{ constexpr static string_view name =  "Col0"; };
struct c1{ constexpr static string_view name =  "Col1"; };

using table_t = table<
  pair<c0,string_view>,
  pair<c1,double>
>;

void table_except()
{
  const table_t t(
      {"abc","def","ghi", "abc","def","ghi"},
      {10.0, 20.0, 30.0, 10.0, 20.0, 30.0}
    );
  
  cout << t.except( table_t({"abc"},{10.0} )) << "\n";
}

Output

Col0 Col1
---------
 def   20
 ghi   30
 def   20
 ghi   30