retrieving key and value type of an associative array (D1)

Funog funog at ifrance.com
Thu Feb 24 05:05:27 PST 2011


Le 24/02/2011 13:17, bearophile a écrit :
> Funog:
>
>> Thanks ^^ But I actually asked my question wrong ; I also need to check
>> whether abc is an associative array or not.
>
> Adapted from the module tango.core.Traits:
>
> template IsAA(T) {
>      const bool IsAA = is( typeof(T.init.values[0])[typeof(T.init.keys[0])] == T );
> }
>
> Bye,
> bearophile


Thanks!


More information about the Digitalmars-d-learn mailing list