This might sound ridiculous but is using a copy constructor to deep copy objects into a list efficient, really?
I mean, it seems kind of fast if the list can only contain references, since they can't
would it not be faster if they contain the pointers to the object in memory?
So i am talking about dynamic allocation here.
I tried that, to make a list of points to object in memory and was shocked to discover that while it deletes the pointer, it doesn't however call the destructor of that object!!
i wrote a function to delete it manually.
But if it STL list doesn't call the destructor on erase of a pointer to object using the free store, is it a good idea then.
Which is more efficient?