Im in need of an object that can wrap a lazy initialization for a try_emplace with map (in effect calling a factory type of function only when needed), so that the following will convert ok in try_emplace:
std::map<std::string, bool> cache_;
cache_.try_emplace("hello", lazy_wrapper([]{return true;}));
or perhaps
std::map<std::string, whatever_wrapper<bool> > cache_;
cache_.try_emplace("hello", []{return true;});
I imagine that should be possible, but mainly on the lookout for an off-the-shelf solution (eg. std / boost) compared to rolling my own wrapper.