Metaprogramming get type and field at compile time

bioinfornatics via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Oct 27 16:45:47 PDT 2015


On Tuesday, 27 October 2015 at 22:53:35 UTC, Ali Çehreli wrote:
> On 10/27/2015 03:34 PM, bioinfornatics wrote:
>
> > I use FieldTypeTuple and FieldNameTuple to get type and
> correponding
> > field name but I fail to loop over these tuple.
>
> You can use the .tupleof property and a compile-time foreach:
>
>   http://dlang.org/class.html (Search for .tuplof on that page)
>
>   http://ddili.org/ders/d.en/tuples.html#ix_tuples..tupleof
>
>   
> http://ddili.org/ders/d.en/tuples.html#ix_tuples.compile-time%20foreach
>
> Ali

  wow Nice without traits
thanks Ali for your amazing work

best regards


More information about the Digitalmars-d-learn mailing list