On Wednesday, 17 May 2017 at 13:26:36 UTC, Adam D. Ruppe wrote:
On Wednesday, 17 May 2017 at 13:13:06 UTC, Patric Dexheimer
wrote:
Function overloads coming from mixin templates are not being
detected ?
A name being present in the struct means that name is NOT
pulled from the mixin template.
On Wednesday, 17 May 2017 at 13:13:06 UTC, Patric Dexheimer wrote:
Function overloads coming from mixin templates are not being
detected ?
A name being present in the struct means that name is NOT pulled
from the mixin template. This is a feature, not a bug. It allows
overriding of mixin
1)
struct T{
void f1(){writeln("default f1");}
void f1(int x){writeln("overload f1");}
}
//main
T().f1();
T().f1(1);
//compiles and output as expected.
2)
mixin template add_function(){
void f1(){writeln("default f1");}
}
struct T{
mixin add_function;
void f1(int