Is it possible to initialise an array of non-POD with operator new and initialiser syntax?
问题 I have just read and understood Is it possible to initialise an array in C++ 11 by using new operator, but it does not quite solve my problem. This code gives me a compile error in Clang: struct A { A(int first, int second) {} }; void myFunc() { new A[1] {{1, 2}}; } I expected {{1, 2}} to initialise the array with a single element, in turn initialised with the constructor args {1, 2}, but I get this error: error: no matching constructor for initialization of 'A' new A[1] {{1, 2}}; ^ note: