When you remove an object from an stl container. Is the destructor for the object called?
Do you need to keep a refrence to the object and call the destructor explicitly.
When you remove an object from an stl container. Is the destructor for the object called?
Do you need to keep a refrence to the object and call the destructor explicitly.
>When you remove an object from an stl container. Is the destructor for the object called?
It would be terribly inconvenient if it weren't, don't you think?
>Do you need to keep a refrence to the object and call the destructor explicitly.
You rarely need to call a destructor explicitly. Unless you're sure, assume that the standard library will "do the right thing".
My best code is written with the delete key.
Thnks Prelude was just a little worried and unsure.
If your unsure, write a small test program. (eg One where the destructor just prints something and see if it is called when you remove the object.)
Cheers
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.