What is the proper way to define the "in" operation in D2? I can't figure it out from http://www.digitalmars.com/d/2.0/operatoroverloading.html#Binary , and the source code doesn't seem to have any examples.

My current (untested) find method is:
bool    find (Key k, Node!(Key, Data) t)
{       if      (level == 0)    return  false;
        if      (k < t.key)  return  find (k, t.left);
        if (t.key < k)       return  find (k, t.right);
        return  true;
}

but I'd really rather have it be an "in" method.

Reply via email to