in reply to Re2: Pair of items in thread Pair of items
I agree that it's awfully simplistic, but there are occasions, like bioinformatics, which might use a routine like this in some capacity. I've just given two different versions for comparision and discussion/argument and whatnot.
I'd go for the hash based approach.
However, even a function that's intentionally crippled like that can be made "safe" by naming it something like compare_triplets or what have you. You'd have to be pretty daring to feed a function like that anything but what's expected, though of course, even this precaution may not protect you from the inevitable.
|