title: In C++, how do I add an argument to an "Args&&... args" list of arguments?
body: <p>I have my own thread implementation which allows me to manage various ways of communicating with my threads. It is based on the C++ <code>std::thread</code> class.</p>
  
  <p>I create the thread to run a function named <code>run()</code> which calls the user function. What I'd like to be able to do is call the user function including my thread object pointer.</p>
  
  <p>There is where I have a problem in the constructor. I want to pass the <code>Args</code> as specified on the constructor and prepend <code>this</code> to that list:</p>
  
  <pre><code>class safe_thread
  {
  public:
      typedef std::shared_ptr&lt;safe_thread&gt;    pointer_t;
      typedef std::vector&lt;pointer_t&gt;          vector_t;
  
      template&lt;class Function, class... Args&gt;
      safe_thread(Function&amp;&amp; f, Args&amp;&amp;... args)
          : f_function([this, f, args...]{ std::bind(f, this, args...)(); })
      {
  [...snip...]
  
  private:
      std::function&lt;void()&gt;               f_function;
  };
  
  // I use that constructor with two different types of signatures:
  //
  // 1. member function
  //
  safe_thread listen(&amp;my_other_class::some_function, this);
  
  // 2. static function
  //
  safe_thread worker(&amp;my_static_function);
  </code></pre>
  
  <p><code>std::bind()</code> does not understand my current syntax. It expects a function (<code>f</code>) and <code>args...</code>. So, how do I <em>change</em> <code>args...</code> to include <code>this</code>?</p>