title: Do std::random_device and std::mt19937 follow an uniform distribution?
body: <p>I'm trying to convert this line of matlab in C++: <code>rp = randperm(p);</code></p>
  
  <p>Following the <code>randperm</code> <a href="http://www.mathworks.com/help/matlab/ref/randperm.html" rel="noreferrer">documentation</a>: </p>
  
  <blockquote>
    <p>randperm uses the same random number generator as rand</p>
  </blockquote>
  
  <p>And in <code>rand</code> <a href="http://www.mathworks.com/help/matlab/ref/rand.html" rel="noreferrer">page</a>:</p>
  
  <blockquote>
    <p>rand returns a single uniformly distributed random number</p>
  </blockquote>
  
  <p>So <code>rand</code> follows an uniform distribution. My C++ code is based on:</p>
  
  <pre><code>std::random_device rd;
  std::mt19937 g(rd());
  std::shuffle(... , ... ,g);
  </code></pre>
  
  <p>My question is: the code above follows an uniform distribution? If not, how to do so?</p>