new properties for basic types

Dominikus Dittes Scherkl via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 15 04:01:24 PDT 2014


On Tuesday, 15 July 2014 at 05:26:57 UTC, Philippe Sigaud via 
Digitalmars-d-learn wrote:
> @property allows you to call a function without the parenthesis 
> (), to imitate a field in a struct or class.

Ah, ok. That means without @property I would need to write

defaultInit!T() instead of defaultInit!T

Hmm. I'm not sure that I like this syntax that hides a function 
call.

> In this particular case, I don't know what defaultInit is used 
> for. It seems to compile to a forward declaration of a function,
> but I don't know what for.
>
> I cannot find it on my copy of std.traits. What DMD version are 
> you using?

Hmm. Ok it was in 2.064. I should update my setup it seems :-)


More information about the Digitalmars-d-learn mailing list