News for hackers. Stuff that matters.
Re:Rule of Zero (C++) by rmartinho on Friday November 23, 2012 @10:44AM (#4822525)
> often can't be used because objects need to be passed by reference to libraries that use regular-old-pointers.

I don't understand what you mean by this. If you have a `smart_ptr<T> p;` nothing prevents you from passing `*p` or `p.get()` to some legacy interface. You only have trouble if that legacy interface wants to claim ownership of the object.

Re:Rule of Zero (C++) by ben0x539 on Friday November 23, 2012 @01:11PM (#4823086)
I think the issue is that the typedef is intended to hide the smartptrness so it's not obvious what the API for getting an old-style pointer is, or whether getting an old-style pointer is even part of the intended public interface anymore (beyond p.operator->() anyway ;)
Re:Rule of Zero (C++) by radarsat1 on Friday November 23, 2012 @10:45PM (#4824463)
> You only have trouble if that legacy interface wants to claim ownership of the object.

That's exactly what I mean. This happens. My point is just that even the best intentions are easily subverted in a real-world scenario where you didn't write the whole codebase yourself from scratch.