tables::table::uj

template <typename... Ts,is_primitive_type... Ps>
template<is_table T>
requires ( is_joinable<table<std::pair<Ts,Ps>...>,T> )
inline
auto
table<std::pair<Ts,Ps>...>::uj(const T& t) const

Returns a table with concatenated rows of left and right table. Columns are filled with none if needed.

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 table0_t = table<
  pair<c0,string_view>,
  pair<c1,unsigned>
>;

using table1_t = table<
  pair<c0,string_view>,
  pair<c2,double>
>;

void table_uj()
{
  const table0_t t0(
      {"abc", "def", "ghi", "abc", "def", "ghi"},
      {100,200,300,400,500,600}
  );

  const table1_t t1(
      {"abc", "def", "foo"},
      {1,2,3}
  );

  const auto t = t0.uj( t1 );
  cout << "t:\n" << t << "\n";
}

Output

t:
Col0 Col1 Col2
--------------
 abc  100 none
 def  200 none
 ghi  300 none
 abc  400 none
 def  500 none
 ghi  600 none
 abc none    1
 def none    2
 foo none    3