1 #ifndef _QUORI_FACE_CACHE_HPP_
2 #define _QUORI_FACE_CACHE_HPP_
19 template<
typename K,
typename V>
41 const V &
getOrCompute(
const K &key,
const std::function<V (
const K &k)> &
f)
43 std::lock_guard<std::mutex> guard(
mut_);
47 if (it->first == key)
return it->second;
50 entries_.push_front(std::make_pair(key,
f(key)));