I'm having an odd problem writing some template classes and placing the implementation in a separate .CPP file - specifically I keep getting the following errors:
Error 1 error C2143: syntax error : missing ';' before 'List<T>::begin'
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Here is my dummy test code:
(proof of concept)
-= HEADER FILE =-
[Class]
template<typename T> class List
{
public:
class A
{
};
A begin() const;
};
[/Class]
-= IMPLEMENTATION FILE =-
[Class]
template<typename T> A List<T>::begin() const
{
return A();
}
[Class]
Now, if I place this code directly into the header (.h) file it compiles without any errors, I only encounter issues when placing my functions within the separate implementation (CPP) file...
Any clues would be much appreciated.
Thanks,