-
-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
Description
Channel
C++Weekly
Topics
Why variable-length arrays are available in C++ as a compiler extension (why not part of standard and why not removed altogether).
The good (they were added to C99 for some reason, right? Right?)
The bad (sizeof becomes runtime)
The ugly (
Lets say we have:
template<typename T> struct S {};
How are we (and compiler supposer to interpret:
int arr[n];
S<decltype(arr)> s;
Well, the compiler disallows it. So we get "part of the language" that doesn't work with other part of the language
)
Length
Probably 5-10 minutes