on Mon Aug 18 2008, Daniel Krügler
David Abrahams wrote:
I suggest requiring that the predicates themselves be equality comparable, and that equal predicates perform the same computation. Containers with unequal predicates would not be considered equal.
Yes, this proposed resolution has also be given by Pablo Halpern in a different mailing channnel. I totally agree that some tagging technique (or concepts in C++0x) would be good idea.
I don't see what tagging has to do with my suggestion, and concepts are certainly not applicable because we're discussing runtime tests.
I had some resistance concerning requiring EqualityComparable for non-empty predicates (This was his very nice idea: Distinguish empty from non-empty predicates and require EqualityComparable only for non-empty ones),
That's not a bad idea.
because I thought it would be too intrusive. Maybe I was to strict in my position. The reason for my resistance is that in several scenarios an object type with overloaded operator() has *more* than one operator() overload and by requiring operator== this would have the effect that we don't know, for *which* overload of operator() this EqualityComparable concept would apply.
An operator== that applied for only one of many overloads would be an abomination, especially if the class were empty. -- Dave Abrahams BoostPro Computing http://www.boostpro.com