This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 114a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-18


79. Alignment and placement new

Section: 17.6.3.4  [new.delete.placement]     Status: dup     Submitter: Herb Sutter     Date: 15 Dec 1998

The example in 17.6.3.4 [new.delete.placement] 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. One way to correct it would be to change the definition of place to read:
    char* place = new char[sizeof(Something)];

Rationale (10/99): This is an issue for the Library Working Group.