Re: get module name of function

2019-03-30 Thread Alex via Digitalmars-d-learn
On Saturday, 30 March 2019 at 05:08:48 UTC, Alex wrote: How do I get the module name that a function is defined in? There is https://dlang.org/library/std/traits/module_name.html I have a generic template that auto Do(T)() { pragma(msg, moduleName!T); } in a module This is strange,

get module name of function

2019-03-29 Thread Alex via Digitalmars-d-learn
How do I get the module name that a function is defined in? I have a generic template that auto Do(T)() { pragma(msg, moduleName!T); } in a module and in another module I define a function void foo() { } and a class class C { } and call Do!(typeof(foo)) and Do!(C) but it fails for