get literal symbol name without base class/struct as string

Timoses timosesu at gmail.com
Thu Apr 19 16:07:50 UTC 2018


On Tuesday, 17 April 2018 at 21:45:45 UTC, Dr.No wrote:
> give structs like this:
>
> struct A
> {
> 	int a = 10;
> 	string s = "haha";
> }
>
> struct B
> {
> 	A aDetails;
> }
>
> but neither fullyQualifiedName nor stringof give the symbol in 
> the way I need.

I'd hint you towards

import std.traits;
pragma(msg, FieldNameTuple!B);
pragma(msg, FieldNameTuple!(Fields!B[0]));


More information about the Digitalmars-d-learn mailing list