title: Errors with xutility (<chrono> <random> C++ standard libraries)
body: <p>I am having an issue writing a simple random number generator using the standard  and  in Microsoft Visual Studio 2013. When I attempt to compile, it throws a bunch of errors related to the xutility file. I had a bunch of similar errors thrown when I attempted to use the BOOST libraries to accomplish the same thing, so it MAY be an issue with MSVC.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;chrono&gt;
  #include &lt;random&gt;
  
  using std::cout;
  using std::endl;
  
  auto seed = std::chrono::high_resolution_clock::now();
  
  int main()
  {
      std::uniform_int_distribution&lt;&gt; randNum(1, 6);
  
      cout &lt;&lt; randNum(seed) &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>Here are the errors it is throwing:</p>
  
  <p>Error   1   error C2039: 'result_type' : is not a member of 'std::chrono::time_point'    e:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 3256</p>
  
  <p>Error   2   error C2146: syntax error : missing ';' before identifier '_Ty1'    e:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 3256</p>
  
  <p>Error   3   error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   e:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 3256</p>
  
  <p>Error   4   error C2065: '_Ty1' : undeclared identifier e:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 3258</p>
  
  <p>Error   5   error C2070: 'unknown-type': illegal sizeof operand e:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 3258</p>
  
  <p>Error   6   error C2065: '_Ty1' : undeclared identifier e:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 3259</p>
  
  <p>Error   7   error C2923: 'std::_If' : '_Ty1' is not a valid template type argument for parameter '_Ty2' e:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 3259</p>
  
  <p>Error   8   error C2955: 'std::_If' : use of class template requires template argument list e:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility 3259</p>
  
  <p>Here is the section of code from xutility that seems to be causing trouble:</p>
  
  <pre><code>    // TEMPLATE CLASS _Rng_from_urng
  template&lt;class _Diff, class _Urng&gt;
      class _Rng_from_urng
      {   // wrap a URNG as an RNG
  public:
      typedef typename make_unsigned&lt;_Diff&gt;::type _Ty0;
      typedef typename _Urng::result_type _Ty1;
  
      typedef typename _If&lt;sizeof (_Ty1) &lt; sizeof (_Ty0),
          _Ty0, _Ty1&gt;::type _Udiff;
  </code></pre>
  
  <p>The class has a LOT more code after this point, but the errors are happening in these last two lines.</p>
  
  <p>By the way, I spent several hours querying different searches to try and find an answer before posting here with no usable results, though that could easily be a deficiency on my part.</p>
  
  <p>Thanks!</p>
  
  <p>With Sebastion's help, all previous errors were resolved, however a new error has been generated:</p>
  
  <p>Modified code:</p>
  
  <pre><code>    std::default_random_engine engine(seed);
  
      cout &lt;&lt; randNum(engine) &lt;&lt; endl;
  </code></pre>
  
  <p>Error:</p>
  
  <p>Error   1   error C2039: 'generate' : is not a member of 'std::chrono::time_point'   e:\program files (x86)\microsoft visual studio 12.0\vc\include\random   1618</p>