Exporting template function instances to C
data pulverizer via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Mar 23 12:46:43 PDT 2017
On Thursday, 23 March 2017 at 17:58:21 UTC, H. S. Teoh wrote:
> On Thu, Mar 23, 2017 at 05:29:22PM +0000, data pulverizer via
>>
>> Thanks. Is there a less ham-handed way of exporting them other
>> than wrapping them in functions as I have?
>
> Wrapping them in functions is probably the simplest way to call
> them from C. You *could*, I suppose, use their mangled names
> directly, then you wouldn't need a wrapper, but that would be
> rather difficult to use on the C end. On the D side, there's
> .mangleof that will tell you what mangled names to use, but if
> you're calling from C you don't have that luxury.
>
>
> T
Thanks. Mangling sounds painful and scary, I think I'll stick to
wrapping which sounds much less dangerous.
More information about the Digitalmars-d-learn
mailing list