title: Cannot use std::iota with std::set
body: <p>I'd like to create a set of a range of numbers: 0, 1, 2, 3, 4, ...
  The following code fails to compile:</p>
  
  <pre><code>std::set&lt;int&gt; s;
  std::iota(s.begin(), s.end(), 0);
  </code></pre>
  
  <p>with the following error message:</p>
  
  <pre><code>error C3892: '_First' : you cannot assign to a variable that is const
  </code></pre>
  
  <p>The compiler is VC++2012. The same code works fine for a vector. How should I use it with a set?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I can see now that my code is meaningless, because there's no set size specified.</p>
  
  <p>Here are some more details about my problem. </p>
  
  <p>I have a set containing SOME numbers from [0, N] range. In my application I need to calculate set difference many times for such sets. N is fixed.</p>
  
  <p>Let's say <code>N = 5</code> and the first set is <code>s1 = {0, 3, 4}</code>. I need to calculate set difference <code>{0, 1, 2, 3, 4} \ {0, 3, 4} == {1, 2}</code>. This operation should be performed quite often for different sets, so I thought that I could create a set with all numbers (<code>{0, 1, 2, 3, 4}</code> in this case) and use <code>std::set_difference</code> to calculate those differences.</p>