Title
uninitialized_construct_using_allocator should use construct_at
Status
c++20
Section
[allocator.uses.construction]
Submitter
United States

Created on 2019-11-06.00:00:00 last changed 46 months ago

Messages

Date: 2019-11-07.08:02:35

Proposed resolution:

This wording is relative to N4835.

  1. Modify [allocator.uses.construction] as indicated:

    template<class T, class Alloc, class... Args>
      constexpr T* uninitialized_construct_using_allocator(T* p, const Alloc& alloc, Args&&... args);
    

    -17- Effects: Equivalent to:

    return ::new(static_cast<void*>(p))
      T(make_obj_using_allocator<T>(apply([&](auto&&...xs) {
             return construct_at(p, std::forward<decltype(xs)>(xs)...);
         }, uses_allocator_construction_args<T>(alloc, std::forward<Args>(args)...));
    

Date: 2019-11-07.08:02:35

[ 2019-11 Status to Ready during Wednesday night issue processing in Belfast. ]

Date: 2019-11-06.00:00:00

Addresses US 213

uninitialized_construct_using_allocator should use construct_at instead of operator new

Proposed change:

Effects: Equivalent to:

return ::new(static_cast<void*>(p))
construct_at(p,
T(make_obj_using_allocator<T>(alloc,
std::forward<Args>(args)...)));

Tim Song:

The proposed wording in the NB comment is incorrect, because it prevents guaranteed elision.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: voting -> wp
2020-01-17 04:54:50adminsetstatus: ready -> voting
2019-11-07 08:02:35adminsetmessages: + msg10772
2019-11-07 08:02:35adminsetstatus: new -> ready
2019-11-06 19:04:02adminsetmessages: + msg10758
2019-11-06 00:00:00admincreate