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.
Section: 21.2 [container.requirements] Status: C++17 Submitter: Jonathan Wakely Opened: 2013-05-14 Last modified: 2017-07-30
View all other issues in [container.requirements].
View all issues with C++17 status.
Is a container C only supposed to refer to allocated memory (blocks of contiguous storage, nodes, etc.) through objects of type C::pointer rather than C::value_type*?
I don't see anything explicitly requiring this, so a container could immediately convert the result of get_allocator().allocate(1) to a built-in pointer of type value_type* and only deal with the built-in pointer until it needs to deallocate it again, but that removes most of the benefit of allowing allocators to use custom pointer types.
[2014-06-12, Jonathan comments]
This issue is basically the same issue as LWG 1521, which agrees it's an issue, to be dealt with in the future, so I request that 2261 not be closed as a dup unless we reopen 1521.
[2016-08, Zhihao comments]
The pointer types are not exposed in the container interface, and we consider that the memory allocation constraints "all containers defined in this clause obtain memory using an allocator" already implies the reasonable expectation. We propose the fix as non-normative.
Tues PM: General agreement on direction, Alisdair and Billy to update wording
Fri AM: Moved to Tentatively Ready
This wording is relative to N4606.
[Drafting notes: if people prefer this to be normative, strip the "Note" markups.]
Modify 21.2.1 [container.requirements.general]/8 as indicated:
Unless otherwise specified, all containers defined in this clause obtain memory using an allocator (see 188.8.131.52 [allocator.requirements]).