[Issue 19859] New: std.functional.memoize: Ability to clear the cache

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 11 08:51:53 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19859

          Issue ID: 19859
           Summary: std.functional.memoize: Ability to clear the cache
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: aurelien.fredouelle+dlang at gmail.com

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.

--


More information about the Digitalmars-d-bugs mailing list