[Issue 8743] Add support for memoizing class methods
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Oct 2 02:54:08 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8743
--- Comment #6 from bearophile_hugs at eml.cc 2012-10-02 02:54:21 PDT ---
(In reply to comment #5)
> enum bool isClassStruct = (is(fun == class) || is(fun == struct));
No need for extra parentheses:
enum bool isClassStruct = is(fun == class) || is(fun == struct);
> void rehash() { memo.rehash(); }
I think () aren't needed, even with -property.
> int slowFunc(int a, int b)
If the arguments are constant it doesn't work:
int slowFunc(in int a, in int b)
> mixin memoize!slowFunc fastFunc;
This mixin template is useful. A disadvantage is that it doesn't follow the API
(usage) of the Phobos memoize. So maybe it needs a different name, like
memoizeMethod, or something.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list