When I create a function that takes in a typename, I can create it fine without a class, but when I try to put the functionality inside a class it gives me errors. Could anyone explain to me what I have to do to get it working and why?
Example of working case: This is when I don't put it inside a class
template<typename T>
bool Test(const char* _pcSection, const char* _pcKey, T& _tValue)
{
return true;
}
Example of failing: When I try to chuck it inside the class (so I can access member variables)
class CIniParser
{
public:
template<typename T>
bool GetValue(const char* _pcSection, const char* _pcKey, T& _tValue);
}
/////////////////////////
//Inside the .cpp...
template<typename T>
bool CIniParser::GetValue(const char* _pcSection, const char* _pcKey, T& _tValue)
{
//do stuff
return true;
}
Any help would be great :)