Created on 2008-07-14.00:00:00 last changed 161 months ago
Proposed resolution:
Replace "new" with "::new" in:
[ post San Francisco: ]
Daniel: HasPlacementNew has been removed from N2774 (Foundational Concepts).
[ San Francisco: ]
Detlef: If we move this to Ready, it's likely that we'll forget about the side comment about the HasPlacementNew concept.
LWG issue 402 replaced "new" with "::new" in the placement new-expression in [allocator.members]. I believe the rationale given in 402 applies also to the following other contexts:
in [specialized.algorithms], all four algorithms unitialized_copy, unitialized_copy_n, unitialized_fill and unitialized_fill_n use the unqualified placement new-expression in some variation of the form:
new (static_cast<void*>(&*result)) typename iterator_traits<ForwardIterator>::value_type(*first);
in [util.smartptr.shared.create] there is a reference to the unqualified placement new-expression:
new (pv) T(std::forward<Args>(args)...),
I suggest to add qualification in all those places. As far as I know, these are all the remaining places in the whole library that explicitly use a placement new-expression. Should other uses come out, they should be qualified as well.
As an aside, a qualified placement new-expression does not need additional requirements to be compiled in a constrained context. By adding qualification, the HasPlacementNew concept introduced recently in N2677 (Foundational Concepts) would no longer be needed by library and should therefore be removed.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2010-10-21 18:28:33 | admin | set | messages: + msg4121 |
2010-10-21 18:28:33 | admin | set | messages: + msg4120 |
2010-10-21 18:28:33 | admin | set | messages: + msg4119 |
2008-07-14 00:00:00 | admin | create |