title: Shuffle vector in C++
body: <p>I have a std::vector that I need to shuffle. It is only ~20 members in size. It also needs to produce a different shuffle every time the program is run.</p>
  
  <p>Right now I am using <code>random_shuffle</code>, however, it gives the same result every time the program is run. I tried that <code>srand(unsigned(time(NULL)));</code> that was suggested in <a href="https://stackoverflow.com/questions/6926433/how-to-shuffle-a-stdvector-in-c">this</a> thread, however, that didn't work on my platform.</p>
  
  <p>If possible, I want to use only standard code.</p>
  
  <p>Edit: Here is my implementation:</p>
  
  <pre><code>vector&lt;Tile&gt;gameTiles;
  gameTiles.push_back(Tile(0,0));
  gameTiles.push_back(Tile(0,1));
  gameTiles.push_back(Tile(0,2));
  gameTiles.push_back(Tile(0,3));
  gameTiles.push_back(Tile(0,4));
  //etc. ~20 member
  
  random_shuffle(gameTiles.begin(), gameTiles.end());
  </code></pre>