I would like to add debug within a template function, however not looking at re-editing the whole code.
Would one be able to
#define theFunction<T>(size) _theFunction<T>(size, __FILE__, __LINE__)
template<class T> T* _theFunction(int size, string file, int line)
{
if (fails) {
printf("theFunction failed called at line %i on %s ", line, file);
}
}
of course returns '<' unexpected in macro declaration. Are there some tricks to make that work?