Henry Spencer <henry@zoo.toronto.edu> wrote:>I heard an interesting rule of thumb recently -- although my leaky>memory is now refusing to tell me who said it -- to the effect that>operator overloading works very well so long as the data objects are>*numbers* of some sort, or very close analogs of numbers, and very>poorly otherwise. I think there's a lot of truth in that.

Yes and no. I have used them very successfully on objects that were
entirely non-numeric. But I am a pure mathematician by background,
and the objects I was operating on formed a ring (with a few slightly
odd extensions). I think that the real criterion is that they must be
the sort of object that can be handled by conventional axiomatic
mathematics and its standard notation.

They certainly work very well for matrices, under some circumstances
(the main one being that storage management problems are not an
issue).