19 #ifndef MIR_CACHED_PTR_H_ 20 #define MIR_CACHED_PTR_H_ 27 template<
typename Type>
30 std::weak_ptr<Type> cache;
36 std::shared_ptr<Type>
operator()(std::function<std::shared_ptr<Type>()> make)
38 auto result = cache.lock();
41 cache = result = make();
48 #endif // MIR_CACHED_PTR_H_ All things Mir.
Definition: atomic_callback.h:25
Definition: cached_ptr.h:28
std::shared_ptr< Type > operator()(std::function< std::shared_ptr< Type >()> make)
Definition: cached_ptr.h:36