In c++17 you can do
std::array a{ "one", "two", "three" };
and get a std::array<const char*, 3>. Awesome!
Because array member variables must have their size specified in the class declaration this is not usable as a class variable. I would like to create a class with one of these arbitrarily long initialization list initialized arrays and one or more constexpr methods. I would expect the only constructor to take the initialization list as an argument. Is there a way to do this?
std::arrayis usable as class field just fine. But if you need variable size array then you needstd::vectorstd::array?