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
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)() {
>
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
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);
>> }
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
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