title: Initializer list to array
body: <p>As of now, I have a class <code>Permutation</code>, which has this:</p>
  
  <pre><code>public:
   int elements[N];
   Permutation(std::initializer_list&lt;size_t&gt; data): elements(data) {};
  </code></pre>
  
  <p>But when I try to compile, I get this:</p>
  
  <blockquote>
    <p>error: array initializer must be an initializer list</p>
  </blockquote>
  
  <p>I've googled the hell out of the initialiser lists, though there is nothing that was useful/I could understand. So I do not have the tiniest idea about how to use the initialiser lists. </p>
  
  <p>How do I write this constructor?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I also have this version:</p>
  
  <pre><code>public:
   int elements[N];
   Permutation(std::initializer_list&lt;size_t&gt; data): elements(new int[N]) {
       std::copy(data.begin(), data.end(), elements.begin(), elements.end());
   }
  </code></pre>
  
  <p>I'm pretty sure it's even more wrong, but if it's fixable, could someone tell me how to do this?</p>