As per my understanding based on previous readings, array size needs to be constant and known at compile time with exception to additional support provided by g++ where VLA are supported.
However I was going through one of the c++ draft and now I am confused, does c++ support runtime array bounds. They have given the below code example for defining the array.
C++ draft link: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3690.pdf
Section 8.3.4
Eg:
void f(unsigned int n) {
int a[n]; // type of a is “array of runtime bound of int”
}
No, C++ has not and still doesn't support arrays with a run time size. N3690 was a draft between C++11 and C++14 and it included the text from the propsal N3639 Runtime-sized arrays with automatic storage duration (revision 5)
That proposal was eventually scrapped and in the C++14 draft N4140 the text was removed.
When looking through the drafts, the ones that you can use as "The standard" are