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

bearophile bearophileHUGS at lycos.com
Wed Feb 23 09:36:37 PST 2011


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


More information about the Digitalmars-d-learn mailing list