digitalmars.D.learn - __traits(moduleName)?
- Nick Sabalausky (2/2) Sep 08 2010 Is there some way, maybe with __traits, to get the name of the current
- Nick Sabalausky (15/17) Sep 08 2010 I don't know if there's an easier/better way, but this seems to work:
- bearophile (5/7) Sep 08 2010 See request:
Is there some way, maybe with __traits, to get the name of the current module?
Sep 08 2010
"Nick Sabalausky" <a a.a> wrote in message news:i67for$gr1$1 digitalmars.com...Is there some way, maybe with __traits, to get the name of the current module?I don't know if there's an easier/better way, but this seems to work: module someModuleName; import std.demangle; import std.stdio; import std.traits; private int _getModuleName_dummy_; void main() { auto moduleName = demangle( mangledName!_getModuleName_dummy_ ) ["int ".length .. $-1-_getModuleName_dummy_.stringof.length]; writeln(moduleName); }
Sep 08 2010
Nick Sabalausky:Is there some way, maybe with __traits, to get the name of the current module?See request: http://d.puremagic.com/issues/show_bug.cgi?id=4476 Bye, bearophile
Sep 08 2010