
On Mon, Oct 24, 2011 at 7:42 PM, Allan Johns <allan.johns@drdstudios.com>wrote:
Because I don't want to have to introduce a custom shared_ptr class across my whole codebase when a standard one will do?
Well apparently it's not doing since you'd need to write more utility code anyway. :P If I understand correctly.
That's the standard solution. You can use T instead of T*, or std::unique_ptr<T>, or a boost::ptr_map.
How do either of these suggestions deal with avoidance of duplicating shared objects within a hierarchy? Furthermore a ptr_map won't cut it, my keys also need to be deep-copied as they are a non-trivial type.
I'm not sure they do, I didn't quite understand your case. I feel like either there's an existing and more orthodox approach, or that if this is indeed the best approach it's quite situational at best. -- GMan, Nick Gorski