on Tue Aug 19 2008, Daniel Krügler
An operator== that applied for only one of many overloads would be an abomination, especially if the class were empty.
Right, if the class is empty, all operator() overloads are stateless,
What about random number generators (or anything else that uses global state?)
but this is not necessarily the case, if at least one of them is statefull (and therefore the complete class type is not empty). There are still good chances, that some (or even all) of them are still stateless (because they are not influenced by that state).
Or to express the problem in different words: In general there exists a one-to-many relation between a class type and it's operator() overloads [acting as predicates], so the class-type alone is not sufficient to define an equality of *one* special operator() overload, which we are interested in. Therefore the predicate equality needs to be restricted to a given predicate (a given operator() overload).
I think you're over-engineering this. It's not unreasonable to require operator== to make sense in this context. -- Dave Abrahams BoostPro Computing http://www.boostpro.com