On Fri, Sep 05, 2008 at 02:28:39PM -0500, Annamalai Gurusami wrote:
On Fri, Sep 5, 2008 at 12:47 PM, Reena Dass
wrote: Is there something available to compare objects using boost, similar to java.lang.Object Equals?
I think this question is better directed at C++ groups (like comp.lang.c++.moderated). From your question it is not clear what exactly you are looking for.
My guess: Java has single object hierarchy with Object at the root. So, all object instances are in a sense "comparable" (yes, it is allowed to compare Apples and Oranges, and, depending on the definition of Equals in derived classes, you might end up with an Apple being equal to an Orange). You can have the same behavior in C++ by using multiple inheritance to derive all your objects from Comparable: struct Comparable { virtual bool equals(const Comparable&) const = 0; };