[RFC] Add C++14's dynarray container (23.3.4, n3662).
Rüdiger Sonderfeld
ruediger@c-plusplus.de
Thu Sep 26 01:29:00 GMT 2013
On Wednesday 25 September 2013 17:57:28 Joe Buck wrote:
> As you say, dynarray should be the C++ equivalent of VLAs, so ideally the
> compiler could use the same code as is used for VLAs, perhaps by creating
> new builtin functions if there isn't something that can already be used.
> It might not be possible to produce a quality library-only implementation,
> compiler support might be needed.
I don't think it can be done without compiler support. There would have to be
a builtin function to allocate stack memory in the calling function to make it
work. (Calling alloca inside a dynarray library function of course won't do
it. Don't know why I tried it initially.)
Regards,
Rüdiger
More information about the Libstdc++
mailing list