c++.stlsoft - [COMSTL; Adi's report] Implicit conversion operator for interface_ptr / ref_ptr
- "Matthew" <matthew hat.stlsoft.dot.org> Dec 02 2006
- Adi Shavit <adish gentech.co.il> Dec 05 2006
<heresy alert!> 3. Maybe allow automatic conversion to the underlying pointer type? Passing x.get_interface_ptr() to functions is ugly typing </heresy alert!>
Definitely not. There are better ways. FYI: At a simple level, switching to ref_ptr will buy you a drop from x.get_interface_ptr() to x.get() Naturally, there are many cases where we'll be able to be a bit cleverer and get away from even having to do this. I'll be working on this a lot over the next week or so. I can get a long way with what you've already submitted, but it'd be helpful if you can give me a code sample for each case. Cheers Matthew
Dec 02 2006
Hi Mathew, I knew you'd say that ;-). But get() /is/ nicer. Adi Matthew wrote:<heresy alert!> 3. Maybe allow automatic conversion to the underlying pointer type? Passing x.get_interface_ptr() to functions is ugly typing </heresy alert!>
Definitely not. There are better ways. FYI: At a simple level, switching to ref_ptr will buy you a drop from x.get_interface_ptr() to x.get() Naturally, there are many cases where we'll be able to be a bit cleverer and get away from even having to do this. I'll be working on this a lot over the next week or so. I can get a long way with what you've already submitted, but it'd be helpful if you can give me a code sample for each case. Cheers Matthew
Dec 05 2006








Adi Shavit <adish gentech.co.il>