title: Erase-remove idiom with std::set failing with constness-related error
body: <p>Can someone help me out here?</p>
  
  <p>Compiling this code:</p>
  
  <pre><code>void test()
  {
    std::set&lt;int&gt; test;
    test.insert(42);
    test.erase(std::remove(test.begin(), test.end(), 30), test.end());  // &lt;- Line 33
  }
  </code></pre>
  
  <p>Is generating the following error when compiling:</p>
  
  <pre><code>$ make
  g++ -c -Wall -pedantic-errors -Wextra -Wunused -Werror a_star.cpp
  /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/stl_algo.h: In function `_FIter std::remove(_FIter, _FIter, const _Tp&amp;) [with _FIter = std::_Rb_tree_const_iterator&lt;int&gt;, _Tp = int]':
  a_star.cpp:33:   instantiated from here
  /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++/bits/stl_algo.h:779: error: assignment of read-only location `__result.std::_Rb_tree_const_iterator&lt;_Tp&gt;::operator* [with _Tp = int]()'
  make: *** [a_star.o] Error 1
  </code></pre>