Identifier hierarchy

Luís Marques luis at luismarques.eu
Mon Jun 11 12:38:33 UTC 2018


Just to check. If you have a piece of code like "foo.bar.baz", 
you can get the full hierarchy, for instance with stringof:


      static assert(foo.bar.baz.stringof == "foo.bar.bar");

But once you pass foo.bar.baz to a template, there's no way to 
recover the full path, is there? You only get baz. You can ask 
for the __traits(parent, baz), but you only get the type of bar, 
not the identifier.

Assuming you pass the foo.bar.baz normally (alias arg) to the 
template (not as a string, for instance), there's no workaround 
for this, is there?


More information about the Digitalmars-d mailing list