
8 May
2012
8 May
'12
1:29 a.m.
AMDG On 05/07/2012 01:35 PM, Christopher Kormanyos wrote:
I also believe that the value of, say, the default constructor of float is zero. In particular
void do_something() { // F1 is initialized to zero. float f1 = float(); ... }
This is /not/ the default constructor. f1 is copy constructed from an /value-initialized/ temporary. For scalar types, value initialization is the same as zero initialization.
So ISO/IEC 14882:2011 ensures that all valid uses of complex are default initialized to zero. Without judgement, this is the spec.
In Christ, Steven Watanabe