title: How can I cleanly specify which arguments I am passing and which remain default?
body: <p><em>Asked because of this</em>: <a href="https://stackoverflow.com/questions/8178187/default-argument-in-c">Default argument in c++</a></p>
  
  <p>Say I have a function such as this: <code>void f(int p1=1, int p2=2, int p3=3, int p4=4);</code></p>
  
  <p>And I want to call it using only some of the arguments - the rest will be the defaults.</p>
  
  <p>Something like this would work:</p>
  
  <pre><code>template&lt;bool P1=true, bool P2=true, bool P3=true, bool P4=true&gt;
  void f(int p1=1, int p2=2, int p3=3, int p4=4);
  // specialize:
  template&lt;&gt;
  void f&lt;false, true, false, false&gt;(int p1) {
    f(1, p1);
  }
  template&lt;&gt;
  void f&lt;false, true, true, false&gt;(int p1, int p2) {
    f(1, p1, p2);
  }
  // ... and so on. 
  // Would need a specialization for each combination of arguments
  // which is very tedious and error-prone
  
  // Use:
  f&lt;false, true, false, false&gt;(5); // passes 5 as p2 argument
  </code></pre>
  
  <p>But it requires too much code to be practical. </p>
  
  <p>Is there a better way to do this?</p>