I have been learning about perfect forwarding and the use of && in function templates (see this previous question of mine) and would like to know if my use of Args
The issue is that which overload of MyThreadFunc
is desired is not deducible by the compiler. There are at least two ways to fix it:
Rename one of the function so that it is clearer which one you want.
Use explicit template parameters:
StartDetachedThread(MyThreadFunc, object);
StartDetachedThread(MyThreadFunc, std::move(object2));