C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Opt-In Compile Time Bounds Checking

From: Bjorn Reese <breese_at_[hidden]>
Date: Tue, 3 Oct 2023 20:30:52 +0200
On 10/3/23 08:21, Julien Jorge via Std-Proposals wrote:
> Regarding the description of nspan, you wrote:
>
> > We don't use span because present day code uses it differently. For
> example you can not pass span into a function with the same type but
> smaller length.
>
> It seems to me that this restriction can be lifted by changing the
> constraint of 24.7.2.2.2 ยง19.2 from
>
> extent == dynamic_extent
> || OtherExtent == dynamic_extent
> || extent == OtherExtent
>
> to
>
> extent == dynamic_extent
> || OtherExtent == dynamic_extent
> || extent <= OtherExtent

In what way is span::first() or span::subspan() insufficient?

Received on 2023-10-03 18:30:55