I give the following example to illustrate my question:
class A
{
public:
template<typename T>
void fun(T &abc)
{
};
}
template<typename U>
void my_fun(std::vector<U> &obj)
{
int abc;
for(int i=0; i<obj.size(); i++
obj[i].fun<int>(abc);
}
The above codes can be compiled in Window with Visual Studio 2010 but not in linux with gcc4.*. In linux, it gives the following compilation errors:
for obj[i].fun<int>(abc);, expected ";"before "int"
Any ideas?