foreach (x; a .. b) and foreach_reverse (x; a .. b) should be

bearophile bearophileHUGS at lycos.com
Mon May 18 08:14:25 PDT 2009


Jason House:
>how do you test for an associative array of string types indexes by a numerical type while exposing a type alias for the index type?<

When I use my dlibs in D1 to solve a problem like that I use:

static if (IsAA!(T1) && IsNumeric!(KeyType!(T1))) {
    alias KeyType!(T1) Tkey;
    ...
}

Easy and not not much error prone. I have had no need to look into the docs.

Bye,
bearophile



More information about the Digitalmars-d mailing list