2167. Copy assignment requirements of Containers

Section: 26.2.1 [container.requirements.general] Status: NAD Submitter: Dean Michael Berris Opened: 2012-07-13 Last modified: 2016-02-10

Priority: Not Prioritized

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

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

View all issues with NAD status.

Discussion:

Table 96 defines the general requirement for copy assignment (row 23, page 704) as:

Table 96 — Container requirements
Expression Return type Operational semantics Assertion/note pre-/post-condition Complexity
r = a X& post: r == a. linear

However there is no requirement that T is CopyInsertable into X.

[2012, Portland: Move to Tentatively NAD]

Howard notes that this may be a difficult requirement for std::array

We already have this requirement for allocator aware containers, and std::array already adds the appropriate extra requirement.

We say the necessary things in the necessary places, but the container requirements continue to cause confusion in where we sometimes say things. Consensus is that this issue remains NAD though.

Proposed resolution:

This wording is relative to N3376.

  1. Change Table 96 — "Container requirements" in 26.2.1 [container.requirements.general]:

    Table 96 — Container requirements
    Expression Return type Operational semantics Assertion/note pre-/post-condition Complexity
    r = a X& Requires: T is CopyInsertable into X.
    post: r == a.
    linear