This is confusing, let's try and shine some light on this mess, do you agree with the following:
Old code: Array { 1,2,3,4,5 }
New code: Array { { 1,2,3,4,5 } }
There is actually a mistake in the old code which you wrote, it should be Array = { 1, 2, 3, 4, 5 } (the equals sign is important in the old syntax, and commas between elements are required whether you're writing old or new syntax)
Now your post seems to indicate that the old code won't compile with an old compiler ? That does not make sense. (Then again it might make some sense if the c++ compiler is old enough. I tried it somewhat on VS 2010 and indeed the old code also didn't compile, which is a bit weird but ok, so now so many versions of c/c++ language... yikes)
Perhaps you ment the new code will not compile with an older compiler.
Your last sentence is correct, the old code will compile in both old and new versions of the compiler while the new syntax only compiled in newer compilers.
In particular, you can still write Array = { 1, 2, 3, 4, 5 } in C++11 and newer. It is still valid syntax.Every C/C++ compiler before 2011:
Code: did not exist
After 2011:
Old code: Array { 1,2,3,4,5 }
After 2020:
New code: Array { { 1,2,3,4,5 } }
This syntax did not change at all in 2020 so I'm not sure why you listed that. This is how it actually is:
Every C/C++ compiler before 2011:
Code: Array = { 1, 2, 3, 4, 5 }
After 2011:
Old code: Array = { 1,2,3,4,5 } // this still works
and
Array{ {1, 2, 3, 4, 5} }
Was it worth it for you c/c++ programmers ?
Looking at how does structs are initialized in those code examples, at first glance looks nice, quick, fast, lazy, but I can see that breaking real easy or causing more confusion... (for example field added to structure or re-ordering of fields, this would go undetected)
For now seems to me like a feature that introduces more pain, troubles and unnecessary code than was worth it, anybody disagree ?
Personally I only use the new syntax if I am not initializing an array. In other words, not Array{ {1, 2, 3, 4, 5} } but I will happily write things like my_string{"Control Message"} or flag{0x001}. I like using the new syntax when I'm initializing class variables. Now I'm usually making pointers as class members and not fixed-sized arrays in classes so I have no need for Array = { 1, 2, 3, 4, 5 } inside a class but I also cannot use malloc() unless it's inside a function, so Dynamic_array { malloc(1*sizeof(Dynamic_array) } is invalid in the part of the class that's outside a function (and so is the equivalent using = sign instead of outer brackets).