C++ Logo

std-proposals

Advanced search

Re: [span] Value of dynamic_extent

From: Bjorn Reese <breese_at_[hidden]>
Date: Mon, 1 Jul 2019 21:39:49 +0200
On 7/1/19 8:59 PM, Andrey Semashev via Std-Proposals wrote:

> I think, std::array allows zero extent. std::span constructor from such
> an array should produce an empty span rather than a span with dynamic
> extent.

A span with dynamic extent spanning an empty array will still be an
empty span:

   std::array<int, 0> array;
   std::span<int> span(array);
   assert(span.size() == 0);

Received on 2019-07-01 14:41:43