I'm trying to initialize a dynamically declared array with an initializer list but I noticed that I have to provide the array size with GCC or I get an error. Trying the same using MSVC does not cause any errors if the array size is left out. Is providing array size when using an initializer list with dynamic arrays mandatory or not? Is this something implementation-defined which is why it's different for both the compilers?
int *array { new int [3] {0, 1, 2} }; // Works with both MSVC and GCC.
int *array { new int [] {0, 1, 2} }; // Works only with MSVC, not GCC.