Copy constructor for STL

Does the copy constructor and copy assignment operator not work for stl containers such as stack and queue;
i tried it on Dev C++ 5.11

Hey Shanu, both the copy constructor and copy assignment operator works for STL containers such as stack and queue for C++11 or higher versions (not sure about c++98 :sweat_smile:).

I tried to do it but it is not working

https://ide.codingblocks.com/s/43644

Problem is with your while loop for printing the stack in which you are popping from stack s1 and have written the while loop’s condition for stack s

1 Like