cplusplus / nbballot

Handling of NB comments in response to ballots
14 stars 4 forks source link

FR-024-025 24.7.3.1p15 [span.overview] Interface for `span::subspan` #426

Closed wg21bot closed 1 year ago

wg21bot commented 1 year ago

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.

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. b. Subspan(size_type offset, size_type count) with the meaning of retuning a subspan starting from offset and with length count.

jensmaurer commented 1 year ago

Duplicate of #520

brycelelbach commented 1 year ago

Rejected, no consensus for change.