This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofResolved status.
select_on_container_(copy|move)_construction over-constrainedSection: 99 [allocator.concepts.members]Status:ResolvedSubmitter: Alberto Ganesh BarbatiOpened: 2009-07-08Last modified: 2016-01-28
Priority:Not Prioritized
View all issues withResolved status.
Discussion:
I believe the two functionsselect_on_container_(copy|move)_construction() are over-constrained. Forexample, the return value of the "copy" version is (see99 [allocator.concepts.members]/21):
Returns:
xif the allocator should propagate from the existingcontainer to the new container on copy construction, otherwiseX().
Consider the case where a user decides to provide an explicit conceptmap for Allocator to adapt some legacy allocator class, as he wishes toprovide customizations that theLegacyAllocator concept map templatedoes not provide. Now, although it's true that the legacy class isrequired to have a default constructor, the user might have reasons toprefer a different constructor to implementselect_on_container_copy_construction(). However, the current wordingrequires the use of the default constructor.
Moreover, it's not said explicitly thatx is supposed to be theallocator of the existing container. A clarification would do no harm.
[2009-10 Santa Cruz:]
NAD EditorialResolved. Addressed byN2982.
Proposed resolution:
Replace 99 [allocator.concepts.members]/21 with:
X select_on_container_copy_construction(const X& x);-21-Returns:
an allocator object to be used by the new container on copyconstruction. [Note:xif the allocator should propagate from the existingcontainer to the new container on copy construction, otherwiseX().xis the allocator of the existing container thatis being copied. The most obvious choices for the return value arex, ifthe allocator should propagate from the existing container, andX().— end note]
Replace 99 [allocator.concepts.members]/25 with:
X select_on_container_move_construction(X&& x);-25-Returns:
an allocator object to be used by the new container on moveconstruction. [Note:move(x)if the allocator should propagate from the existingcontainer to the new container on move construction, otherwiseX().xis the allocator of the existing container thatis being moved. The most obvious choices for the return value aremove(x), ifthe allocator should propagate from the existing container, andX().— end note]