title: Retrieve function arguments as a tuple in C++
body: <p>Consider I have a function declarations like these:</p>
  
  <pre><code>void foo(int x, float y);
  
  class X {
    void anotherFoo(double a, int c);
  };
  </code></pre>
  
  <p>How can I get a tuple that corresponds to the function arguments? In the above case it would be:</p>
  
  <pre><code>boost::tuple&lt;int, float&gt;
  boost::tuple&lt;X*, double, int&gt;
  </code></pre>
  
  <p>or even better with the result type as 0th element:</p>
  
  <pre><code>boost::tuple&lt;void, int, float&gt;
  boost::tuple&lt;void, X*, double, int&gt;
  </code></pre>
  
  <p>I know that <code>boost::function_types::parameter_types</code> can do exactly this. However, I am interested in the principle of how it is implemented.</p>