Created on 1998-10-28.00:00:00 last changed 172 months ago
Proposed resolution:
Replace the first line of code in the example in [new.delete.placement] with:
void* place = operator new(sizeof(Something));
Section 18.5.1.3 contains the following example:
[Example: This can be useful for constructing an object at a known address: char place[sizeof(Something)]; Something* p = new (place) Something(); -end example]
First code line: "place" need not have any special alignment, and the following constructor could fail due to misaligned data.
Second code line: Aren't the parens on Something() incorrect? [Dublin: the LWG believes the () are correct.]
Examples are not normative, but nevertheless should not show code that is invalid or likely to fail.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg892 |
1998-10-28 00:00:00 | admin | create |