Hi all,
I get a compilation error with this source code (simplified to isolate the problem) :
I get the following compilation errors at line "this->_vtable->add<_U_>()" :
main.cpp: In member function ‘void functor<_T_>:perator()(const _U_&)’:
main.cpp:23: error: expected primary-expression before ‘>’ token
main.cpp:23: error: expected primary-expression before ‘)’ token
The version of gcc I used is 4.2.4.
Note that there is no error with the above code with Visual C++ 2008 (Express Edition).
What is the problem with gcc ?
--
Globos
I get a compilation error with this source code (simplified to isolate the problem) :
Code:
struct VirtualTable
{
template<typename _FUNC_>
void add()
{
}
}; // struct VirtualTable
template<typename _T_>
struct functor
{
private:
VirtualTable* _vtable;
public:
functor(VirtualTable* vtable) :
_vtable(vtable)
{
}
template<typename _U_>
void operator()(const _U_& /*v*/)
{
this->_vtable->add<_U_>(); // <- This is where the compiler complains
}
}; // struct functor
int main()
{
functor<int> func(0);
return 0;
}
I get the following compilation errors at line "this->_vtable->add<_U_>()" :
main.cpp: In member function ‘void functor<_T_>:perator()(const _U_&)’:
main.cpp:23: error: expected primary-expression before ‘>’ token
main.cpp:23: error: expected primary-expression before ‘)’ token
The version of gcc I used is 4.2.4.
Note that there is no error with the above code with Visual C++ 2008 (Express Edition).
What is the problem with gcc ?
--
Globos