Determining if a class has a template function
    Straivers via Digitalmars-d-learn 
    digitalmars-d-learn at puremagic.com
       
    Tue Oct 11 13:17:19 PDT 2016
    
    
  
I have a class T with a templated function foo(string name)(int, 
int, float) that will be mixed in via template, and I want to 
determine if that class has mixed it in such that foo(name = 
"bar"). How could I go about this? Thanks.
eg:
mixin template A(string name, Args...) {
     void foo(string fooName)(Args args)
         if (fooName == name) {}
}
template hasFoo(string name, A) {
     enum hasFoo = ???
}
class B {
     mixin A!("mash", int, int, string);
}
    
    
More information about the Digitalmars-d-learn
mailing list