title: Unpacking a std::array
body: <p>I tried to unpack a <code>std::array</code> via <code>std::tie</code>:</p>
  
  <pre><code>#include &lt;tuple&gt;
  #include &lt;array&gt;
  
  int main() {
      std::array&lt;int, 3&gt; arr = {1, 2, 3};
      int a, b, c;
      std::tie(a, b, c) = arr;
      return 0;
  }
  </code></pre>
  
  <p>This works in clang, but fails to compile in g++ 5.4: <code>no match for ‘operator=’</code>. Compile options are <code>-std=c++11</code>.</p>
  
  <ol>
  <li>Why does this work in clang but not g++?</li>
  <li>How can I portably unpack a <code>std::array</code>, like one might unpack a tuple?</li>
  </ol>
  
  <p>Thanks for any help!</p>