C++ calling convention only

Benjamin Thaut via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Feb 20 05:40:10 PST 2015


On Friday, 20 February 2015 at 13:00:39 UTC, John Colvin wrote:
>
> I agree. Wrap it in a mixin / mixin template?
>
> Why do you need this? Presumably it'll be hidden in the depths 
> of some library / bindings where beauty is somewhat optional? 
> Using the .mangleof from an extern(D) function should mean it's 
> robust.

Well the use case is creating a function which sole purpose it is 
to create a function pointer from it and pass it to C++. If it 
recieves C++ mangling however I have to pay attention that it 
does not conflict with any other C++ symbols. The same goes for 
extern(C). Sometimes you want to create functions with a C 
calling convetion so you can create a function pointer from it. 
With extern(C) its even a bigger problem because the C mangling 
conflicts a lot easier.


More information about the Digitalmars-d-learn mailing list