title: Compute differences of pair elements in array of pairs compile time
body: <p>In the code below, I aim to construct an array of <code>N</code> elements that contains the differences between two <code>std::pair</code> elements compile time. Is there a way to achieve this using templates, as it has to work for arbitrary size <code>N</code>?</p>
  
  <pre><code>#include &lt;array&gt;
  #include &lt;utility&gt;
  
  template&lt;int N&gt;
  std::array&lt;int, N&gt; make_array(
          const std::array&lt;std::pair&lt;int, int&gt;, N&gt;&amp; ranges)
  {
      // Need to construct array compile time with difference between pair elements.
  }
  
  int main()
  {
      std::array&lt;int, 2&gt; a = make_array&lt;2&gt;({{ {1,3}, {2,9} }}); // a = {2, 7}
      std::array&lt;int, 1&gt; b = make_array&lt;1&gt;({{ {5,6} }}); // b = {1}
  
      return 0;
  }
  </code></pre>