title: What is the use of pair class stl in c++ , is it like a data type or a container?
body: <p>I basically want to know on which area we can use pair stl, how can we iterate over pair stl. Here is a short code where I have tried to iterate over a pair but it's giving error.</p>
  
  <pre><code>int main()
  {
  
      pair&lt;int,int&gt;a;
      a=make_pair(1,22);
      a=make_pair(2,33);
      a=make_pair(3,44);
  
      for(pair&lt;int,int&gt;::iterator i:a)
      {
          cout&lt;&lt;a.first&lt;&lt;"--&gt;";
          cout&lt;&lt;a.second;
          cout&lt;&lt;endl;
      }
  }
  </code></pre>