, , . .
++ 11 (.. , ). 12.1, 6 (. 243) : " , ctor , ".
"ctor-initializer" " ", :
Test1::Test1() {}
Test2::Test2() {}
Base::Base() {}
So, both in Test1, and Test2, is Base::numbernever initialized ( Baseis, in Test2, but the Baseimplicit constructor does not initialize number).
At a minimum, the standard does not require initialization Base::number. Compilers are free to define things that the standard does not define. The fact that you see 0does not mean that the operation is defined in accordance with the standard, it just means that your compiler nullifies things in this particular case.
source
share