The following code gives me an error "unable to match function definition to an existing declaration"
. Is my syntax correct?
CharPlayer.h
class CharacterPlayer
{
public:
template <class cType>
cType createCharacter(cType characterType);
};
CharPlayer.cpp
template <class cType>
cType CharacterPlayer::createCharacter(cType characterType)
{
return 3;
}
Main
CharacterPlayer *controllerPntr = new CharacterPlayer;
controllerPntr->createCharacter(1);