OSDN Git Service

2012-11-02 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Nov 2012 11:18:13 +0000 (11:18 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Nov 2012 11:18:13 +0000 (11:18 +0000)
PR libstdc++/55169
* include/bits/random.h: Remove all uses of param().

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@193093 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/random.h

index b3302bf..a752c0e 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-02  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR libstdc++/55169
+       * include/bits/random.h: Remove all uses of param().
+
 2012-11-01   Haakan Younes  <hyounes@google.com>
             Paolo Carlini  <paolo.carlini@oracle.com>
 
index a0ee556..1e8caa0 100644 (file)
@@ -1719,28 +1719,28 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-        { return this->operator()(__urng, this->param()); }
+        { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng,
                   const param_type& __p);
 
+      /**
+       * @brief Return true if two uniform integer distributions have
+       *        the same parameters.
+       */
+      friend bool
+      operator==(const uniform_int_distribution& __d1,
+                const uniform_int_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
+    private:
       param_type _M_param;
     };
 
   /**
    * @brief Return true if two uniform integer distributions have
-   *        the same parameters.
-   */
-  template<typename _IntType>
-    inline bool
-    operator==(const std::uniform_int_distribution<_IntType>& __d1,
-              const std::uniform_int_distribution<_IntType>& __d2)
-    { return __d1.param() == __d2.param(); }
-
-  /**
-   * @brief Return true if two uniform integer distributions have
    *        different parameters.
    */
   template<typename _IntType>
@@ -1894,7 +1894,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-        { return this->operator()(__urng, this->param()); }
+        { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
@@ -1906,22 +1906,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          return (__aurng() * (__p.b() - __p.a())) + __p.a();
        }
 
+      /**
+       * @brief Return true if two uniform real distributions have
+       *        the same parameters.
+       */
+      friend bool
+      operator==(const uniform_real_distribution& __d1,
+                const uniform_real_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
     private:
       param_type _M_param;
     };
 
   /**
    * @brief Return true if two uniform real distributions have
-   *        the same parameters.
-   */
-  template<typename _IntType>
-    inline bool
-    operator==(const std::uniform_real_distribution<_IntType>& __d1,
-              const std::uniform_real_distribution<_IntType>& __d2)
-    { return __d1.param() == __d2.param(); }
-
-  /**
-   * @brief Return true if two uniform real distributions have
    *        different parameters.
    */
   template<typename _IntType>
@@ -2088,7 +2087,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
@@ -2261,7 +2260,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
@@ -2277,7 +2276,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       friend bool
       operator==(const lognormal_distribution& __d1,
                 const lognormal_distribution& __d2)
-      { return (__d1.param() == __d2.param()
+      { return (__d1._M_param == __d2._M_param
                && __d1._M_nd == __d2._M_nd); }
 
       /**
@@ -2454,7 +2453,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
@@ -2469,7 +2468,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       friend bool
       operator==(const gamma_distribution& __d1,
                 const gamma_distribution& __d2)
-      { return (__d1.param() == __d2.param()
+      { return (__d1._M_param == __d2._M_param
                && __d1._M_nd == __d2._M_nd); }
 
       /**
@@ -2633,7 +2632,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       friend bool
       operator==(const chi_squared_distribution& __d1,
                 const chi_squared_distribution& __d2)
-      { return __d1.param() == __d2.param() && __d1._M_gd == __d2._M_gd; }
+      { return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
 
       /**
        * @brief Inserts a %chi_squared_distribution random number distribution
@@ -2788,29 +2787,28 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng,
                   const param_type& __p);
 
+      /**
+       * @brief Return true if two Cauchy distributions have
+       *        the same parameters.
+       */
+      friend bool
+      operator==(const cauchy_distribution& __d1,
+                const cauchy_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
     private:
       param_type _M_param;
     };
 
   /**
    * @brief Return true if two Cauchy distributions have
-   *        the same parameters.
-   */
-  template<typename _RealType>
-    inline bool
-    operator==(const std::cauchy_distribution<_RealType>& __d1,
-              const std::cauchy_distribution<_RealType>& __d2)
-    { return __d1.param() == __d2.param(); }
-
-  /**
-   * @brief Return true if two Cauchy distributions have
    *        different parameters.
    */
   template<typename _RealType>
@@ -2985,7 +2983,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       friend bool
       operator==(const fisher_f_distribution& __d1,
                 const fisher_f_distribution& __d2)
-      { return (__d1.param() == __d2.param()
+      { return (__d1._M_param == __d2._M_param
                && __d1._M_gd_x == __d2._M_gd_x
                && __d1._M_gd_y == __d2._M_gd_y); }
 
@@ -3158,7 +3156,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       friend bool
       operator==(const student_t_distribution& __d1,
                 const student_t_distribution& __d2)
-      { return (__d1.param() == __d2.param()
+      { return (__d1._M_param == __d2._M_param
                && __d1._M_nd == __d2._M_nd && __d1._M_gd == __d2._M_gd); }
 
       /**
@@ -3318,7 +3316,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     template<typename _UniformRandomNumberGenerator>
       result_type
       operator()(_UniformRandomNumberGenerator& __urng)
-      { return this->operator()(__urng, this->param()); }
+      { return this->operator()(__urng, _M_param); }
 
     template<typename _UniformRandomNumberGenerator>
       result_type
@@ -3333,21 +3331,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        return false;
       }
 
+    /**
+     * @brief Return true if two Bernoulli distributions have
+     *        the same parameters.
+     */
+    friend bool
+    operator==(const bernoulli_distribution& __d1,
+              const bernoulli_distribution& __d2)
+    { return __d1._M_param == __d2._M_param; }
+
   private:
     param_type _M_param;
   };
 
   /**
    * @brief Return true if two Bernoulli distributions have
-   *        the same parameters.
-   */
-  inline bool
-  operator==(const std::bernoulli_distribution& __d1,
-            const std::bernoulli_distribution& __d2)
-  { return __d1.param() == __d2.param(); }
-
-  /**
-   * @brief Return true if two Bernoulli distributions have
    *        different parameters.
    */
   inline bool
@@ -3518,7 +3516,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
@@ -3534,9 +3532,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
         operator==(const binomial_distribution& __d1,
                   const binomial_distribution& __d2)
 #ifdef _GLIBCXX_USE_C99_MATH_TR1
-       { return __d1.param() == __d2.param() && __d1._M_nd == __d2._M_nd; }
+       { return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
 #else
-        { return __d1.param() == __d2.param(); }
+        { return __d1._M_param == __d2._M_param; }
 #endif
 
       /**
@@ -3701,29 +3699,28 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng,
                   const param_type& __p);
 
+      /**
+       * @brief Return true if two geometric distributions have
+       *        the same parameters.
+       */
+      friend bool
+      operator==(const geometric_distribution& __d1,
+                const geometric_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
     private:
       param_type _M_param;
     };
 
   /**
    * @brief Return true if two geometric distributions have
-   *        the same parameters.
-   */
-  template<typename _IntType>
-    inline bool
-    operator==(const std::geometric_distribution<_IntType>& __d1,
-              const std::geometric_distribution<_IntType>& __d2)
-    { return __d1.param() == __d2.param(); }
-
-  /**
-   * @brief Return true if two geometric distributions have
    *        different parameters.
    */
   template<typename _IntType>
@@ -3889,7 +3886,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       friend bool
       operator==(const negative_binomial_distribution& __d1,
                 const negative_binomial_distribution& __d2)
-      { return __d1.param() == __d2.param() && __d1._M_gd == __d2._M_gd; }
+      { return __d1._M_param == __d2._M_param && __d1._M_gd == __d2._M_gd; }
 
       /**
        * @brief Inserts a %negative_binomial_distribution random
@@ -4057,7 +4054,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
@@ -4073,9 +4070,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       operator==(const poisson_distribution& __d1,
                 const poisson_distribution& __d2)
 #ifdef _GLIBCXX_USE_C99_MATH_TR1
-      { return __d1.param() == __d2.param() && __d1._M_nd == __d2._M_nd; }
+      { return __d1._M_param == __d2._M_param && __d1._M_nd == __d2._M_nd; }
 #else
-      { return __d1.param() == __d2.param(); }
+      { return __d1._M_param == __d2._M_param; }
 #endif
 
       /**
@@ -4238,7 +4235,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-        { return this->operator()(__urng, this->param()); }
+        { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
@@ -4250,21 +4247,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          return -std::log(result_type(1) - __aurng()) / __p.lambda();
        }
 
+      /**
+       * @brief Return true if two exponential distributions have the same
+       *        parameters.
+       */
+      friend bool
+      operator==(const exponential_distribution& __d1,
+                const exponential_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
     private:
       param_type _M_param;
     };
 
   /**
-   * @brief Return true if two exponential distributions have the same
-   *        parameters.
-   */
-  template<typename _RealType>
-    inline bool
-    operator==(const std::exponential_distribution<_RealType>& __d1,
-              const std::exponential_distribution<_RealType>& __d2)
-    { return __d1.param() == __d2.param(); }
-
-  /**
    * @brief Return true if two exponential distributions have different
    *        parameters.
    */
@@ -4418,28 +4414,27 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng,
                   const param_type& __p);
 
+      /**
+       * @brief Return true if two Weibull distributions have the same
+       *        parameters.
+       */
+      friend bool
+      operator==(const weibull_distribution& __d1,
+                const weibull_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
     private:
       param_type _M_param;
     };
 
    /**
-    * @brief Return true if two Weibull distributions have the same
-    *        parameters.
-    */
-  template<typename _RealType>
-    inline bool
-    operator==(const std::weibull_distribution<_RealType>& __d1,
-              const std::weibull_distribution<_RealType>& __d2)
-    { return __d1.param() == __d2.param(); }
-
-   /**
     * @brief Return true if two Weibull distributions have different
     *        parameters.
     */
@@ -4593,28 +4588,27 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng,
                   const param_type& __p);
 
+      /**
+       * @brief Return true if two extreme value distributions have the same
+       *        parameters.
+       */
+      friend bool
+      operator==(const extreme_value_distribution& __d1,
+                const extreme_value_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
     private:
       param_type _M_param;
     };
 
   /**
-    * @brief Return true if two extreme value distributions have the same
-    *        parameters.
-   */
-  template<typename _RealType>
-    inline bool
-    operator==(const std::extreme_value_distribution<_RealType>& __d1,
-              const std::extreme_value_distribution<_RealType>& __d2)
-    { return __d1.param() == __d2.param(); }
-
-  /**
     * @brief Return true if two extreme value distributions have different
     *        parameters.
    */
@@ -4794,7 +4788,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
@@ -4802,6 +4796,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                   const param_type& __p);
 
       /**
+       * @brief Return true if two discrete distributions have the same
+       *        parameters.
+       */
+      friend bool
+      operator==(const discrete_distribution& __d1,
+                const discrete_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
+      /**
        * @brief Inserts a %discrete_distribution random number distribution
        * @p __x into the output stream @p __os.
        *
@@ -4837,16 +4840,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 
   /**
-    * @brief Return true if two discrete distributions have the same
-    *        parameters.
-    */
-  template<typename _IntType>
-    inline bool
-    operator==(const std::discrete_distribution<_IntType>& __d1,
-              const std::discrete_distribution<_IntType>& __d2)
-    { return __d1.param() == __d2.param(); }
-
-  /**
     * @brief Return true if two discrete distributions have different
     *        parameters.
     */
@@ -5032,7 +5025,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
@@ -5040,6 +5033,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                   const param_type& __p);
 
       /**
+       * @brief Return true if two piecewise constant distributions have the
+       *        same parameters.
+       */
+      friend bool
+      operator==(const piecewise_constant_distribution& __d1,
+                const piecewise_constant_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
+      /**
        * @brief Inserts a %piecewise_constan_distribution random
        *        number distribution @p __x into the output stream @p __os.
        *
@@ -5076,16 +5078,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 
   /**
-    * @brief Return true if two piecewise constant distributions have the
-    *        same parameters.
-   */
-  template<typename _RealType>
-    inline bool
-    operator==(const std::piecewise_constant_distribution<_RealType>& __d1,
-              const std::piecewise_constant_distribution<_RealType>& __d2)
-    { return __d1.param() == __d2.param(); }
-
-  /**
     * @brief Return true if two piecewise constant distributions have 
     *        different parameters.
    */
@@ -5274,7 +5266,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _UniformRandomNumberGenerator>
        result_type
        operator()(_UniformRandomNumberGenerator& __urng)
-       { return this->operator()(__urng, this->param()); }
+       { return this->operator()(__urng, _M_param); }
 
       template<typename _UniformRandomNumberGenerator>
        result_type
@@ -5282,6 +5274,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                   const param_type& __p);
 
       /**
+       * @brief Return true if two piecewise linear distributions have the
+       *        same parameters.
+       */
+      friend bool
+      operator==(const piecewise_linear_distribution& __d1,
+                const piecewise_linear_distribution& __d2)
+      { return __d1._M_param == __d2._M_param; }
+
+      /**
        * @brief Inserts a %piecewise_linear_distribution random number
        *        distribution @p __x into the output stream @p __os.
        *
@@ -5318,16 +5319,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 
   /**
-    * @brief Return true if two piecewise linear distributions have the
-    *        same parameters.
-   */
-  template<typename _RealType>
-    inline bool
-    operator==(const std::piecewise_linear_distribution<_RealType>& __d1,
-              const std::piecewise_linear_distribution<_RealType>& __d2)
-    { return __d1.param() == __d2.param(); }
-
-  /**
     * @brief Return true if two piecewise linear distributions have
     *        different parameters.
    */