Closed wg21bot closed 1 year ago
This probably needs a paper, but we can try.
2022-11-09 08:00 to 09:45 UTC-10 Kona Library Evolution Minutes
Chair: Fabio Fracassi
Poll 1.10: Reject C++23 National Body comment US-43-104 subspan Type Confusion and any duplicate comments.
Strongly Favor | Weakly Favor | Neutral | Weakly Against | Strongly Against |
---|---|---|---|---|
5 | 7 | 2 | 2 | 1 |
Outcome: Weak consensus in favor.
There was no consensus for a change.
When std::span was originally proposed, size_type was signed and the second (and default) argument to the subspan() function can be distinguished – based on value – as either requesting a size (non-negative value) or as a special sentinel value (negative value -1) standing for “until the rest of the original span object). However, in a previous feedback resolution, size_type was changed to unsigned type without realizing the implication on semantics change for this function. The specification as it stands now introduces a type confusion.
Proposed change:
Split this function into two overloads: a. Subspan(sizd_type offset) with the meaning of returning a sub-span starting from offset till the end. Subspan(size_type offset, size_type count) with the meaning of retuning a subspan starting from offset and with length count.