Does the copy constructor of any std::container (specifically std::queue) containing object pointers call the member's copy constructors to allow deep copies or does it perform a shallow copy on the pointer values?
Example:
/*******************************************************************************
* <summary>
* Initializes a new instance of the EventHandler class.
* </summary>
*
* <param name="handler">The handler to copy.</param>
*******************************************************************************/
EventHandler::EventHandler(const EventHandler& handler) : _eventQueue(handler._eventQueue) { }
_eventQueue is declared as: std::queue<Event*> _eventQueue;
where Event is a Base class with a copy constructor and has multiple derived classes with their own copy constructors.
P.S.: I looove AtomineerUtils and VisualAssistX (especially when combined! :D)
EDIT:
Given the answers below, would this be a proper way to create copy of the original such that the original is unmodified or will the copy be a reverse of the original (simple fix but still an important distinction)?
EventHandler::EventHandler(const EventHandler& handler) {
for(size_t i = 0; i < handler._eventQueue.size(); ++i) {
this->_eventQueue.push(new Event(handler._eventQueue._Get_container().at(i)));
}
}