11 template <
typename SharedPtr,
typename... Args>
15 using type =
typename SharedPtr::element_type;
16 return std::make_shared<type>(std::forward<Args>(args)...);
23 static auto addresses = std::map<const void*, unsigned>{};
24 auto p = addresses.emplace(t, 0);
26 p.first->second = addresses.size();
27 return p.first->second;
33 return address(static_cast<const void*>(t));
SharedPtr make_shared_ptr(Args &&...args)
Same as std::make_shared, but parameterized by the shared_ptr type, not the (pointed to) element_type...
unsigned address(const void *t)
Name pointers, to make them easier to read.