title: Can I use vector as index in map structure in c++?
body: <p>I attempted to do something like this but it does not compile:</p>
  
  <pre><code>class point
  {
      public:
          int x;
          int y;
  };
  
  
  
  int main()
  {
  
      vector&lt;point&gt; vp1;
      vector&lt;point&gt; vp2;
      vector&lt;point&gt; vp3;
  
      map &lt; vector&lt;point&gt;, int &gt; m;
  
      m[vp1] = 1;
      m[vp2] = 2;
      m[vp3] = 3;
  
      map &lt; vector&lt;point&gt;, int &gt;::iterator it;
      for (it=m.begin(); it!=m.end(); it++)
      {
          cout&lt;&lt;m[it-&gt;first]&lt;&lt;endl;
      }
      return 0;
  }
  </code></pre>