C++ Logo

std-proposals

Advanced search

[span] default constructor constraint after index_type signedness change

From: Jordi Vilar <development_at_[hidden]>
Date: Tue, 9 Jul 2019 12:11:12 +0200
After changing the index_type from signed to unsigned, the sign of the
dynamic_extent constant also changed from -1 to the maximum unsigned value.
This changes also the meaning of the expression 'size() <= 0'.

In the lasts drafts (N4810 & N4820), section [span.cons] documents the
default constructor as:



*22.7.3.2 Constructors, copy, and assignment [span.cons]constexpr span()
noexcept;*1 *Constraints:* *Extent <= 0* is true.
2 *Ensures:* size() == 0 && data() == nullptr.

I think the constraint is now broken and should be reworded as 'Extent == 0
|| Extent == dynamic_extent'.

Received on 2019-07-09 05:13:18