Title
Placement new example has alignment problems
Status
dup
Section
[new.delete.placement]
Submitter
Herb Sutter

Created on 1998-12-15.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

Duplicate: 114

Date: 1998-12-15.00:00:00

The example in [new.delete.placement] paragraph 4 reads:

[Example: This can be useful for constructing an object at a known address:

   char place[sizeof(Something)];
   Something* p = new (place) Something();

end example]

This example has potential alignment problems.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1822
1998-12-15 00:00:00admincreate