[cxx-abi-dev] Passing non-trivial types through ...

Jason Merrill jason at redhat.com
Thu Aug 14 15:25:33 UTC 2014


On 08/13/2014 08:51 PM, Dennis Handly wrote:
> You just say that this use of va_arg produces a const Foo& and don't allow
> Foo to be mentioned.  I suppose you could allow a "const Foo" too.

It's actually just Foo&.

> With your current idea, did you plan to invoke copy constructor or copy
> assignment operator for:
>     Foo f = va_arg(ap, Foo);
>
> I would assume you would have to do that, since the user can "rewind" and
> use va_start ... va_end multiple times.

In that case they would get another (modifiable) lvalue for the same 
object, which is also true of the bitwise-copy approach.

Jason



More information about the cxx-abi-dev mailing list