I am trying to create a template so that I can have a function pointer (for a callback function) that accepts both a Class as a base for member functions as well as as having a way to have globally defined functions.
At the moment I have
template <class c> struct Callback { typedef void(c::*callback)(void); }; Which works and will allow me to use Callback::callback as a type
However when I try and add a specific implementation such as:
class VOIDCLASS { void * void_ptr; }; // Callback template declaration as above here template <VOIDCLASS> struct Callback { typedef void(*callback)(void); }; I get a compiler error : error C3855: 'Callback': template parameter 'c' is incompatible with the declaration This is using Visual Studio 2013 with a platform tool-set of v110(VS2012) and Windows 8.1