Discussion: Rvalue refs and a Move construtor for D

kinke noone at nowhere.com
Fri Sep 6 18:42:08 UTC 2019


On Friday, 6 September 2019 at 18:13:03 UTC, kinke wrote:
> It'd just make the D ABI conform to the C++ ABI wrt. passing 
> non-PODs and large PODs by value, making the compilers adhere 
> to the D spec *and* fixing C++ interop when passing such 
> structs by value across language barriers, soomething you're 
> surely looking forward too.
> So the proposed ABI change (pass by ref instead of on stack & 
> let callER destruct it) is the exact opposite of what you seem 
> to see it as - it's streamlining the D ABI with C++. And it's 
> orthogonal to the proposed move/forward intrinsics.

Dammit, I stand corrected again, just checked the clang ABI on 
Posix x86_64 - it does pass large PODs on the stack. So please 
discard my mentionings of large PODs (those are passed by ref on 
Win64...) in this thread, my intention was always to firstly 
adopt the respective C++ ABI for each target, and secondly to 
exploit the low-level-by-ref-passing of non-PODs (AFAIK, what C++ 
does for all targets) when moving lvalue arguments to by-value 
params (by eliding the temporary and passing the lvalue ref 
directly), thirdly hoping to cover enough use cases in order NOT 
to have to introduce rvalue refs in the language.


More information about the Digitalmars-d mailing list