C++ Logo

std-proposals

Advanced search

Re: Arrays (VLAs) as function parameters (as in C99)

From: DBJ <dbj_at_[hidden]>
Date: Mon, 15 Nov 2021 20:28:46 +0100
Please excuse my ignorance. If we have this in the core language:

template<typename T, size_t N>
auto consume_array ( const T (&arr)[N])
{
   return N ;
}

Why would we need:

auto consume_array_as_modern_c_does ( const int N, const char arr[ static
N] )
{
   return N ;
}

I might be missing here something obvious?

Kind regards ...



>
>

Received on 2021-11-15 13:29:27