DIP 1014:Hooking D's struct move semantics--Community Review Round 1
Shachar Shemesh
shachar at weka.io
Sat May 19 10:06:19 UTC 2018
On 18/05/18 22:57, kinke wrote:
> I checked, and the reason is that D and C++ use a different ABI wrt.
> by-value passing of non-POD arguments. C++ indeed passes a reference to
> a caller-allocated rvalue, not just on Win64; that makes it trivial, as
> there are no moves across call boundaries. But your proposal may imply
> changing the D ABI accordingly.
That seems to be the case.
Assuming https://dlang.org/spec/abi.html is the ABI you refer to, there
is very little in way of argument calling there:
https://dlang.org/spec/abi.html#function_calling_conventions
"
The extern (C) and extern (D) calling convention matches the C calling
convention used by the supported C compiler on the host system. Except
that the extern (D) calling convention for Windows x86 is described here.
"
So the current state is, in essence, that in C everything is PoD, and
that's why that's also the case in D. Yes, something will need to change
there.
Shachar
More information about the Digitalmars-d
mailing list