現在、initializer_list の初期化を受け入れない多次元配列がありますが、それを許可したいと考えています。ただし、テンプレート引数に基づいて std::initializer_list に任意のネスト数を指定することはできないようです。
// e.g. 5D array:
array<int, 5> arr(10, 5, 20, 34, 10); // the integers are the lengths of each dimension.
// This is what I'm trying to achieve on top of the above:
// creates the array and initializes it
array<int, 5> arr{ {{{{0, 1}}}}, {{{{1, 1}}}} };
// class signature:
// template <template T, unsigned dimensions> array { ... }
// --> where T is the array element type
答えは必ずしも を使用する必要はありませんstd::initializer_list
。