10 Jul
2007
10 Jul
'07
11:36 a.m.
Hi, guys! I found embarrassing difference between shared_ptr::operator*() and intrusive_ptr::operator*() behavior (even the same I can say about operator ->). At first, look on shared_ptr: reference operator* () const // never throws { BOOST_ASSERT(px != 0); return *px; } If shared_ptr object has NULL value and someone call operator*(), it will throws exception. But if we look on intrusive_ptr(): T & operator*() const { return *p_; } we can see, that pointer don't checks.... Is it an imperfection or a feature?