2 ms·
"C++ and D both try to be binary-compatible with C, they MUST return a structure by copying it." Only for code that has C linkage. For normal C++ or D code the
by jey 18y ago
"C++ and D both try to be binary-compatible with C, they MUST return a structure by copying it."
Only for code that has C linkage. For normal C++ or D code the calling convention can be whatever the compiler wants, it's not restricted by the C calling convention.
(C linkage is specified in C++ with 'extern "C"', and with 'extern (C)' in D.)