G
Gandalf
Hello. I have some questions about the standard containers.
How does the standard containers behave if I do
queue<Foo> myQ;
queue<Foo> myQ2;
.... insert into myQ...
myQ = myQ2;
Will it call the copy constructor for each element in the queue and insert
them into the other queue?
or,
queue<Foo* > myQ3;
queue<Foo* > myQ4;
myQ3 = myQ4;
What will happen here?
(Assuming I have a properly implemented class Foo with CC, operator=,
destructor and so on)
If I destroy a queue object, will the destructor be called for each element
in the queue?
How does the standard containers behave if I do
queue<Foo> myQ;
queue<Foo> myQ2;
.... insert into myQ...
myQ = myQ2;
Will it call the copy constructor for each element in the queue and insert
them into the other queue?
or,
queue<Foo* > myQ3;
queue<Foo* > myQ4;
myQ3 = myQ4;
What will happen here?
(Assuming I have a properly implemented class Foo with CC, operator=,
destructor and so on)
If I destroy a queue object, will the destructor be called for each element
in the queue?