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.
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.