Title
"Effects: Equivalent to return" in [span.elem]
Status
new
Section
[span.elem]
Submitter
Arthur O'Dwyer

Created on 2023-11-09.00:00:00 last changed 1 week ago

Messages

Date: 2023-11-18.12:33:42

Proposed resolution:

This wording is relative to N4964.

  1. Modify [span.elem] as indicated:

    constexpr reference operator[](size_type idx) const;
    

    -1- Preconditions: idx < size() is true.

    -2- EffectsReturns: Equivalent to: return *(data() + idx);.

    -?- Throws: Nothing.

    constexpr reference front() const;
    

    -3- Preconditions: empty() is false.

    -4- EffectsReturns: Equivalent to: return *data();.

    -?- Throws: Nothing.

    constexpr reference back() const;
    

    -5- Preconditions: empty() is false.

    -6- EffectsReturns: Equivalent to: return *(data() + (size() - 1));.

    -?- Throws: Nothing.

    constexpr pointer data() const noexcept;
    

    -7- EffectsReturns: Equivalent to: return data_;.

Date: 2023-11-09.00:00:00

In reviewing the wording for P2821 span.at(), it had been noticed that [span.elem] uses a lot of "Effects: Equivalent to return […];" which could be simply "Returns: […]".

For comparison, [string.view.access] uses "Returns: ..." instead, so I suggest that [span.elem] should be consistent with that.

History
Date User Action Args
2023-11-18 12:33:42adminsetmessages: + msg13863
2023-11-09 00:00:00admincreate