Initializing a class member that is an object
ketmar
ketmar at ketmar.no-ip.org
Fri Mar 30 11:02:37 UTC 2018
Laurent Tréguier wrote:
> Is this behavior really intentional ?
yes. default values should be the same for all objects. it is predictable,
and allows to initialize objects to the known state simply by blitting
`.init`.
that is, default values aren't a syntax sugar for defining implicit ctor
actions, they are executed once. this is by design.
More information about the Digitalmars-d-learn
mailing list