Exporting template function instances to C
data pulverizer via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Mar 23 10:29:22 PDT 2017
On Thursday, 23 March 2017 at 16:38:02 UTC, Adam D. Ruppe wrote:
> On Thursday, 23 March 2017 at 16:28:18 UTC, data pulverizer
> wrote:
>> alias mult!double dmult;
>> alias mult!float fmult;
>
> Those are just aliases in the D compiler, they don't actually
> exist in the object file for C to use like regular functions.
>
> Templates need to actually be *used* to be instantiated for
> export, and aliases make them easier to use, but don't actually
> use them yet.
>> Why is that?
Thanks. Is there a less ham-handed way of exporting them other
than wrapping them in functions as I have?
More information about the Digitalmars-d-learn
mailing list