Get AA key and value type

ponce via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Sep 19 05:52:17 PDT 2015


On Saturday, 19 September 2015 at 12:50:51 UTC, Pierre wrote:
> So how can I get types without instance ?
> Thanks for help.

---------->8---------

template AATypes(T)
{
   // todo: static assert if T is no AA type here

   alias ArrayElementType!(typeof(T.init.keys)) key;
   alias ArrayElementType!(typeof(T.init.values)) value;
}


---------->8---------


Should work.


More information about the Digitalmars-d-learn mailing list