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

Salih Dincer salihdb at hotmail.com
Sat Jan 21 00:48:01 UTC 2023


On Friday, 20 January 2023 at 23:14:39 UTC, Dennis wrote:
> 
> Are you using `std.traits.fullyQualifiedName`, and if so, what 
> do you use it for?

You are talking about 
[this](https://dlang.org/phobos/std_traits.html#fullyQualifiedName

I DO not use...

__traits and typeid with integrated properties are enough for me:

```d
class S
{
     short n;
     alias n this;
     this(short n) { this.n = n; }
}

void print(alias T)()
{
     import std.stdio : writeln;
     TypeInfo name = typeid(T);
              name.writeln;

     import std.traits : fullyQualifiedName;
     
     fullyQualifiedName!T.writeln;
     T test = [ new S(41), new S(42) ];
     __traits(getPointerBitmap, S).writeln(": ", test);
}

void main() {
     alias arrS = const S[];
     print!arrS;

     class S { short s; }
     auto test = new S;

     assert(__traits(getPointerBitmap, S) == [32, 8]);
     assert(is(
         typeof(S.s) == short)
     );
} /*
const(const(onlineapp.S)[])
const(onlineapp.S[])
[18, 0]: [const(onlineapp.S), const(onlineapp.S)] //*/
```

SDB at 79


More information about the Digitalmars-d mailing list