tables::table::remove

1)

template <typename... Ts,is_primitive_type... Ps>
template <tuple_ext::is_tuple Rs>
requires all_in<Rs,std::tuple<Ts...>>
inline
constexpr auto
table<std::pair<Ts,Ps>...>::remove() const
{

2)

template <typename... Ts,is_primitive_type... Ps>
template <typename... Rs>
requires ( ( in<Rs,std::tuple<Ts...>> && ... ) && is_tuple_unique<std::tuple<Rs...>> )
inline
constexpr auto
table<std::pair<Ts,Ps>...>::remove() const

Returns a table with all columns except selected columns.

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"; };
struct c2{ constexpr static string_view name =  "Col2"; };

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


void table_remove()
{
  const table_t t(
      {"abc", "def", "ghi"},
      {100,200,300},
      {1.0,2.0,3.0}
    );

  const auto t1 = t.remove<c0>();
  cout << t1 << "\n";
}

Output

Col1 Col2
---------
 100    1
 200    2
 300    3