Other common implementations of memoize usually allow to reset the cache. For example, this is quite common in python: @memoize def square (x): return x*x square(2) square(3) square.cache.clear() It would be helpful if we could accomplish the same with std.functional.memoize.
Just tried implementing this by making memoize a struct with a static opCall: https://github.com/dlang/phobos/compare/master...AurelC2G:19859-memoize-cache-clear However I ran into bug #18289, so this doesn't work as-is. Any suggestions?
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10371 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB