Closed
Description
import std.stdio;
mixin template OD(string s){
void opDispatch(string name)() if(name == s){
writeln("op dispatch for ", name);
}
}
struct T {
mixin OD!"x";
mixin OD!"y";
}
struct U {
mixin OD!"z";
}
void main(){
T t;
//t.x(); //error!
//t.y(); //error!
t.opDispatch!"x";
t.opDispatch!"y";
U u;
u.z(); //OK
}
The fact that explicitly calling opDispatch works for T
but that the dispatches themselves don't work makes this seems like a simple oversight rather than a necessary limitation.
Metadata
Metadata
Assignees
Labels
No labels