I would prefer a static constexpr member:
template <size_t... Entries> struct StaticArray { static constexpr size_t N = sizeof...(Entries); size_t array[N] = {Entries...}; };
Perhaps with a number of other member functions constexpr ( size() , begin() , end() , data() , etc.)
Barry source share