[phobos] hasMember + opDispatch + Uniform Function Call Syntax

Philippe Sigaud philippe.sigaud at gmail.com
Sat Sep 18 13:36:52 PDT 2010


I just discovered that someStruct.someMethod and
someStruct.opDispatch!("someMethod") don't have the same type. Strange.

struct S
{
    int ii;
    int foo(int i) { return ii;}
    int opDispatch(string s)(int i) { return ii;}
}

void main()
{
    writeln(typeof(&S.foo).stringof);  // int function(int)
    writeln(typeof(&S.bar).stringof); // int delegate(int)
}

Anyone knows why?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20100918/7da9a505/attachment.html>


More information about the phobos mailing list