It depends on when you want to pass the argument. The push_back call mixes up two different concepts. It is not clear from the message whether you want to pass MyArgs during the bind call, in which case you will return a function object that takes no arguments and returns void if you want to pass MyArgs during the execution of the task. For the first, as @ForEveR said, the right call
mScheduledTasks.push_back(boost::bind(&SomeTask, (void*)&MyArg));
and you need to change your typedef for Task so that it doesn't accept any arguments. If you want to pass an argument at the call point of the Task object, then the push_back call will look like this:
mScheduledTasks.push_back(boost::bind(&SomeTask, _1));
This will create a function object with a function call operator that takes one argument and returns void. Then you change the call to task() in ExecuteTask to pass any argument you have.
source share