User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
notes:stl_allocation_example [2013/02/25 16:58]
notes:stl_allocation_example [2013/02/25 17:01]
Line 89: Line 89:
 ==== Typical output ==== ==== Typical output ====
 +The output below demonstrates that an instance is first constructed in-place on the stack (the expression ''​MyClass(11)''​ does this, for example). Then, the ''​std::​list''​ code uses [[wikipedia>​placement new]] to copy the item into place, which results in the copy constructor being invoked (assuming that placement new itself isn't overridden). Finally, the destructor of the in-place instance on the stack is invoked.
 <​file>​ <​file>​
notes/stl_allocation_example.txt ยท Last modified: 2013/02/25 17:31 by andy