title: What will be returned from std::set.end() exactly in c++?
body: <p>When you refers to <a href="http://en.cppreference.com/w/cpp/container/set/end" rel="nofollow noreferrer">cppreference</a>, you will find this:</p>
  
  <blockquote>
    <p>Returns an iterator to the element following the last element of the
    container. This element acts as a placeholder; attempting to access it
    results in undefined behavior.</p>
  </blockquote>
  
  <p>Then I run the following code:</p>
  
  <pre><code>std::set&lt;int&gt; s {1, 2, 3};
  cout &lt;&lt; *s.end() &lt;&lt; endl;
  </code></pre>
  
  <p>The out put is: <strong>3</strong>, why?</p>