<p><br>
On Feb 16, 2013 8:27 PM, "Walter Bright" <<a href="mailto:walter@digitalmars.com">walter@digitalmars.com</a>> wrote:<br>
><br>
><br>
> On 2/16/2013 12:17 PM, Johannes Pfau wrote:<br>
>><br>
>> Am 16.02.2013 21:06, schrieb Walter Bright:<br>
>>><br>
>>> A non-POD cannot be in registers because its address gets taken for constructors/destructors.<br>
>>><br>
>>><br>
>> But creating temporary (bit) copies on the stack is still allowed for non-PODs, right?<br>
><br>
><br>
> No.<br>
><br>
><br>
>><br>
>> Wouldn't it be legal to still pass non-PODs in registers when calling functions and only copying them back to the stack if the address is needed? As we pass structs by value anyway, how could this be problematic?<br>

>><br>
><br>
> No, not allowed. Consider why there are copy constructors, and what they do.</p>
<p>Just catching up to speed with this, would this be passed by value on the stack or by reference?  (The latter would be easier, however the former could probably be forced by adding some language hook to the backend in gdc as a temporary workaround).</p>

<p>Thanks,<br>
Iain. <br>
</p>