How do I initialize a member array with an initializer_list?
You can use a variadic template constructor instead of an initializer list constructor: struct foo { int x[2]; template <typename… T> foo(T… ts) : x{ts…} { // note the use of brace-init-list } }; int main() { foo f1(1,2); // OK foo f2{1,2}; // Also OK foo f3(42); // OK; x[1] zero-initialized foo f4(1,2,3); // … Read more