title: c++ random number generation not random
body: <p>I'm trying to perform a random shuffle of a vector using Visual Studio 2013 C++. The following is the code that I have</p>
  
  <pre><code>    static void shuffle(vector&lt;int&gt;&amp; a){
      int N = a.size();
  
      unsigned long long seed = chrono::system_clock::now().time_since_epoch().count();
      default_random_engine generator(seed);
  
      for (int i = 0; i &lt; N; i++){
          uniform_int_distribution&lt;int&gt; distribution(0,(N-1)-i);
          int r = i + distribution(generator);
          swap(a[i], a[r]);
      }
  }
  </code></pre>
  
  <p>My problem is when I call this method multiple times in succession the shuffle is not random. What could be wrong with the code?</p>
  
  <p>Any help would be much appreciated.</p>