tables::column::concat

1)

column<std::string_view>
column<std::string_view>::concat(const std::string_view sv) const;

2)

column<std::string_view>
column<std::string_view>::concat(const column<std::string_view>& svs) const;

  1. Returns column with strings concatenated with sv

  2. Returns column with strings concatenated with strings in svs.

Complexity

Linear

Example

Code

#include <cpptables/table.hh>

using namespace tables;
using namespace std;

void column_concat()
{
  using sv_column = column<std::string_view>;

  const sv_column xs({ 
    "abc",
    "def",
    "ghi"
  });


  cout << xs.concat("_foo") << "\n";
  cout << xs.concat( 
    sv_column({"_foo", "_bar", "_foo"})
  ) << "\n";
}

Output

abc_foo def_foo ghi_foo
abc_foo def_bar ghi_foo