Thanks for link. In C++ ensuring whether something is safe is indeed sometimes
quite non-trivial, my favourite, but non-practical example is non-empty
std::list&lt;int&gt; x, used in following way:<p><pre><code>  x.remove(x.front());
</code></pre>
Comment for non-C++ programmers: front method returns a reference to the first
value in the list, and remove takes a const reference to value and removes all
elements that compare equal to it. Problem is of course that after comparing
first element with provided argument, it would compare equal and be
subsequently deleted, making the reference invalid. As a side comment, I will
note that above is in fact required to work, though it is probably not something
you should write.