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.

2194. Impossible container requirements for adaptor types

Section: 23.6 [container.adaptors] Status: C++14 Submitter: Sebastian Mach Opened: 2012-10-05 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [container.adaptors].

View all issues with C++14 status.

Discussion:

The stack class template does not have an member type iterator, and therefore instantiations do not meet the general container requirements as described in 23.2.2 [container.requirements.general]. But 23.6.1 [container.adaptors.general] p1 says:

The headers <queue> and <stack> define the container adaptors queue, priority_queue, and stack. These container adaptors meet the requirements for sequence containers.

Since sequence containers is a subset of general containers, this imposes requirements on the container adaptors that are not satisfied.

Daniel Krügler: The wording change was performed as an editorial reorganization as requested by GB 116 occuring first in N3242, as a side-effect it does now make the previous implicit C++03 classification to [lib.sequences]/1 more obvious. As the NB comment noticed, the adaptors really are not sequences nor containers, so this wording needs to be fixed. The most simple way to realize that is to strike the offending sentence.

[ Daniel adds concrete wording. ]

[2013-04-20, Bristol]

Unanimous consensus that queue and stack are not meant to be sequences.

Decision: move to tentatively ready

[2013-09-29, Chicago]

Apply to Working Paper

Proposed resolution:

This wording is relative to N3376.

  1. Change 23.6.1 [container.adaptors.general] p1 as indicated:

    -1- The headers <queue> and <stack> define the container adaptors queue, priority_queue, and stack. These container adaptors meet the requirements for sequence containers.