C++ extension

Perry Smith pedz@easesoftware.com
Thu Apr 20 12:09:00 GMT 2006


I don't understand what you are saying.

If you have several constructors, you have to initialize each member  
in each constructor or have one common constructor.

If the new syntax was allowed, you could still do that.  You could  
specify how to initialize it when the member is declared or you could  
specify it with each constructor.  I'm not suggesting replacing the  
current syntax -- just adding to it.

Perry

On Apr 20, 2006, at 2:31 AM, Olivier Delannoy wrote:

> No it's not better because if you have several constructors, the
> initial state of the object does not have to be defined several time,
> one time globally and one time in the constructor. In the case of
> complex object, creating a temporary unused object is not interesting.
> The constructor is the place where you should initialize object
> states. The current way to do stuff is the more efficient way for C++.
>



More information about the Gcc-help mailing list