title: Apply functions belonging to other classes through variadic templates
body: <p>Say I have three classes, <code>ClassA</code>, <code>ClassB</code>, and <code>ClassC</code>. And all three of these classes have a function called <code>updateValue(int)</code>. And then I have controller class called, <code>Controller</code>. Who's constructor is templated like the following:</p>
  
  <pre><code>class Controller
  {
    public:
      template &lt;class...Classes&gt;
      Controller(Classes &amp; ...classes); // maybe initialize a tuple?
  
      void setValues(int val)
      {
        // unpack whatever data structure and call each classes updateValue(int)
      }
    private:
      std::tuple&lt;Classes...classes&gt; packedClasses; // Not sure if this is good idea? This will not compile
  };
  </code></pre>
  
  <p>As you can see, I want to be able to take the classes from some data structure, and call their functions. For example, in main I would have:</p>
  
  <pre><code>int main()
  {
    ClassA A;
    ClassB B;
    ClassC C;
  
    Controller controller1(A,B);
    Controller controller2(A,C);
    Controller controller3(B,C);
    Controller controller4(A,B,C);
  
    controller4.setValues(20);
  
  }
  </code></pre>
  
  <p>Each class has their own way of updating a value, for example <code>ClassA</code> has <code>setValue(int)</code>, <code>ClassB</code> has <code>setInt(int)</code>, and <code>ClassC</code> has <code>updateNumber(int)</code>. My plan is to write the function <code>updateValue</code> into each of these classes that will call their setter functions. However, I am not sure how to achieve what it is I am trying to do. How can I unpack all of the classes and call their function <code>updateValue(int)</code>?</p>