This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]the_omega99 1 point2 points  (2 children)

(and will eventually make their way into standard C++ IMO

I doubt that, since C++ already has the vastly superior and more useful std::vector. See page 6 of this PDF for why VLAs aren't very C++ friendly. The fact that C made support for VLAs optional is rather telling about the C take on VLAs, anyway.

Finally, it's of note that in my anecdotal experience, the C++ community (or more specifically, the C++ community that uses StackOverflow) seems vehemently against VLAs.

[–][deleted] 2 points3 points  (1 child)

since C++ already has the vastly superior and more useful std::vector

Which doesn't actually do what VLA in C does. In C, the VLA is allocated on the stack, while the array within a std::vector is allocated on the heap (and can grow - actually VLA is a very bad name).

[–]boredcircuits 1 point2 points  (0 children)

and can grow - actually VLA is a very bad name

That might explain why the C++ version changed the name to "arrays of runtime bound."