N3639 proposes to add local runtime-sized arrays with automatic storage duration to C++.
N2648 says that in keeping with C++ practice, std::dynarray
s are usable with more than just automatic variables. But to take advantage of the efficiency stack allocation, we wish to make dynarray
optimizable when used as an automatic variable.
In short, C11 style runtime-sized arrays are restricted to being stored on the stack. dynarray
is not, but can be optimized when stored on the stack to be as efficient as C11 style runtime-sized arrays (or so is the goal).
C11 style runtime-sized arrays can be a useful syntax still, and the cost to increase intercompilability with C isn’t high: the mechanism would have to be implemented for efficient automatic dynarray
anyhow. In addition, C11 style runtime-sized arrays are first class citizens, and exist regardless of use of std
libraries by the programmer.
There are important differences between actual C11 runtime-sized arrays and C++1y C11-style runtime-sized arrays, not the least of which is the runtime sizeof
that actual C11 runtime-sized arrays support. But basic use of it may be compatible.
Note that in the end, neither where added in C++14.