title: Storing an array of sets of coordinates in C++ (vector of vector of pairs?)
body: <p>First of all, I am very new to C++ so I may have to dip into pseudocode and/or Python to explain what I'm trying to do...</p>
  
  <p>I'm trying to store pairs of X and Y coordinates for each frame of an animation, for multiple sprites. I envisaged this to be something like the following - assume that PLAIN == 1 (using an enum):</p>
  
  <pre><code>animationFrames[PLAIN][0] = { 20, 50 }
  animationFrames[PLAIN][1] = { 25, 55 }
  </code></pre>
  
  <p>Et cetera. I essentially would like to be able to query animationFrames with the ID of the sprite in question and receive a set of X,Y coordinates to iterate over. I'm finding this quite tricky. Here's my attempt, which does not work...</p>
  
  <pre><code>std::vector&lt; std::vector&lt; std::pair&lt;int, int&gt; &gt; &gt; frames = {
      {
          { 1, 1 }, { 2, 2 }  // two frames for sprite A
      },
      {
          { 3, 3 }, { 4, 4 }  // two frames for sprite B
      }
  };
  </code></pre>
  
  <p>This results in the following error message:</p>
  
  <pre><code>prog.cpp: In function 'int main()':
  prog.cpp:15: error: braces around initializer for non-aggregate type 'std::vector&lt;std::vector&lt;std::pair&lt;int, int&gt;, std::allocator&lt;std::pair&lt;int, int&gt; &gt; &gt;, std::allocator&lt;std::vector&lt;std::pair&lt;int, int&gt;, std::allocator&lt;std::pair&lt;int, int&gt; &gt; &gt; &gt; &gt;'
  </code></pre>
  
  <p>I've tried various mutations of vectors, pairs, and arrays, but I can't seem to figure it out.</p>
  
  <p>Thanks in advance!</p>