template IPArray::IPArray()

in example/ex_flat_space.cc [139:150]


template <typename METRIC, typename PAYLOAD> IPArray<METRIC, PAYLOAD>::IPArray(IPSpace<PAYLOAD> const &space) {
  auto n    = space.count(METRIC::AF_value);
  _nodes    = {span_alloc<Node>(n)}; // In memory array.
  auto node = _nodes.data();
  // Update the array with all IPv4 ranges.
  for (auto spot = space.begin(METRIC::AF_value), limit = space.end(METRIC::AF_value); spot != limit; ++spot, ++node) {
    auto &&[range, payload]{*spot};
    node->_min     = static_cast<METRIC>(range.min());
    node->_max     = static_cast<METRIC>(range.max());
    node->_payload = payload;
  }
}