Annoyance with function template unwrapping

solidstate1991 laszloszeremi at outlook.com
Sat Jan 16 23:53:11 UTC 2021


On Saturday, 16 January 2021 at 23:19:41 UTC, Basile B. wrote:
> or the same but "meta-programmatically"
>
>   void f(ubyte b)(float f) { }
>   void f(ubyte b)(int i) { }
>   static foreach (o; __traits(getOverloads, mixin(__MODULE__), 
> "func", true))
>     alias func = o!5;
>
> which allows to use a single ident for all the template func, 
> although the overload set must be named differently.

This one didn't work for me, since it couldn't find the function 
once I tried to use them from an external package.


More information about the Digitalmars-d mailing list