On Wed, Jul 3, 2019 at 12:46 AM Justin Bassett via Std-Proposals <std-proposals@lists.isocpp.org> wrote:


On Mon, Jul 1, 2019 at 4:21 PM Nevin Liber via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
  • Why any value at all?  Last I checked, we now have variadic templates, where "now" is defined as since 2011...
template <typename T, std::size_t Extent>
void some_function(std::span<T, Extent> some_span) { ... }

As currently specified, this function accepts any span of any extent, static or dynamic. Using a variadic template breaks this,
and there would be no easy way to write a function taking both kinds of span.

You mean other than:

template<typename T, std::size_t... Extent>
void some_function(std::span<T, Extent...> some_span) { ... }

Variadics also have the advantage that if I want code for just static extent spans, I don't have to use concepts/SFINAE to take dynamic extent spans out of the overload set.
--
 Nevin ":-)" Liber  <mailto:nevin@cplusplusguy.com>  +1-847-691-1404