[cxx-abi-dev] Transfer modes for parameters and return values
David Vandevoorde
daveed at edg.com
Wed Jun 3 23:59:20 UTC 2009
On Jun 3, 2009, at 5:23 PM, Lawrence Crowl wrote:
> On 6/3/09, David Vandevoorde <daveed at edg.com> wrote:
>> Hello again,
>>
>> In 3.1.1 and 3.1.4, the ABI specifies that "by value" class type
>> parameters
>> and class type return values are passed via the address of a
>> reference if
>> the class type has
>> (a) a nontrivial destructor, or
>> (b) a nontrivial copy constructor.
>>
>> Should we now also add to that:
>> (c) a (nontrivial) move constructor
>> ?
>>
>> (There is currently no notion of "trivial move constructor", but I
>> think
>> there are suggestions to introduce that in the future.)
>
> I'm not sure I can predict the binary consequences of such a notion
> until it is actually defined. So, I would rather wait until then.
It doesn't really have to be defined formally: A constructor for class
X whose first parameter has type
X cv-quals&&
and whose other parameters have a default argument or are the ellipsis
parameter. Such a constructor can be preferred over the trivial copy
constructor for "rvalue copying" (i.e., moving) purposes.
Daveed
More information about the cxx-abi-dev
mailing list