[Issue 20358] External initialization of private struct fields should be disallowed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 6 15:48:12 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20358

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com

--- Comment #4 from Basile-z <b2.temp at gmx.com> ---
I vote for closing as invalid. 

Default constructors should be seen as real constructors so the private fields
are not written directly but rather copied from the constructor parameters to
the fields (conceptually). Finally explicit constructors can be used in a way
that prevents initialization of private fields, if required.

--


More information about the Digitalmars-d-bugs mailing list