title: C++, copy set to vector
body: <p>I need to copy <code>std::set</code> to <code>std::vector</code>:</p>
  
  <pre><code>std::set &lt;double&gt; input;
  input.insert(5);
  input.insert(6);
  
  std::vector &lt;double&gt; output;
  std::copy(input.begin(), input.end(), output.begin()); //Error: Vector iterator not dereferencable
  </code></pre>
  
  <p>Where is the problem?</p>