The very straightforward question is: why does the following code not compile?
//foo.cpp
#include <array>
int main() {
std::array<std::array<int, 2>, 2> a = {{0,1},{2,3}};
return 0;
}
The error I get (gcc-4.9.2) is
foo.cpp: In function ‘int main()’:
foo.cpp:4:55: error: too many initializers for ‘std::array<std::array<int, 2ul>, 2ul>’
std::array<std::array<int, 2>, 2> a = {{0,1},{2,3}};
This question addresses the same error but it does not ask for (and replies do not provide) an explanation why this syntax is not accepted.