title: ISO C++ forbids declaration of 'uniform_real_distribution' with no type
body: <pre><code>#ifndef _RNG_H
  #define _RNG_H
  
  #include &lt;random&gt;
  
  class RNG {
  public:
    RNG() :
      _generator(_default_seed) { }
  
    RNG(uint32_t seed):
      _generator(seed) { }
  
    double operator()();
  
  private:
    std::mt19937 _generator;
    static std::uniform_real_distribution&lt;&gt; _urd;
    static const int _default_seed;
  };
  
  #endif // _RNG_H
  </code></pre>
  
  <p>I am trying to encapsulate the random number generator used with a wrapper class. But when trying to compile the above code I get the following error:</p>
  
  <p>rng.h:37: error: ISO C++ forbids declaration of 'uniform_real_distribution' with no type</p>
  
  <p>rng.h:37: error: invalid use of '::'</p>
  
  <p>rng.h:37: error: expected ';' before '&lt;' token</p>
  
  <p>But I am just trying to follow the example as given in <a href="http://en.cppreference.com/w/cpp/numeric/random/uniform_real_distribution" rel="nofollow">http://en.cppreference.com/w/cpp/numeric/random/uniform_real_distribution</a></p>