John Maddock wrote:
Peter Dimov wrote:
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.
True. Although there are other benefits that POD'ness brings: union support, pass through elipsis etc. However, since those are less useful, I might be persuaded that the fix is OK after all if VC7.1 really does the right thing by static initialisation.
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? :-)
Um, good question. It is very important though.
Adding a test case will accomplish three things: 1. It will show that we consider the feature important, 2. It will ensure that it works, 3. It will allow us to verify that patches don't break it. The nice thing is that all this will happen automatically without anybody needing to persuade anyone else. :-) Likewise, adding a test case for the original 7.1 problem could allow us to address its failure by other, more focused, means instead of going with the suggested fix. Test-first and all that. :-)