title: Boost bind and boost function, storing functions with arguments in a vector and then executing them
body: <p>Sorry for the badly-worded title. </p>
  
  <p>I've been looking through the documentation, but I cannot find anything that might solve this problem I have.</p>
  
  <p>Basically I want to store several <code>function1&lt;void, void*&gt;</code> , with arguments provided, in a vector, and then execute them at a later stage. </p>
  
  <p>This is what I want to accomplish:</p>
  
  <pre><code>typedef boost::function1&lt;void, void*&gt; Task;
  
  Vector&lt;Task&gt; mScheduledTasks;
  int MyArg = 5;
  
  void SomeTask(void* arg)
  {
      // ....
  }
  
  void AddSomeTasks()
  {
      // nevermind that MyArg is globally accessible
      for (int i = 0; i&lt;5; i++)
          mScheduledTasks.push_back(boost::bind(&amp;SomeTask, _1), (void*)&amp;MyArg);
  }
  
  void ExecuteTask()
  {
      Task task = mScheduledTasks.front();
      task();
  }
  </code></pre>
  
  <p>Now executing task() it wants me to pass an argument, but I passed it in AddSomeTasks? Why is it not using that? Or I have missunderstod the usage of boost::bind?</p>
  
  <p>Thanks</p>