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

2320. select_on_container_copy_construction() takes allocators, not containers

Section: 23.2.2 [container.requirements.general] Status: C++14 Submitter: Stephan T. Lavavej Opened: 2013-09-21 Last modified: 2017-07-05

Priority: 0

View other active issues in [container.requirements.general].

View all other issues in [container.requirements.general].

View all issues with C++14 status.

Discussion:

23.2.2 [container.requirements.general]/7 says "Copy constructors for these container types obtain an allocator by calling allocator_traits<allocator_type>::select_on_container_copy_construction on their first parameters." However, 20.2.9.3 [allocator.traits.members]/8 says that this takes const Alloc&, not a container. 23.2.2 [container.requirements.general]/7 goes on to say "Move constructors obtain an allocator by move construction from the allocator belonging to the container being moved." so we can follow that wording.

[Issaquah 2014-02-11: Move to Immediate]

Proposed resolution:

This wording is relative to N3691.

  1. In 23.2.2 [container.requirements.general]/7 change as indicated:

    -7- Unless otherwise specified, all containers defined in this clause obtain memory using an allocator (see 17.6.3.5). Copy constructors for these container types obtain an allocator by calling allocator_traits<allocator_type>::select_on_container_copy_construction on their first parametersthe allocator belonging to the container being copied. Move constructors obtain an allocator by move construction from the allocator belonging to the container being moved. […]