Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confusion in understanding C++ standards

Tags:

c++

standards

In C++98

12.6.2/4 : After the call to a constructor for class X has completed, if a member of X is neither specified in the constructor's mem-initializers, nor default-initialized, nor initialized during execution of the body of the constructor, the member has indeterminate value.

What does nor initialized during execution of the body of the constructor mean? Can a member be initialized inside the body of the constructor?

like image 742
Bazinga Avatar asked Dec 08 '10 04:12

Bazinga


1 Answers

nor initialized during execution of the body of the constructor is not correct IMHO.

The wordings have been changed in C++03 from nor initialized (in C++98) to nor given a value

After the call to a constructor for class X has completed, if a member of X is neither specified in the constructor’s mem-initializers, nor default-initialized, nor value-initialized, nor given a value during execution of the body of the constructor, the member has indeterminate value.

like image 139
Prasoon Saurav Avatar answered Sep 20 '22 09:09

Prasoon Saurav