title: define macro with template as variable
body: <p>i'm trying to use a macro to create some static variables.</p>
  
  <p>my problem is, how do i do define a macro with 2 parameters, the first is a template and the second a static variable. the template should have more than 1 type.</p>
  
  <p>for example:
  </p>
  
  <pre><code>#define macro(x, y, z, v) x::y z = v;
  
  int main(int argc, char *argv[]) {
    // this works
    macro(std::queue&lt;int&gt;, value_type, test, 4)
    // this also works
    std::pair&lt;int, int&gt;::first_type x = 3;
  
    // this is produsing some compiler errors
    macro(std::pair&lt;int, int&gt;, first_type, test2, 4)
  
    return 0;
  }
  </code></pre>
  
  <p>and is it even possible to do this?</p>
  
  <p>here is the error:</p>
  
  <pre><code>main.cpp(47) : warning C4002: too many actual parameters for macro 'macro'
  main.cpp(47) : error C2589: 'int' : illegal token on right side of '::'
  main.cpp(47) : error C2589: 'int' : illegal token on right side of '::'
  main.cpp(47) : error C2143: syntax error : missing ',' before '::'
  main.cpp(50) : error C2143: syntax error : missing ';' before '}'
  main.cpp(51) : error C2143: syntax error : missing ';' before '}'
  </code></pre>
  
  <p>inspired by Joachim Pileborg</p>
  
  <pre><code>#define macro(x, y, z, v, ...) x&lt;__VA_ARGS__&gt;::y z = v;
  ...
  
  // now it works
  macro(std::pair, first_type, test2, 4, int, int)
  </code></pre>
  
  <p>thx Joachim</p>