3 ms·
shared_ptr isn't necessary for containers, it's only necessary for bad containers. Edit: Of course I'm being a bit stupidly snarky here, obviously if you have
by shrughes 14y ago
shared_ptr isn't necessary for containers, it's only necessary for bad containers.
Edit: Of course I'm being a bit stupidly snarky here, obviously if you have a standard container you need a shared_ptr, or an intrusive_ptr, or some other pointer, the moral of the story is that std containers aren't good for holding owned pointers in C++03.
I don't think boost ptr_containers are particularly good either, but that's mostly because of the huge cost of putting the string '#include "boost/' in your code.