C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Make std::span convertible to a const'd span

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Sun, 22 Sep 2024 17:44:12 +0100
On Sun, 22 Sept 2024 at 17:21, Oliver Schädlich via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> It would be nice to make it possible that a span<Xxx> could be converted
> implicitly to a
> span<const Xxx>
>

Doesn't that work already?


> as well as the iterators inside such spans could be converted to their
> const'd parent span's counterpart.
>
That doesn't work though.


> Maybe the opposite direction as explicit would make
> also sense.
>

I would prefer if that doesn't work.


> I'm using spans and span-iterators a lot to have bounds-checking on linear
> memory
> ranges while debugging.
>
>

Received on 2024-09-22 16:45:30