I try to implement a function which received parameter type int and string. So I though of template.
Header file
template <typename T>
class SymbolTable {
public:
void run(string filename);
void insert(T value);
}
Implementation (.cpp) file
template <typename T>
void SymbolTable::run(string filename)
{
cout << "success" << endl;
}
// Haven't implement "insert" yet!
Compiler report error:
name followed by '::' must be a class or namespace name
If I remove template, It works fine. Any suggestion...?