Why are you using `std.traits.fullyQualifiedName`?

Atila Neves atila.neves at gmail.com
Sun Jan 22 15:36:29 UTC 2023


On Friday, 20 January 2023 at 23:14:39 UTC, Dennis wrote:
> There's a Pull Request to turn Phobos' 
> `std.traits.fullyQualifiedName` into a trait 
> `__traits(fullyQualifedName)`. Because Phobos' implementation 
> expands a lot of templates, the idea is to reduce compile times 
> by implementing it in the compiler instead. However, there's 
> some discussion around it, because Adam Ruppe considers it a 
> function that shouldn't be used, because it's poorly defined 
> and is prone to mistakenly be used for meta programming.
>
>> I've never - not once - seen a case where people said FQN was 
>> necessary where they were actually correct about it. It is a 
>> misfeature that encourages bad code.
>
> Hence the question in the title:
> Are you using `std.traits.fullyQualifiedName`, and if so, what 
> do you use it for?
>
> Relevant links:
> https://github.com/dlang/dmd/pull/14711#issuecomment-1396290841
> https://github.com/dlang/dlang.org/pull/3495#issuecomment-1396295627

I use it all the time, especially since I do so much with 
reflection. I need a unique name for types to store, to show to 
the user when something goes wrong, to avoid name clash issues 
due to imports in generated code, ...

Atila


More information about the Digitalmars-d mailing list