Cached property (translate Python -> D)

Victor Porton porton at narod.ru
Tue Jan 29 17:11:29 UTC 2019


On Tuesday, 29 January 2019 at 15:26:13 UTC, Daniel Kozak wrote:
> Maybe https://dlang.org/phobos/std_functional.html#memoize 
> should helped you

No, this does not compile:

struct C {
     int _f() { writeln("Got!"); return 2; }
     alias f = memoize!_f;
}


More information about the Digitalmars-d mailing list