1285. allocator_traits call to new

Section: 20.2.9.3 [allocator.traits.members] Status: C++11 Submitter: Howard Hinnant Opened: 2009-12-10 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [allocator.traits.members].

View all issues with C++11 status.

Discussion:

LWG issue 402 added "::" to the call to new within allocator::construct. I suspect we want to retain that fix.

[ 2009-12-13 Moved to Tentatively Ready after 7 positive votes on c++std-lib. ]

Proposed resolution:

Change 16.4.4.6 [allocator.requirements], table 40 "Allocator requirements":

Table 40 — Allocator requirements
Expression Return type Assertion/note
pre-/post-condition
Default
a.construct(c,args) (not used) Effect: Constructs an object of type C at c ::new ((void*)c) C(forward<Args>(args)...)

Change 20.2.9.3 [allocator.traits.members], p4:

template <class T, class... Args>
  static void construct(Alloc& a, T* p, Args&&... args);

4 Effects: calls a.construct(p, std::forward<Args>(args)...) if that call is well-formed; otherwise, invokes ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...).