Disclaimer: The following question probably is so easy that I might be shocked seeing the first answer. Furthermore, I want to apologize for any duplicate questions - syntac
obj.bar(1,2); // This line is faulty.
The template
keyword is required here, as obj
is an instance of a type Foo
which depends on the template parameter T
, and so the above should be written as:
obj.template bar(1,2); //This line is corrected :-)
Read @Johannes's answer here for detail explanation: