2308. Clarify container destructor requirements w.r.t. std::array

Section: 23.2.2 [container.requirements.general] Status: C++14 Submitter: Jonathan Wakely Opened: 2013-09-26 Last modified: 2017-07-05

Priority: 0

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

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

View all issues with C++14 status.

Discussion:

It has been suggested that Table 96 — "Container requirements" makes confusing requirements for the destructor of std::array:

"note: the destructor is applied to every element of a; all the memory is deallocated."

Since std::array obtains no memory, there is none to deallocate, arguably making it unclear what the requirement means for std::array::~array().

[Issaquah 2014-02-11: Move to Immediate]

Proposed resolution:

This wording is relative to N3691.

  1. Change in 23.2.2 [container.requirements.general], Table 96 — "Container requirements", the "Assertion/note/pre-/post-condition" for the expression "(&a)->~X()" as indicated:

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