For anyone else this might also be because of redefinition of a method or property name. i.e a property and method might have the same name
The error indicates trying to call a function max() that is not defined as a function. Change parenthesis after const keyword to after the identifier max:
T max const()…
to
T max() const …