Say:
const A a[3] = { {0,0}, {1,1}, {2,2} };
On older compilers, and assuming A
has an accessible copy constructor, you have to say:
const A a[3] = { A(0,0), A(1,1), A(2,2) };
C++ used to be pretty deficient with respect to arrays (certain initializations just were not possible at all), and this got a little better in C++11.