Implement resolutions of LWG 2399, 2400 and 2401.
[gcc.git] / libstdc++-v3 / include / bits / random.h
index 5613bdf5ec01a7841c4a8f06db48f37a5d72fcf2..774f726d0a6410db71f3c75936f3aebf22042c3c 100644 (file)
@@ -1,6 +1,6 @@
 // random number generation -*- C++ -*-
 
-// Copyright (C) 2009-2013 Free Software Foundation, Inc.
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -164,6 +164,8 @@ _GLIBCXX_END_NAMESPACE_VERSION
     template<typename _Engine, typename _DInputType>
       struct _Adaptor
       {
+       static_assert(std::is_floating_point<_DInputType>::value,
+                     "template argument not a floating point type");
 
       public:
        _Adaptor(_Engine& __g)
@@ -659,10 +661,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *
    * The size of the state is @f$r@f$
    * and the maximum period of the generator is @f$(m^r - m^s - 1)@f$.
-   *
-   * @var _M_x     The state of the generator.  This is a ring buffer.
-   * @var _M_carry The carry.
-   * @var _M_p     Current index of x(i - r).
    */
   template<typename _UIntType, size_t __w, size_t __s, size_t __r>
     class subtract_with_carry_engine
@@ -794,9 +792,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UIntType1, size_t __w1, size_t __s1, size_t __r1,
               typename _CharT, typename _Traits>
        friend std::basic_ostream<_CharT, _Traits>&
-       operator<<(std::basic_ostream<_CharT, _Traits>&,
+       operator<<(std::basic_ostream<_CharT, _Traits>& __os,
                   const std::subtract_with_carry_engine<_UIntType1, __w1,
-                  __s1, __r1>&);
+                  __s1, __r1>& __x);
 
       /**
        * @brief Extracts the current state of a % subtract_with_carry_engine
@@ -813,14 +811,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UIntType1, size_t __w1, size_t __s1, size_t __r1,
               typename _CharT, typename _Traits>
        friend std::basic_istream<_CharT, _Traits>&
-       operator>>(std::basic_istream<_CharT, _Traits>&,
+       operator>>(std::basic_istream<_CharT, _Traits>& __is,
                   std::subtract_with_carry_engine<_UIntType1, __w1,
-                  __s1, __r1>&);
+                  __s1, __r1>& __x);
 
     private:
+      /// The state of the generator.  This is a ring buffer.
       _UIntType  _M_x[long_lag];
-      _UIntType  _M_carry;
-      size_t     _M_p;
+      _UIntType  _M_carry;             ///< The carry
+      size_t     _M_p;                 ///< Current index of x(i - r).
     };
 
   /**