I am having a problem with C++ templates which is actually quite embarrassing for me to admit to since I predict a lot of you will figure my problem out faster than it took me to write this post but I've exhausted my patience for right now. I wrote this short snippet in Linux with GCC.
HelloWorld.h
template<class MessageClass>
class HelloWorld
{
public:
void MessageOne();
void MessageTwo();
void MessageThree();
};
#include "HelloWorld.cc"
using namespace std;
template<class MessageClass>
void HelloWorld<MessageClass>::MessageOne()
{
cout << "MessageOne()";
}
I get the following errors:
"HelloWorld.cc:5: error: expected init-declarator before '<' token"
"HelloWorld.cc:5: error: expected ';' before '<' token"