Nones

Nones are used to represent missing values.

Most C++ built-in types to not support anything like NaNs, so numeric_limits::max is used to respresent missing values.

Two columns containing nones:

  constexpr double dbl_none = prim_traits<double>::none;
  const column<double> xs( { 10.0, 20.0, dbl_none, 30.0 } );
  cout << xs << "\n";

  constexpr unsigned int uint_none = prim_traits<unsigned int>::none;
  const column<unsigned int> ys( { 10, 20, uint_none, 40 });
  cout << ys << "\n";

Output:

10 20 none 30
10 20 none 30

To check if value is none:

  const bool is_none = prim_traits<double>::is_none(xs[2]);
  cout << is_none << "\n";

Output:

1

To fill nones with zeros use zfills:

  const bool is_none = prim_traits<double>::is_none(xs[2]);
  cout << is_none << "\n";

Output:

10 20 0 30
10 20 0 30