7 #include "core/adt/hash.h"
12 template <
typename T,
typename... Args>
15 using KeyT = std::tuple<Args...>;
18 T operator() (Args... args, std::function<T()> &&f)
21 if (
auto it = cache_.find(key); it != cache_.end()) {
26 cache_.emplace(key, result);
31 std::unordered_map<KeyT, T> cache_;