User Tools

Site Tools


notes:stl_allocation_example

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
notes:stl_allocation_example [2013/02/25 17:00]
andy [Typical output]
notes:stl_allocation_example [2013/02/25 17:01]
andy
Line 90: Line 90:
 ==== 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 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.+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