Suggestions for multiple class members with the same name

BCS ao at pathlink.com
Tue Aug 12 10:03:49 PDT 2008


Reply to Jarrett,

> "BCS" <ao at pathlink.com> wrote in message
> 
>> ouch!
>> 
>> better solution
>> 
>> &A.a(char[])
>> &A.a(int)
> cast(uint function(char[]))&A.a
> 
> already works, but is terribly unwieldy, I'll agree.
> 

template FnWithThese(T...)
{
     R function(T) Args(R)(R function(T) fn){return fn;}
     R delegate(T) Args(R)(R delegate(T) fn){return fn;}
}

FnWithThese!(char[]).Args(&A.a)

(untested)

At least that's clearer what it's doing





More information about the Digitalmars-d mailing list