Jonathan Wakely wrote:
On 7 October 2013 14:34, Julian Gonggrijp wrote:
Of course a programmer can avoid the problem by doing the right thing. That's not what my paragraph above was about. As I stated in the follow-up, the same reasoning applies to the rtp pointers.
Does it? How do I tell if an rtp::weak_ptr is dangling or not?
You seem to be claiming that because sloppy programmers can forget to check a std::weak_ptr for validity that it's no safer than a type that doesn't even support such checking for validity. [...]
I'm not.
Please note that I'm not disputing that reference counting has a clear advantage to single ownership in cases like these. I'm just saying that dangling or expired pointers can still be a pitfall despite that advantage.
-Julian