title: Efficiently moving contents of std::unordered_set to std::vector
body: <p>In my code I have a <code>std::unordered_set</code> and I need to move the data into a <code>std::vector</code>. I'm using the <code>std::unordered_set</code> while getting the data to ensure only unique values are stored prior to converting to a <code>std::vector</code>. My question is how do I move the contents to the <code>std::vector</code> the most efficiently? I don't need the <code>std::unordered_set</code> after the data is moved. I currently have the following:</p>
  
  <pre><code>std::copy(set.begin(), set.end(), std::back_inserter(vector));
  </code></pre>