:-( that's why people should think before doing... I'll spend my weekend replacing lines of code of colleagues !
Just for verification: if my object is already managed by a shared_ptr, and I get this shared_ptr by some 'get' function on the hash table, than I'll do something like
Code:
weak_ptr<myVariable> p = storage->get("name");
I store shared_ptr s. So will I need to return a weak_ptr in the 'get' function ?
And how about dynamic casts? Something like
Code:
shared_ptr<my_derived_type> p = dynamic_cast<>(storage->get("name"));
Code:
if (you think casting is ugly)
{
i agree;
see my first line;
}