title: C++11 random numbers and std::bind interact in unexpected way
body: <p>I am using GCC 4.6.3 and was trying to generate random numbers with the following code:</p>
  
  <pre><code>#include &lt;random&gt;
  #include &lt;functional&gt;
  
  int main()
  {
      std::mt19937 rng_engine;
  
      printf("With bind\n");
      for(int i = 0; i &lt; 5; ++i) {
          std::uniform_real_distribution&lt;double&gt; dist(0.0, 1.0);
          auto rng = std::bind(dist, rng_engine);
          printf("%g\n", rng());
      }
  
      printf("Without bind\n");
      for(int i = 0; i &lt; 5; ++i) {
          std::uniform_real_distribution&lt;double&gt; dist(0.0, 1.0);
          printf("%g\n", dist(rng_engine));
      }
  
      return 0;
  }
  </code></pre>
  
  <p>I expected both methods to generate a sequence of 5 random numbers.  Instead, this is what I actually get:</p>
  
  <pre><code>With bind
  0.135477
  0.135477
  0.135477
  0.135477
  0.135477
  Without bind
  0.135477
  0.835009
  0.968868
  0.221034
  0.308167
  </code></pre>
  
  <p>Is this a GCC bug?  Or is it some subtle issue having to do with std::bind?  If so, can you make any sense of the result?</p>
  
  <p>Thanks.</p>