title: consume element from std::set
body: <p>I try to directly consume elements from a set, which i cannot get to work from the outside getting an error</p>
  <p><code>binding reference of type ‘int&amp;&amp;’ to ‘std::remove_reference&lt;const int&amp;&gt;::type’ {aka ‘const int’} discards qualifiers</code></p>
  <p>Consuming from a vector works perfectly fine.
  I really do not understand where syntactic the difference would be between consuming from the set or the vector, as they work similar cocerning their iterators.</p>
  <p>I can make a Workaround <code>pops()</code>, however, I do not neccessarily see this as a intuitive solution.</p>
  <pre><code>
  #include &lt;vector&gt;
  #include &lt;set&gt;
  #include &lt;iostream&gt;
  
  class A {
   public:
      std::vector&lt;int&gt; intv_{1,2,3};
      std::set&lt;int&gt; ints_{1,2,3};
  
      int pops() {
          auto rslt = std::move(*ints_.begin());
          ints_.erase(ints_.begin());
          return rslt;
      }
  };
  
  using namespace std;
  
  void consume_int(bool dummy, int&amp;&amp; i) {
      cout &lt;&lt; i &lt;&lt; endl;
  }
  
  using namespace std;
  int main() {
      A a;
  
      consume_int(true, std::move( *(a.intv_.begin()) ));  //OK!
      a.intv_.erase(a.intv_.begin());
  
      consume_int(true, std::move( *a.ints_.begin() )); //FAIL to compile
      a.ints_.erase(a.ints_.begin());
  
      consume_int(true, std::move(a.pops())); //Workaround OK!
  
      return 0;
  }
  </code></pre>