title: What effect does "insert" have on references to deques?
body: <p>I'm using a <code>deque</code> in one of my C++ programs, and was reading the documentation for <code>insert</code> on cppreference.com. Most of it made sense except this bit:</p>
  
  <blockquote>
    <p>All iterators, including the past-the-end iterator, are invalidated.
    References are invalidated too, unless <code>pos == begin()</code> or <code>pos == end()</code>,
    in which case they are not invalidated.</p>
  </blockquote>
  
  <p>What does this mean? Is this saying that references to the deque itself are invalidated, or references to its elements, or references to the iterators? Or something else entirely?</p>
  
  <p>Here's a link the doc in question: <a href="http://en.cppreference.com/w/cpp/container/deque/insert" rel="nofollow noreferrer">http://en.cppreference.com/w/cpp/container/deque/insert</a></p>