C
caustik
I don't care if its bad C++, I really dont. I need to convert from
a member function pointer to a "void*" with zero computational
overhead.
I have the perfect way to do it right here, but i'm having troubles
because if the member function pointer i pass to the function is
not void with no params, I get a casting error.
Any ideas how to do this?
caustik
// ******************************************************************
// * Take THIS C++ !!
// ******************************************************************
template <class BaseClass> inline void *MFPtoFP( void
(BaseClass::*pMemFunc)(void) )
{
union
{
void BaseClass::*pMemFunc;
void *pFunc();
}
ThisConv;
ThisConv.pFunc = pMemFunc;
return ThisConv.pFunc;
}
a member function pointer to a "void*" with zero computational
overhead.
I have the perfect way to do it right here, but i'm having troubles
because if the member function pointer i pass to the function is
not void with no params, I get a casting error.
Any ideas how to do this?
caustik
// ******************************************************************
// * Take THIS C++ !!
// ******************************************************************
template <class BaseClass> inline void *MFPtoFP( void
(BaseClass::*pMemFunc)(void) )
{
union
{
void BaseClass::*pMemFunc;
void *pFunc();
}
ThisConv;
ThisConv.pFunc = pMemFunc;
return ThisConv.pFunc;
}