Does c++ standard support non-const data member being as array bounds? -
see following code:
class x { int a; public: void foo() { char arr[a]; // not constant variable, g++ doesn't report error, why? } };
i thought constant expression can used in array bounds, until today met strange code above. both g++ , clang++ can compile successfully. can't find description in c++ standard supporting it. extented content of compiler? , can find description it?
no, c++ standard doesn't support vla
Comments
Post a Comment