This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: template matching variable size array


Neal D. Becker wrote:
g++34 supports variable size arrays.

There is some support, but it was never really designed. No thought was given to how they interact with other C++ language features. As such, you should not expect that variable size arrays will work with all C++ features, or that they will even work at all. It is probably safe if you stick with very simple constructs, but anything complicated is probably risky.


It is also possible that the feature will be removed or modified in future g++ releases. VLAs were added to ISO C99, and they are different than the old gcc dynamic arrays. I think we still have a mixture of dynamic array and VLA support in the C front end. It is possible that VLAs will be added to a future ISO C++ standard, and when that happens, they will probably not be the same as the VLA support currently in the C++ front end. In which case g++ will be modified to match the standard.

Disclaimer: I am not a C++ expert.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]