MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / getOrCreate

Method getOrCreate

src/cvcuda/util/SimpleCache.hpp:69–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68 template<typename CreateFunc>
69 T getOrCreate(CreateFunc &&create)
70 {
71 auto cached = get();
72 if (cached.has_value())
73 return std::move(cached).value();
74 else
75 return create();
76 }
77
78 void put(T &&payload)
79 {

Callers 1

TESTFunction · 0.80

Calls 1

valueMethod · 0.45

Tested by 1

TESTFunction · 0.64