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

### 2906. There is no ability to supply an allocator for the control block when constructing a `shared_ptr` from a `unique_ptr`

Section: 20.3.2.2.2 [util.smartptr.shared.const] Status: New Submitter: United States Opened: 2017-02-03 Last modified: 2017-07-16

Priority: 3

View all other issues in [util.smartptr.shared.const].

View all issues with New status.

Discussion:

Addresses US 130

There is no ability to supply an allocator for the control block when constructing a `shared_ptr` from a `unique_ptr`. Note that no further `shared_ptr` constructors need an allocator, as they all have pre-existing control blocks that are shared, or already have the allocator overload.

Proposed change: Add an additional `shared_ptr` constructor, `template <class Y, class D, class A> shared_ptr(unique_ptr<Y, D>&& r, A alloc)`, with the same semantics as the existing constructor taking a `unique_ptr`, but using the `alloc` argument to supply memory as required.

[2017-07 Toronto Thurs Issue Prioritization]

Priority 3; Alisdair to provide wording

Proposed resolution: