something like this:
> struct S {
> // variables...
> string doGen(int n) { return ""; }
> alias gen = memoize!doGen;
> }
The error I got is:
> Error: need 'this' for 'doGen' of type 'string(int n)'
I can't make doGen static because it access non-static struct
members... can I workaround this?