C++14 implementation status
Marc Glisse
marc.glisse@inria.fr
Mon Jun 10 15:45:00 GMT 2013
On Mon, 10 Jun 2013, Ed Smith-Rowland wrote:
> The real pickle for dynarray is that, AFAICT, if you really want to support
> arrays on the stack you would need to intercept construction of dynarray in
> the front end and have the front end pass an appropriately sized VLA pointer
> to dynarray basically. (The VLA/alloca'd array must be built in the calling
> stack frame not the ctor frame).
Note that an alternative implementation might be possible using an
extension that would allow default argument values to refer to previous
arguments, like:
void f(int n, void *p=alloca(n));
where alloca would happen in the caller's frame. Using the always_inline
attribute could be another one.
It is probably better to introduce the magic anyway, just mentioning it.
--
Marc Glisse
More information about the Libstdc++
mailing list