How to specify an exact template?

Tove tove at fransson.se
Sat Jan 16 17:09:23 UTC 2021


On Saturday, 16 January 2021 at 15:41:38 UTC, solidstate1991 
wrote:
> On Saturday, 16 January 2021 at 14:18:55 UTC, Tove wrote:
>> probably you can use 
>> https://dlang.org/spec/traits.html#getOverloads
>
> I don't know how to use it with functions outside of 
> structs/classes.

void foo() {}
void foo(string i) {}

static foreach(overload; __traits(getOverloads, 
mixin(__MODULE__), "foo"))
     pragma(msg, typeof(overload));


More information about the Digitalmars-d-learn mailing list