magically a static member on init?

Martin martin.brzenska at googlemail.com
Sun Nov 15 10:06:55 UTC 2020


On Sunday, 15 November 2020 at 00:29:41 UTC, H. S. Teoh wrote:
> if you don't like the semantics, don't use it; always allocate 
> the field in the class ctor instead.

Hi, i neither like it nor dislike it - it just caught me by 
surprise because i was under the impression that if i create a 
new instance then all members get initialized according to the 
declared optional default value.

I can see how this is a feature - but it is also of kind "expert 
knowledge" and i would argue that "expert knowladge" is a designs 
arch enemy.


More information about the Digitalmars-d-learn mailing list