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.

2448. Non-normative Container destructor specification

Section: 24.2.2 [container.requirements.general] Status: C++17 Submitter: Daniel Krügler Opened: 2014-10-18 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.

Discussion:

According to Table 96 — "Container requirements" the specification:

note: the destructor is applied to every element of a; any memory obtained is deallocated.

The initial "note:" can be read as if that part of the specification would not be normative (This note form differs from footnotes in tables, which have normative meaning).

It seems that this initial part of the specification exists since C++98. But comparing with the similar SGI Container specification there is no evidence for that being intended to be non-normative.

[2015-02, Cologne]

NJ: If we fix this, we should also fix it elsewhere. Oh, this is the only place?
GR: If this is intended to be different from elsewhere, we should make sure.
AM: valarray specifies this without the "note:".
DK: valarray requires trivially destructible types!
GR: That's good enough for me.
NJ: First time valarray has been useful for something!

Proposed resolution:

This wording is relative to N4140.

  1. Change 24.2.2 [container.requirements.general], Table 96 — "Container requirements", as indicated:

    Table 96 — Container requirements
    Expression Return type Operational
    semantics
    Assertion/note
    pre-/post-condition
    Complexity
    (&a)->~X() void note: the destructor
    is applied to every
    element of a; any
    memory obtained is deallocated.
    linear