December 02, 2006 [COMSTL; Adi's report] Implicit conversion operator for interface_ptr / ref_ptr | ||||
---|---|---|---|---|
| ||||
> <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
|
December 05, 2006 Re: [COMSTL; Adi's report] Implicit conversion operator for interface_ptr / ref_ptr | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | 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
>
>
>
|
Copyright © 1999-2021 by the D Language Foundation