Ross MacGregor wrote
"Johan RĂ¥de" <
rade@.lth
> wrote in message news:ft10ag$6nn$
1@.gmane
...
I know it is an insane idea to suggest changing the entire boost::smart_ptr library to a boost::smart_ref library, but I think it may actually be the right thing to do. Does anyone agree?
I also find the nill state of shared_ptr to be a liability when designing interfaces. The primary purpose of shared_ptr when used in an interface context is to convey ownership, and almost always it feels wrong to also provide simultaneously an option to convey ownership of nothing. The poor user is left with the responsibility of testing every shared_ptr he has received for null state before using it, but its easy to forget and the compiler provides no assistance. Ultimately, the library interface based on shared_ptr is more error prone, less likely to be easy to use, and therefore arguably suboptimal. Of course no one suggests that shared_ptr should (or could) be changed in ways that impacts backwards compatibility, but I have to agree with the author of the post that this issue can be identified as a legitimate cause for concern. Jeff -- View this message in context: http://boost.2283326.n4.nabble.com/Why-no-non-null-smart-pointers-tp2642959p... Sent from the Boost - Dev mailing list archive at Nabble.com.