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

Salih Dincer salihdb at hotmail.com
Sat Jan 21 01:43:42 UTC 2023


On Saturday, 21 January 2023 at 00:48:01 UTC, Salih Dincer wrote:
> __traits and typeid with integrated properties are enough for 
> me:

Oh, there's also this (Ha bir de bu var in Turkish) :
```d
struct Str
{
   alias ToString this;
   size_t s;
   string ToString() const
   {
     import std.conv : text;
     return text(s);
   }
}
     
enum Params { width = 100 }
auto String = Str(Params.width);
import std.conv;

void main()
{
   string[] data;
   data ~= __traits(identifier, String);
   data ~= typeof(String).stringof;
   data ~= String;
   data ~= Params.width.to!string;
   data.writeln; // ["String", "Str", "100", "width"]
}
```

D gives me everything to create a big world (Dig Big!).  Thanks: 
D!

SDB at 79




More information about the Digitalmars-d mailing list