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-15 23:15:19 UTC

Priority: 3

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

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: