Vector (C++)

cppreference

intializer list / ref

#include <initializer_list>

struct Bucket {
  vector<float> boundaries;

  Bucket(std::initializer_list<float>&& edges):
    boundaries( edges)
  {}
};

// And then, you can pass list like that:
Bucket({ -40, -35, -30, -25, -20, -15, -10, -5, -3, 0, +10 };
Written on July 6, 2025, Last update on July 6, 2025
c++ vector array