title: iter_swap() versus swap() -- what's the difference?
body: <p><a href="http://msdn.microsoft.com/en-us/library/f1863z4b.aspx" rel="noreferrer">MSDN says</a>:</p>
  
  <blockquote>
    <p><code>swap</code> should be used in preference to <code>iter_swap</code>, which was included in the C++ Standard for backward compatibility.</p>
  </blockquote>
  
  <p>But <a href="https://groups.google.com/forum/?fromgroups=#!topic/comp.std.c++/AMH7TXg5EsI" rel="noreferrer">comp.std.c++ says</a>:</p>
  
  <blockquote>
    <p>Most STL algorithms operate on iterator ranges. It therefore makes sense to
    use <code>iter_swap</code> when swapping elements within those ranges, since that is its
    intended purpose --- swapping the elements pointed to by two iterators. This
    allows optimizations for node-based sequences such as <code>std::list</code>, whereby the
    nodes are just relinked, rather than the data actually being swapped.</p>
  </blockquote>
  
  <p>So which one is correct? Should I use <code>iter_swap</code>, or should I use <code>swap</code>? (Is <code>iter_swap</code> only for backwards compatibility?) Why?</p>