@autocall aka property for the millionth time
Adam D. Ruppe
destructionator at gmail.com
Thu Jul 4 08:37:19 PDT 2013
On Thursday, 4 July 2013 at 15:26:45 UTC, Adam D. Ruppe wrote:
> ref Property prop() @autocall {
> return _prop;
> }
You might be wondering: what's the point of that over just having
a "Property prop;"?
The one thing I tend to want this for is some kind of dynamic
type, where I use opDispatch to return a helper object from an AA:
ref Property opDispatch(string name)() @autocall {
return this.properties[name];
}
Which might also have extra code to insert it into the AA, or
throw, etc. if needed. I don't think there's any way to do that
without a function of some sort.
More information about the Digitalmars-d
mailing list