std::thread
follows the syntax of std::bind
, so the correct invocation is
std::thread t(&AbstractBaseClass::foo, object, variable)
The first one is called a pointer to member function. The above will copy by value the parameters passed to it. If you need pass by reference, use std::ref
, like
std::thread t(&AbstractBaseClass::foo, object, std::ref(variable))
Remember the keep the lifetime of variable
longer than the thread in that case.