A function that takes a borrowed pointer &T can also be called with an owning pointer ~T, an RC pointer Rc<T>, or a GC pointer Gc<T>. They all convert neatly to a &T. One function to rule them ... err .. accomodate all.No. That would be nice to have, but it's actually not the case. The only type that automatically coerces to a borrowed reference is an owned pointer. For value references you fist have to create a borrowes ref through &val. For Gc and Rc you have to pass something like ptr.borrow().borrow_mut ().borrow()
- Re: Smart pointers instead of GC? Frank Bauer
- Re: Smart pointers instead of GC? Frank Bauer
- Re: Smart pointers instead of GC? Walter Bright
- Re: Smart pointers instead of GC? Frank Bauer
- Re: Smart pointers instead of GC? Frank Bauer
- Re: Smart pointers instead of GC? Frank Bauer
- Re: Smart pointers instead of GC? Andrei Alexandrescu
- Re: Smart pointers instead of GC? Adam D. Ruppe
- Re: Smart pointers instead of GC? Matthias Einwag
- Re: Smart pointers instead of GC? Meta
- Re: Smart pointers instead of GC? Matthias Einwag
- Re: Smart pointers instead of GC? Andrei Alexandrescu
- Re: Smart pointers instead of GC? Shammah Chancellor
- Re: Smart pointers instead of GC? Namespace
- Re: Smart pointers instead of GC? Shammah Chancellor
- Re: Smart pointers instead of GC? Andrej Mitrovic
- Re: Smart pointers instead of GC? Timon Gehr
- Re: Smart pointers instead of GC? Timon Gehr
- Re: Smart pointers instead of GC? Walter Bright
- Re: Smart pointers instead of GC? Andrei Alexandrescu
- Re: Smart pointers instead of GC? Andrei Alexandrescu
