Revised RFC on range design for D2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Sep 28 21:16:12 PDT 2008


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)


Andrei


More information about the Digitalmars-d-announce mailing list