Get AA key and value type

Pierre via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Sep 19 06:07:17 PDT 2015


On Saturday, 19 September 2015 at 12:52:19 UTC, ponce wrote:
> 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.

You're right it's OK now.
Thank you.


More information about the Digitalmars-d-learn mailing list