title: C++ TR1: how to use the normal_distribution?
body: <p>I'm trying to use the <strong>C++ STD TechnicalReport1</strong> extensions to generate numbers following a normal distribution, but this code (adapted from <a href="http://www.johndcook.com/cpp_TR1_random.html#normal" rel="nofollow noreferrer">this article</a>):    </p>
  
  <pre><code>mt19937 eng;
  eng.seed(SEED);
  
  normal_distribution&lt;double&gt; dist;
  // XXX if I use the one below it exits the for loop
  // uniform_int&lt;int&gt; dist(1, 52);
  
  for (unsigned int i = 0; i &lt; 1000; ++i) {
    cout &lt;&lt; "Generating " &lt;&lt; i &lt;&lt; "-th value" &lt;&lt; endl;
    cout &lt;&lt; dist(eng) &lt;&lt; endl;
  }
  </code></pre>
  
  <p>only prints 1 "Generating..." log message, then <em>never exits the for loop</em>! If I use the distribution I commented out instead, it terminates, so I'm wondering what I'm doing wrong. Any idea?</p>
  
  <p>Thanks a lot!</p>