operator== of C++ classes

in Help Center
in the documentation's section C++ mapping for classes, it says
operator==
operator!=
operator<
operator<=
operator>
operator>=
The comparison operators permit you to use classes as elements of STL sorted containers. Note that sort order is based on the data members of the class, as for structures (see Section 6.12).
But when I tried to use it and looked into the source code, it turns out the current implementation merely conpairs the two pointers.
My question is, is it going to be implemented in the future or was it an old feature and won't be there any more? I just happen to need this now and it seems impossible to get around the problem except to write my own member-wise comparison code.
operator==
operator!=
operator<
operator<=
operator>
operator>=
The comparison operators permit you to use classes as elements of STL sorted containers. Note that sort order is based on the data members of the class, as for structures (see Section 6.12).
But when I tried to use it and looked into the source code, it turns out the current implementation merely conpairs the two pointers.
My question is, is it going to be implemented in the future or was it an old feature and won't be there any more? I just happen to need this now and it seems impossible to get around the problem except to write my own member-wise comparison code.
0
Comments
Have a look at http://www.zeroc.com/doc/Ice-3.2.0/manual/Cpp.7.14.html (last sub-chapter):
That's a bug in the manual. The paragraph I cited above is the correct one. Slice classes have reference semantics, not value semantics, therefore it compares instances, not values. See also this thread for a similar discussion.
I guess you should remove the == operator that takes two references (if that's easy to do). The paragraph you referenced above only talks about class handle compison, and that's intuitive to understand given that it's name is smart POINTER. What i did is
class A {...};
int main()
{
APtr a = new A;
APtr b = new A(a);
cout<< (*a==*b); <--
}