plans for interfacing to C++
Trass3r
un at known.com
Tue Jan 10 04:15:42 PST 2012
On Tuesday, 10 January 2012 at 12:09:14 UTC, Michel Fortin wrote:
> Another idea which would be much less verbose:
>
> extern(C++, gccmangle)
> void foo();
>
> Here, gccmangle is a CTFE-capable function that'd be called
> like this:
>
> gccmangle("foo");
>
> So if you need a namespace argument, just add one:
>
> extern(C++, gccmangle, "bar::baz")
> void foo();
>
> which would call the function like this to get the mangled name:
>
> gccmangle("foo","bar::baz");
>
> The syntax doesn't sound quite right to me, hopefully someone
> can make it better.
At least you could use extern(...) : and extern(...) {} this way.
More information about the Digitalmars-d
mailing list