title: How to initialise one array using another constexpr array in a static manner
body: <p>I have a <code>constexpr</code> array like this:</p>
  
  <pre><code>constexpr std::array&lt;int, 4&gt; BASES_TO_CHECK = { 8, 16, 32, 64 };
  </code></pre>
  
  <p>I would like to do something akin to:</p>
  
  <pre><code>std::array&lt;std::thread, BASES_TO_CHECK.size()&gt; calc;
  for(size_t i = 0; i&lt;BASES_TO_CHECK.size(); ++i)
  {
      calc[i]=std::thread(calculate&lt;BASES_TO_CHECK[i]&gt;,  std::ref(recordMap[BASES_TO_CHECK[i]]),  std::ref(counterMap.at(BASES_TO_CHECK[i])),  std::ref(done));
  }
  </code></pre>
  
  <p>However, as the variable is used as a template parameter, so that won't work. I have ended up doing this:</p>
  
  <pre><code>std::array&lt;std::thread, BASES_TO_CHECK.size()&gt; calc = {
      std::thread(calculate&lt;BASES_TO_CHECK[0]&gt;,  std::ref(recordMap[BASES_TO_CHECK[0]]),  std::ref(counterMap.at(BASES_TO_CHECK[0])),  std::ref(done)),
      std::thread(calculate&lt;BASES_TO_CHECK[1]&gt;,  std::ref(recordMap[BASES_TO_CHECK[1]]),  std::ref(counterMap.at(BASES_TO_CHECK[1])),  std::ref(done)),
      std::thread(calculate&lt;BASES_TO_CHECK[2]&gt;,  std::ref(recordMap[BASES_TO_CHECK[2]]),  std::ref(counterMap.at(BASES_TO_CHECK[2])),  std::ref(done)),
      std::thread(calculate&lt;BASES_TO_CHECK[3]&gt;,  std::ref(recordMap[BASES_TO_CHECK[3]]),  std::ref(counterMap.at(BASES_TO_CHECK[3])),  std::ref(done))
  };
  </code></pre>
  
  <p>And this works, but is relying on me not changing the number of elements in the <code>BASES_TO_CHECK</code> without also manually updating the part of the code where <code>calc</code> array is initialised.</p>