More details on the ISO C++ blog about runtime-sized arrays in C++14.
N3639 proposes to add local runtime-sized arrays with automatic storage duration to C++, for example:
void f(std::size_t n)
{
int a[n];
for (std::size_t i = 0; i < n; ++i)
{
a[i] = 2*i;
}
std::sort(a, a+n);
}
Traditionally, the array bound “n” had to be a constant expression.
Pingback: Runtime-sized arrays v std::dynarray in C++ 14 | musingstudio
Pingback: C++14 Language Extensions | musingstudio