title: Filling an array during compilation
body: <p>I am trying to fill a char array using another constexpr char array during compile time, but I do not see how could I do this.</p>
  
  <p>I am trying to emulate the following:</p>
  
  <pre><code>constexpr char arr1[N] = {/* Permutation of the numbers 0..N-1 */}
  char arr2[N];
  for(int i=0;i&lt;N;++i)
      arr2[arr1[i]]=i;
  </code></pre>
  
  <p>but since I cannot return an array from a function, I do not know how to do this. Furthermore, I would like arr2 to be constexpr, since everything I need to compute it is known at compile time.</p>
  
  <p>Any ideas about how to do this?</p>