Simple memoization implementation for expensive methods. More...
Simple memoization implementation for expensive methods.
T | Tag type to allow multiple memoizations per class |
Ret | Return type of the memoized method F |
Args | Arguments the memoized method F |
Definition at line 32 of file memoized.h.
#include <memoized.h>
Public Types | |
using | key_t = std::tuple< Args... > |
using | value_t = Ret |
Public Member Functions | |
template<typename F > | |
auto | memoize (bool is_complete, F &&f, Args... args) const |
void | invalidate (Args... args) const |
Private Attributes | |
std::map< key_t, value_t > | cache_ |
using clanguml::util::memoized< T, Ret, Args >::key_t = std::tuple<Args...> |
Definition at line 34 of file memoized.h.
using clanguml::util::memoized< T, Ret, Args >::value_t = Ret |
Definition at line 35 of file memoized.h.
|
inline |
Definition at line 50 of file memoized.h.
|
inline |
|
mutableprivate |
Definition at line 53 of file memoized.h.