C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: No overload to create a span from a array<const T, X>
From: Jean Guegant (jguegant_at_[hidden])
Date: 2019-07-18 13:51:24


> Makes me wonder why std::span ctor doesn't just take std::ContiguousRange.

I assuming that the idea here is to make the span Extend template parameter
being cross-checked against the array's size at compile-time instead of
runtime. That's not necessarily a bad idea as long as it covers all sorts
of array.

Jean

On Wed, 17 Jul 2019, 23:41 Lyberta via Std-Discussion, <
std-discussion_at_[hidden]> wrote:

> Jean Guegant via Std-Discussion:
> > It is currently impossible to create a std::span from std::array<const
> T, X>:
>
> Makes me wonder why std::span ctor doesn't just take std::ContiguousRange.
>
> --
> Std-Discussion mailing list
> Std-Discussion_at_[hidden]
> http://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
>



STD-DISCUSSION list run by herb.sutter at gmail.com

Older Archives on Google Groups