When compiling a function, the foo()compiler does not know that the panel is a member of the template . You must say that:
template <typename T>
void foo(T & t)
{
t. template bar<int>();
}
The compiler considers that the bar is only a member variable, and you are trying to compare it with something, for example. t.bar < 10. As a result, he complains that "int" is not an expression.
source
share