I just revisited the Boost shared_ptr docs. boost::shared_ptr::operator==() does exist and compares the raw pointers as you would expect. The behaviour you are seeing in QVariant is a limitation of the QVariant::operator==() : "In the case of custom types, their equalness operators are not called. Instead the values' addresses are compared." You may be stuck with manually extracting the two shared_ptrs and using them directly in the equality test.
Bookmarks