Why aren’t variable-length arrays part of the C++ standard?

[*] (Background: I have some experience implementing C and C++ compilers.) Variable-length arrays in C99 were basically a misstep. In order to support VLAs, C99 had to make the following concessions to common sense: sizeof x is no longer always a compile-time constant; the compiler must sometimes generate code to evaluate a sizeof-expression at runtime. … Read more

What are the rules about using an underscore in a C++ identifier?

The rules (which did not change in C++11): Reserved in any scope, including for use as implementation macros: identifiers beginning with an underscore followed immediately by an uppercase letter identifiers containing adjacent underscores (or “double underscore”) Reserved in the global namespace: identifiers beginning with an underscore Also, everything in the std namespace is reserved. (You … Read more

tech