I am having trouble compiling this code on Linux, but it works fine on Windows.
Windows Compiler: Visual Studio 2005
Linux compiler: gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)
class DoSomething
{
public:
template <class DataType>
bool Execute()
{
}
};
template <class Operator>
TypeSwitch(int DataTypeCode, Operator& Op)
{
switch (DataTypeCode)
{
case 1: return Op.Execute<char>();
case 2: return Op.Execute<int>();
}
}
TypeSwitch(Code,DoSomething);
On Windows, this code works fine and does exactly what I want. On Linux, I get errors:
error: expected primary expression before the token '>'
error: expected primary expression before ')' token
for each of the lines with the case statement.
Any ideas?
Thanks Mike
miked source
share