While playing with template and functors (not present in this question) I ended up with the following simplified problem.
The following code (available also here)
class A {
public:
template <class T>
bool isGood(int in) const {
const T f;
return in < f.value();
}
};
class B {
public:
int value() const {return 10;}
};
template <class T>
bool tryEvaluator(T& evaluator, int value) {
return evaluator.isGood<B>(value);
}
int main( int argc, const char* argv[] ) {
const A evaluator;
evaluator.isGood<B>(20); //Seemingly no problem here
tryEvaluator(evaluator,20);
return 0;
}
generates an error
main.cpp:18:34: error: expected primary-expression before ‘>’ token
return evaluator.isGood<B>(value);
^
Is it it possible to perform what I am trying to do? Do I need to add for example some keyword?
And, side question, how should I better rename my question?