On 05-10-2013 12:18, Rob Stewart wrote:
On Oct 4, 2013, at 1:38 PM, Matt Calabrese
wrote:
I'll repeat my basic, underlying stance here for people to agree/disagree with. A non-null shared_ptr should be exactly that. It should have the same or extremely similar interface to a shared_ptr (including things like bool-conversion), just with more strict invariants and preconditions. This makes drop-in replacement and use in generic functions easier to deal with and also avoids sacrificing additional functionality that shared_ptr provides. People shouldn't have to avoid switching to a non-null shared pointer simply because they have no way of constructing it with a pointer that they obtained from a factory.
If the idea is to be 100% shared_ptr interface compatible, it may be
easier just to extend boost::shared_ptr a little:
typedef boost::shared_ptr