Hi
I changed the sf::Thread class in SFML 2 to make it more flexible. I removed the Run() virtual function (so, no more inheritance from sf::Thread) and added a bunch of template constructors instead.
So now you can do this:
void f();
sf::Thread t(&f);
void f(int arg); // arg type can be anything
sf::Thread t(&f, 5);
class Task
{
public:
void run();
};
Task task;
sf::Thread t(&Task::run, &task);
struct Functor
{
void operator()();
};
sf::Thread t(Functor());
struct Functor
{
void operator()(std::string arg);
};
sf::Thread t(Functor(), "toto");
sf::Thread t(boost::bind(...));
So the previous scenarios are still possible, plus a lot of new ones.