title: std::pair<int, int> vs struct with two int's
body: <p>In an ACM example, I had to build a big table for dynamic programming. I had to store two integers in each cell, so I decided to go for a <code>std::pair&lt;int, int&gt;</code>. However, allocating a huge array of them took 1.5 seconds:</p>
  
  <pre><code>std::pair&lt;int, int&gt; table[1001][1001];
  </code></pre>
  
  <p>Afterwards, I have changed this code to</p>
  
  <pre><code>struct Cell {
      int first;
      int second;
  }
  
  Cell table[1001][1001];
  </code></pre>
  
  <p>and the allocation took 0 seconds.</p>
  
  <p>What explains this huge difference in time?</p>