retrieving key and value type of an associative array (D1)
Funog
funog at ifrance.com
Thu Feb 24 03:03:43 PST 2011
Le 23/02/2011 18:36, bearophile a écrit :
> Funog:
>
>> In the case of an associative array, is it possible to retrieve both the
>> value and key type? (D1)
>
> template AAKeyType(T) {
> alias typeof(T.keys[0]) AAKeyType;
> }
>
> template AAValType(T) {
> alias typeof(T.values[0]) AAValType;
> }
>
> Bye,
> bearophile
Thanks ^^ But I actually asked my question wrong ; I also need to check
whether abc is an associative array or not.
More information about the Digitalmars-d-learn
mailing list