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.

2679. Inconsistent Use of Effects and Equivalent To

Section: 16.3.2.4 [structure.specifications] Status: C++17 Submitter: Dawn Perchik Opened: 2016-04-14 Last modified: 2017-07-30

Priority: 3

View other active issues in [structure.specifications].

View all other issues in [structure.specifications].

View all issues with C++17 status.

Discussion:

[2016-04, Issues Telecon]

The PR is fine; but bullet #1 in the report really should have a list of places to change.

Jonathan checked throughout the library for bullet #2 and found two problems in [string.access], which have been added to the PR.

[2016-08-03 Chicago]

Fri PM: Move to Tentatively Ready

Proposed resolution:

  1. Change [structure.specifications]/4 as indicated:

    "[…] if F has no Returns: element, a non-void return from F is specified by the Returns: elementsreturn statements in the code sequence."

  2. Add two return keywords to [string.access]:

    const charT& front() const;
    charT& front();
    

    -7- Requires: !empty().

    -8- Effects: Equivalent to return operator[](0).

    const charT& back() const;
    charT& back();
    

    -9- Requires: !empty().

    -10- Effects: Equivalent to return operator[](size() - 1).