[Templates] I swear they hate me.
I can't seem to get these to link lately.
(Feel free to rip at the idea of this CheckAlloc thing - I need feedback!)
* 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 );
I get this link error (good ol' 2019):
If I defined that, wouldn't I be specialising?
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)