Revised RFC on range design for D2

Bill Baxter wbaxter at gmail.com
Sun Sep 28 21:54:44 PDT 2008


On Mon, Sep 29, 2008 at 1:16 PM, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> Bill Baxter wrote:
>>
>> On Mon, Sep 29, 2008 at 12:53 PM, Andrei Alexandrescu
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>>
>>> Bill Baxter wrote:
>>>>
>>>> Basically there's no convenient way to take the address of one of a
>>>> getter/setter function pair, currently.  I think that should factor in
>>>> the solution here.
>>>
>>> Overloading is the issue, and that's quite a different story.
>>
>> It's a different, but intertwined story.
>>
>>> If you know
>>> the exact type, you can take the address of something.
>>>
>>> struct S
>>> {
>>>   int foo() {}
>>>   void foo(int) {}
>>> }
>>>
>>> void main()
>>> {
>>>   S s;
>>>   void delegate(int) x = &s.foo;
>>>   int delegate() y = &s.foo;
>>> }
>>
>> Having to write out "delegate(argumenttype) doesn't qualify as
>> "convenient" in my book.
>
> You first used "can't". That doesn't qualify as "can" in my book :o). The
> "can't" made me honestly think you didn't know about the ability to take the
> address of an overloaded function/method into a specifically-typed function
> or delegate respectively. One more instance of the proverbial no good deed
> that goes unpunished... :o)

Yeh, sorry about that.  I vaguely remembered that there was some way
to do it, but that it wasn't something I would want to be forced to
use whenever I wanted to get a delegate pointer.

--bb


More information about the Digitalmars-d-announce mailing list