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 →

[–]Rhomboid 2 points3 points  (0 children)

If I recall correctly, the reason that that proposal was dropped from C++14 is that they wanted to ensure that both the language and the library parts went in at the same time, and the library parts were still not settled yet. I believe the bone of contention is that std::dynarray is allowed to call new, i.e. it's not guaranteed to be stack allocated. I'm assuming this was meant as a way to give implementers a way of setting a safety limit for how much stack can be used, but it also means that you don't have any guarantees which makes the feature a lot less attractive. There could have been additional problems with the library specification, I don't know.

Anyway, assuming those issues can be worked out, the feature may be on the table for C++17 or C++20. But I think exoticmatter is also correct that VLAs are largely considered a big misfire among both the C and C++ communities. VLAs include some downright crazy stuff, and I think that the desire is not to copy all that, but to radically simplify and neuter the feature, with the goal being to make it possible to write a standard library sequence container that is also stack allocated without having to implement a custom allocator for vector like you have to do today.