opDispatch and template parameters

2010-09-08 Thread Guillaume B.
Hi, Is this usage of opDispatch supposed to work: module test.d; import std.stdio; struct DispatchTest { void opDispatch(string name, string otherName)() { writeln(name, ":", otherName); } } void main() { DispatchTest t; //t.testName!("testOtherName")(); t.opD

Re: opDispatch and template parameters

2010-09-13 Thread Guillaume B.
Oh, well: http://d.puremagic.com/issues/show_bug.cgi?id=4856 Guillaume Guillaume B. wrote: > Hi, > > Is this usage of opDispatch supposed to work: > > > module test.d; > > import std.stdio; > > struct DispatchTest { > void opDispatch(string name, string otherName)() { >

Re: opDispatch and template parameters

2010-09-13 Thread Simen kjaeraas
Guillaume B. wrote: Hi, Is this usage of opDispatch supposed to work: module test.d; import std.stdio; struct DispatchTest { void opDispatch(string name, string otherName)() { writeln(name, ":", otherName); } } void main() { DispatchTest t; //t.testName!("test

Re: opDispatch and template parameters

2010-09-14 Thread Guillaume B.
Simen kjaeraas wrote: > Guillaume B. wrote: > >> Hi, >> >> Is this usage of opDispatch supposed to work: >> >> >> module test.d; >> >> import std.stdio; >> >> struct DispatchTest { >> void opDispatch(string name, string otherName)() { >> writeln(name, ":", otherName); >> }

Re: opDispatch and template parameters

2010-09-14 Thread Simen kjaeraas
Guillaume B. wrote: struct test { template opDispatch( string name ) { void opDispatch( string other )( ) { writeln( name, ", ", other ); } } } Wow! That's a nice trick! Seems like I'll have to be carefull when defining opDispatch! It's the way t

Re: opDispatch and template parameters

2010-09-14 Thread bearophile
Simen kjaeraas: > It's the way the language works. Just like D does not support > automatic currying of functions, like this: > > void foo( int n, string s ) {} > auto bar = foo( 4 ); > assert( is( typeof( bar ) == void function ( string ) ) ); > > Neither does it support automatic currying for