On 02-10-2013 13:40, Andrey Semashev wrote:
On Wed, Oct 2, 2013 at 2:54 AM, Luke Bradford
wrote: Hi,
I'm new to this list, so apologies for any oversights or faux pas.
I've been finding a lot of use for a type of smart pointer I call shared_ptr_nonnull, which is a variation on shared_ptr which is never allowed to be empty. Specifically:
Anyway, I think, such a pointer does not behave like a real pointer, so it shouldn't be called as such. It looks more like a reference, except that the referred object is accessed through operator->. Maybe it should be called shared_ref because of it.
I'm inclined to think that template< class T > class shared_obj; with use like shared_obj<Foo> sharedFoo = make_shared_obj( 42, "foo" ); would be good names. -Thorsten