title: Error assignment of read-only location '__result.std::_Rb_tree_const_iterator<_Tp>::operator*<long long int>()'
body: <p>Some error while doing xor to all elements of a <code>std::set</code>.
  below is partial code. Don't know much about <code>std::transform</code>. help pls :) </p>
  
  <pre><code>    #include&lt;bits/stdc++.h&gt;
      #define ll long long int 
  
      using namespace std;
  
      int main()
      {
         set&lt;ll&gt; e1 ;//suppose i had inserted few elements in it!
         ll x2;
         cin&gt;&gt;x2;
         //now i want to xor all elements of set with x2.
         std::transform(std::begin(e1), std::end(e1), std::begin(e1), [=](ll x){return x2^x;});
         return 0;
       }
  </code></pre>
  
  <p>Error message: </p>
  
  <blockquote>
    <p>Error assignment of read-only location
    '__result.std::_Rb_tree_const_iterator&lt;_Tp>::operator*()'</p>
  </blockquote>