Is there any better way to write the method than:
(cmp doesn't seem to work, and byte arrays don't have an opCmp method.)

 int opCmp(ref const B24 b) const
{    for    (int i = 0;    i < 24;    i++)
      {    if    (bytes[i] < b.bytes[i])    return    -1;
            if    (bytes[i] > b.bytes[i])    return    1;
       }
       return    0;
}    //    opCmp

FWIW, the key is a fixed length array of ubyte, but similar structs have differing lengths. If it's not supported by the system I don't want to do something like casting the pieces to ulongs and comparing those rather than the bytes. The added complexity isn't worth it.

--
Charles Hixson

Reply via email to