I can't seem to get these to link lately.
Code:
/* CheckAlloc
* A convenience function to save writing the same "check pointer" code
* after having attempted to allocate memory through new.
*/
template <class T> void CheckAlloc( T* ptr )
{
if ( !ptr )
ErrorLogging::Log( "CheckAlloc: Failed - memory exhausted?", true );
}
(Feel free to rip at the idea of this CheckAlloc thing - I need feedback!)
I get this link error (good ol' 2019):
Code:
Cvars.obj : error LNK2019: unresolved external symbol "void __cdecl CheckAlloc<struct Cvar>(struct Cvar *)" (??$CheckAlloc@UCvar@@@@YAXPAUCvar@@@Z) referenced in function "struct Cvar * __cdecl MakeCvar(unsigned long,long,float,double,unsigned char,bool,char *)" (?MakeCvar@@YAPAUCvar@@KJMNE_NPAD@Z)
If I defined that, wouldn't I be specialising?