Title
Unclear preconditions for operator[] for sequence containers
Status
wp
Section
[sequence.reqmts]
Submitter
Ville Voutilainen

Created on 2023-04-24.00:00:00 last changed 10 months ago

Messages

Date: 2023-06-19.14:50:03

Proposed resolution:

This wording is relative to N4944.

  1. Modify [sequence.reqmts] as indicated:

    a[n]
    

    -118- Result: reference; const_reference for constant a

    -119- ReturnsEffects: Equivalent to: return *(a.begin() + n);

    -120- Remarks: Required for basic_string, array, deque, and vector.

Date: 2023-06-17.00:00:00

[ 2023-06-17 Approved at June 2023 meeting in Varna. Status changed: Voting → WP. ]

Date: 2023-05-15.00:00:00

[ 2023-05-24; Reflector poll ]

Set status to Tentatively Ready after six votes in favour during reflector poll.

Date: 2023-04-24.00:00:00

In [sequence.reqmts]/118, we specify what a[n] means for a sequence container a, but we don't state that it actually has preconditions, other than implied ones.

When we want to use implied preconditions, we can actually get them by using the "Effects: Equivalent to..." wording.

History
Date User Action Args
2023-06-19 14:50:03adminsetmessages: + msg13655
2023-06-19 14:50:03adminsetstatus: voting -> wp
2023-06-12 08:52:25adminsetstatus: ready -> voting
2023-05-24 14:27:59adminsetmessages: + msg13563
2023-05-24 14:27:59adminsetstatus: new -> ready
2023-04-29 09:23:28adminsetmessages: + msg13536
2023-04-24 00:00:00admincreate