That further simplifies everything, thankyou! :)
> Hmm -- so I guess, in the cases I'm talking about, I should store aNote that it might be rather dangerous, if your caller would store
> shared_ptr, and just return a const refererence.
such a const reference.
Returning weak_ptr usually doesn't make sense (except for the case
> Then, if I need to have a copy of the member elsewhere to manipulate, I
> could return a weak_ptr.
where you return it for tracking only). Note that shared_ptr is
implicitly convertible to weak_ptr, so typically you return
shared_ptr, and let the caller to decide what to do with it: if the
caller indends to store it, but doesn't want strong referencing, it
stores it as weak_ptr.
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users