E
er
Hi,
here's a problem:
struct A{};
void f(const A&a){}
template<typename T,void (*)(const T&)>
void g(const T& t){}
template<typename T>
void g2(const T& t,void (*)(const T&)){}
A a;
g<f>(a); // (1)
g<A,f>(a); // (2)
g2(a,f); // (3)
(2) and (3) compile fine, not 1. Why exactly? Any suggestion to
approach (1)?
here's a problem:
struct A{};
void f(const A&a){}
template<typename T,void (*)(const T&)>
void g(const T& t){}
template<typename T>
void g2(const T& t,void (*)(const T&)){}
A a;
g<f>(a); // (1)
g<A,f>(a); // (2)
g2(a,f); // (3)
(2) and (3) compile fine, not 1. Why exactly? Any suggestion to
approach (1)?