title: Get access to the data stored in iterator
body: <p>I'm trying to get more comfortable with std::multiset and std::pair. So I wrote a little main program which creates a multiset and pushes elements into it, as you can see below.</p>
  
  <pre><code>#include &lt;set&gt;
  #include &lt;utility&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  int main()
  {
      std::cout &lt;&lt; "Hello World" &lt;&lt; std::endl;
  
      /*
      std::multiset&lt;std::pair&lt;int, float&gt; &gt; set;
      std::multiset&lt;std::pair&lt;int, float&gt; &gt;::iterator it;
      set.insert(std::make_pair(534, 5.3));
      set.insert(std::make_pair(22, 9.2));*/
  
      std::multiset&lt;int&gt; set;
      std::multiset&lt;int&gt;::iterator it;
      set.insert(43);
      set.insert(45);
      set.insert(32);
  
      for(it = set.begin(); it != set.end(); it++)
      {
          std::cout &lt;&lt; *it &lt;&lt; std::endl;
      }
      std::cout &lt;&lt; "Bye" &lt;&lt; std::endl;
      return 1;
  }
  </code></pre>
  
  <p>When I create an int-multiset everything works fine. But when I comment the second multiset-block out and use the first one instead. I get following compile error:</p>
  
  <pre><code>std::cout &lt;&lt; *it &lt;&lt; std::endl;no match for 'operator&lt;&lt;' (operand types are'std::ostream {aka std::basic_ostream&lt;char&gt;}' and 'const std::pai&lt;int, float&gt;')
  </code></pre>
  
  <p>So I replaced</p>
  
  <pre><code>std::cout &lt;&lt; *it &lt;&lt; std::endl;
  </code></pre>
  
  <p>with</p>
  
  <pre><code>std::cout &lt;&lt; *it.first &lt;&lt; std::endl;
  </code></pre>
  
  <p>and get following error:</p>
  
  <pre><code>‘std::multiset&lt;std::pair&lt;int, float&gt; &gt;::iterator {aka struct std::_Rb_tree_const_iterator&lt;std::pair&lt;int, float&gt; &gt;}’ has no member named ‘first’
  </code></pre>
  
  <p>How can I fix this, to get access to the first value of the std::pair element stored inside the multiset?</p>