id summary reporter owner description type status milestone component version severity resolution keywords cc 1444 scoped_ptr::operator== should be equivalent to a.get()==b.get(), but is currently !!a==!!b Geoffrey Irving Peter Dimov "scoped_ptr does not define an explicit operator==, so an equality test between two of them falls back to using the implicit conversion to bool. Here's a program illustrating the bug: {{{ #include int main() { boost::scoped_ptr a1(new int),a2(new int); BOOST_ASSERT(a1!=a2); // fails BOOST_ASSERT(!(a1==a2)); // fails } }}} This is a significant bug, since it results in silent failures when converting programs using normal pointers to scoped_ptr. Adding definitions for operator== and operator!= fixes the problem: {{{ template inline bool operator==(const scoped_ptr& p, const scoped_ptr& q) { return p.get()==q.get(); } template inline bool operator!=(const scoped_ptr& p, const scoped_ptr& q) { return p.get()!=q.get(); } }}} I verified that the comparison operators (e.g., <), do not compile, which is fine." Bugs closed To Be Determined smart_ptr Boost 1.47.0 Problem fixed p.brockamp@…