This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.

1285. allocator_traits call to new

Section: [allocator.traits.members] Status: C++11 Submitter: Howard Hinnant Opened: 2009-12-10 Last modified: 2017-02-03

Priority: Not Prioritized

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

View all issues with C++11 status.


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 [allocator.requirements], table 40 "Allocator requirements":

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

Change [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)...).