title: Function signatures in C++ templates
body: <p>The <code>std::function</code> class is templated in such a way that when we want it to wrap a function like the following:</p>
  
  <pre><code>void printInt(int integer)
  {
      std::cout &lt;&lt; int &lt;&lt; '\n';
  }
  </code></pre>
  
  <p>We use a <code>std::function&lt;void(int)&gt;</code>. Until recently I thought this was an odd nuance of the class, but <a href="https://codereview.stackexchange.com/questions/14730/impossibly-fast-delegate-in-c11">a class I found</a> while searching for delegate implementation in C++ uses a similar syntax.</p>
  
  <p>What exactly <em>is</em> <code>void(int)</code>, and what do we call it in technical terms? It seems to be the standard way of saying "<em>a function that takes an int, and returns void</em>" in codespeak, but my gut instinct says that's horribly oversimplified.</p>
  
  <p>Secondly, I've noticed that when I see templates using this syntax they use variadic templates to allow multiple function signatures to be matched. From the link above:</p>
  
  <pre><code>template &lt;typename T&gt; class delegate;
  
  template&lt;class R, class ...A&gt;
  class delegate&lt;R (A...)&gt;
  {
  ...
  </code></pre>
  
  <p>What is the reason for declaring the function as such instead of simply using the following:</p>
  
  <pre><code>template&lt;class R, class ...A&gt;
  class delegate
  {
  ...
  </code></pre>