If you're using Visual Studio 2010 or newer (or a compiler that supports C++0x);
bool CGame::Create( /* */ )
{
tr1::function<void (CGame*)> CGameOnLoading = &CGame::OnLoading;
m_nState = EGS_WORLD;//EGS_LOADING;
CGameOnLoading( this );
return true;
}
Note that the tr1 namespace is inside the std namespace.
TR1 is not necessary. VS2010 has std::function support as part of its C++11 support. Its also important to note that std::function is not the same as boost signals and slots, which allows for registration and deregistration of multiple listeners.