digitalmars.D.learn - Fully qualified name of an identifier as a compile-time string
- =?ISO-8859-1?Q?Adam_Cig=E1nek?= (5/5) Oct 27 2010 Hello,
- Nick Sabalausky (5/9) Oct 28 2010 You could try 'identifier.stringof'. But I don't know if that'll give yo...
- =?ISO-8859-2?Q?Adam_Cig=E1nek?= (2/5) Oct 28 2010 Thanks, but stringof gives unqualified name as well. Are foo.stringof
- Philippe Sigaud (7/7) Oct 28 2010 Hello,
Hello, Is there a way to get a fully qualified name of an identifier as a string during compile time? __traits(identifier) returns only unqualified name. adam.
Oct 27 2010
"Adam Cigánek" <adam.ciganek gmail.com> wrote in message news:mailman.12.1288206056.21107.digitalmars-d-learn puremagic.com...Hello, Is there a way to get a fully qualified name of an identifier as a string during compile time? __traits(identifier) returns only unqualified name.You could try 'identifier.stringof'. But I don't know if that'll give you what you want, and .stringof does have a history of being buggy, poorly-defined, and frequently changing.
Oct 28 2010
You could try 'identifier.stringof'. But I don't know if that'll give you what you want, and .stringof does have a history of being buggy, poorly-defined, and frequently changing.Thanks, but stringof gives unqualified name as well. Are foo.stringof and __traits(identifier, foo) the same thing?
Oct 28 2010
Hello, you could try core.demangle.demangle(identifier.mangleof) the .mangleof gives access to the qualified name and demangle preserves it. IIRC there are now two demanglers in Phobos, one in std.demangle, that will be deprecated and another one in core.* Sorry not to be more precise, I don't have access to Phobos/DMD right now. Philippe
Oct 28 2010