yage.core.cacheAuthors:Eric Poggel License: LGPL v3 $(DDOC_MODULE_MEMBERS
Limitations: The function must be pure (obviously). The function used must either be a top-level function or a static nested function that doesn't reference any local variables. Example: static bool foo(int a, float b) { return a>b; } Cache!(foo) fooCached; fooCached(1, 3.5f); // body of foo is executed fooCached(1, 3.5f); // body of foo is not executed, previous result returned. |