title: Valid template expansion?
body: <p>I am taking a structure that contains variadic types, extracting them, and passing them
  to a native function call.</p>
  
  <pre><code>//ValueArray contains a vector of a variant type.
  
  // Pulls out an argument from a ValueArray.
  template&lt;typename Arg&gt;
  inline Arg
  _processParam( ValueArray&amp; args ) {
      Arg arg = static_cast&lt;Arg&amp;&gt;( args[ 0 ] );
      args.erase( 0, true );
      return arg;
  }
  
  
  /// Do the Function call. Args is a variadic template pack.
  call( fnPtr, _processParam&lt;Args&gt;( args )... );
  
  /// The call expands to:
  (*fnPtr)( params... );
  </code></pre>
  
  <p>The problem however is that the _processParam( args )... expansion is pulling out the args by type in reverse order. For example, a ValueArray of [ 1, 1.4 ] will be pulled out as a double, then and int. Is there a way to pull out the arguments correctly and in a portable way?</p>