Why not just use random_device? : <p>I am a bit confused about the c++11 random library.</p>

<p>What I understand: we need two separate concepts:</p>

<ul>
<li>random engine (which can be pseudo (need seed) or real)</li>
<li>distribution: it maps the numbers obtained from the engine to a specific interval, using a specific distribution.</li>
</ul>

<p>What I don't understand is why not just use this:</p>

<pre><code>std::random_device rd;
std::uniform_int_distribution&lt;int&gt; dist(1, 5);

// get random numbers with:
dist(rd);
</code></pre>

<p>As far as I can tell this works well.</p>

<p>Instead, this is what I found on most examples/sites/articles:</p>

<pre><code>std::random_device rd;
std::mt19937 e{rd()}; // or std::default_random_engine e{rd()};
std::uniform_int_distribution&lt;int&gt; dist{1, 5};

// get random numbers with:
dist(e);
</code></pre>

<p>I am not talking about special use, e.g. cryptography, just your basic getting started articles.</p>

<p>My suspicion is because <code>std::mt19937</code> (or <code>std::default_random_engine</code>) accepts a seed, it can be easier to debug by providing the same seed during a debug session.</p>

<p>Also, why not just:</p>

<pre><code>std::mt19937 e{std::random_device{}()};
</code></pre>
