Greetings,
I have a question. When using an STL container, does deleting a container of
pointers also call delete on the (contained) pointers?
For example, if I have (ignore the fluff, it is simply used to explain my
issue)
struct Proc
{
int uid;
int pid;
int parent_id;
};
and then I have
queue<Proc*> Q = new queue<Proc*>;
// I then populate the queue with Proc types
If I do a
delete Q;
will that destroy the queue and the inner elements as well, or do I have to
do the work of ensuring that delete is also called on all the Proc*'s
(contained by the queue) as well?
Sincerely,
X