I'm just trying to see if a shared_ptr is pointing to a certain object, but the equality isn't working as I expected.
It's basically like this:
Object boost::shared_pyr< Object > selObj = boost::make_shared< Object > (obj);
if( selObj == boost::make_shared< Object > (obj) )
{
}
I would have expected it to evaluate to true, but it doesn't.
Am I right in thinking that this means the == operator is not actually comparing the addresses being pointed to, but instead it's the make_shared objects, which are technically different instances in each case? That also seems somewhat strange to me if that's the case.
Either way, how should this be done? I want to see if they refer to the same Object, and definitely don't want to compare the Object's themselves for equality but make sure it only returns true if it's referring to the exact same instance.
(Not using std::shared_ptr because of my old compiler/computer, but I assume it probably works the same way as far as this is concerned anyway)