8 Aug
2006
8 Aug
'06
11:53 a.m.
Johan RĂ¥de wrote:
John Maddock wrote:
That one is problematic as it really would make the array a non-POD so initialisation would occur during the dynamic phase rather than the static phase.
The compiler is allowed to statically initialize anything it can, and in this case VC 7.1 does.
IMO that would be a deal braker :-(
We aren't actually testing static array initialization, are we? How do we know that it works at all? :-)
So an array class with a non-template assignment op is an aggregate but is not a POD. This language sometimes drives me nuts ;-)
Non-POD aggregates are common, consider struct X { std::string a, b; }; X x = { "a", "b" };