Function pointers and callbacks? Argh! Does anyone know why this won't compile on MSVC++, but will with GCC?
MS says:Code:template<class T> static Entity *instantiateEntity(IGame *g, Vector v) { return new T(g, v); } static itemspec_t items[] = { { "player_start", {NULL}, {NULL}, instantiateEntity<Player> }, };
And points to the bolded line. Any ideas?error C2440: 'initializing' : cannot convert from '' to 'class Entity *(__cdecl *)(class IGame *,struct Vector)'
None of the functions with this name in scope match the target type




Reply With Quote