This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.

3434. ios_base never reclaims memory for iarray and parray

Section: [ios.base.cons] Status: WP Submitter: Alisdair Meredith Opened: 2020-04-26 Last modified: 2020-11-15

Priority: Not Prioritized

View all other issues in [ios.base.cons].

View all issues with WP status.


According to [] the class ios_base allocates memory, represented by two exposition-only pointers, iarray and parray in response to calls to iword and pword. However, the specification for the destructor in [ios.base.cons] says nothing about reclaiming any allocated memory.

[2020-07-17; Reflector prioritization]

Set priority to 0 and status to Tentatively Ready after six votes in favour during reflector discussions.

[2020-11-09 Approved In November virtual meeting. Status changed: Tentatively Ready → WP.]

Proposed resolution:

This wording is relative to N4861.

  1. Modify [ios.base.cons] as indicated:

    [Drafting note: Wording modeled on container requirements]


    -2- Effects: Calls each registered callback pair (fn, idx) ( [ios.base.callback]) as (*fn)(erase_event, *this, idx) at such time that any ios_base member function called from within fn has well-defined results. Then, any memory obtained is deallocated.