My Kingdom For ...

Janice Caron caron800 at googlemail.com
Thu Feb 21 07:38:00 PST 2008


On 21/02/2008, Michiel Helvensteijn <nomail at please.com> wrote:
> It's silly that 'in' does not return a bool.

Huh? But I don't want it to return a bool. If it retured a bool, I
wouldn't be able to do

    auto p = key in aa;
    if (p is null)
    {
        /* do something */
    }
    else
    {
        return *p;
    }

Without that ability, you'd have to do a double-lookup!



More information about the Digitalmars-d mailing list