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

2794. Missing requirements for allocator pointers

Section: 24.2.2 [container.requirements.general] Status: C++17 Submitter: Billy O'Neal III Opened: 2016-11-09 Last modified: 2017-07-30

Priority: 0

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

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

View all issues with C++17 status.


Addresses US 146

An allocator-aware contiguous container must require an allocator whose pointer type is a contiguous iterator. Otherwise, functions like data for basic_string and vector do not work correctly, along with many other expectations of the contiguous guarantee.

Suggested resolution:

Add a second sentence to 24.2.2 [container.requirements.general] p13:

An allocator-aware contiguous container requires allocator_traits<Allocator>::pointer is a contiguous iterator.

[2016-11-12, Issaquah]

Sat PM: Move to 'Tentatively Ready'

Proposed resolution:

This wording is relative to N4606.

  1. In [allocator.requirements]/5, edit as follows:

    -5- An allocator type X shall satisfy the requirements of CopyConstructible ( The X::pointer, X::const_pointer, X::void_pointer, and X::const_void_pointer types shall satisfy the requirements of NullablePointer ( No constructor, comparison operator, copy operation, move operation, or swap operation on these pointer types shall exit via an exception. X::pointer and X::const_pointer shall also satisfy the requirements for a random access iterator (25.3 [iterator.requirements] [random.access.iterators]) and of a contiguous iterator (25.3.1 [iterator.requirements.general]).