I'm attempting to remove boost libraries from my code.
I don't have std::function, and i'm working with C++98, not c++11. I still need to store a vector of simple void Funcs()
from different classes.
I'm using a simple template to get the Class and the instance of the function. But i'd like to replace the need for boost::function and boost::bind.
class App
{
public:
App();
template<class T>
static void AddLoopFunc(void (T::*func)(), T* instance)
{
loop_funcs.push_back(boost::bind(func, instance));
}
static std::vector< boost::function<void()> > loop_funcs;
};
adding a function to the loop
App::AddLoopFunc(&MyClass::Loop, this);