The issue is that converting a raw pointer to a smart pointer under uncontrolled conditions can be dangerous. Remember that once a pointer is placed into a smart pointer the smart pointer system now "owns" the pointer and is responsible for its life time. If it was easy to do the conversion, then it would be easy to convert a raw pointer multiple times to a smart pointer (and eventually each conversion will lead to a delete of the value), place a pointer into a smart pointer that something else is controlling the lifetime, or even put a non-heap value into a smart pointer. Safe guidelines would suggest that the pointer be moved directly from the new call into the smart pointer, and making that operation an explicit reset call makes it easier to search your code and check those occurrences to make sure you did it right. Richard Damon -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Alessandro Re Sent: Monday, September 10, 2007 1:14 PM To: boost-users@lists.boost.org Subject: [Boost-users] Smart pointers operator= Hi, can please someone explain me why in boost's smart pointers (and also in auto_ptr, if there is a reason), there is no operator=(T *)? Shouldn't it work like reset()? Thanks -- ~Ale _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users