Getting only the data members of a type

Jacob Carlborg doob at me.com
Sun Apr 1 05:10:33 PDT 2012


On 2012-04-01 11:27, Artur Skawina wrote:

> That's because the compiler won't accept "foreach (i, t; S.tupleof)" and
> "*.tupleof[i].stringof" is necessary to get the original name. This would
> have worked too:
>
>        enum name = *s.tupleof[i].stringof[4..$];
>
> but obfuscates the code more and looks like dereferencing a null pointer.
>
> artur

But it accepts "foreach (i, t; typeof(S.tupleof))".

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list