P0935R0 Eradicating unnecessarily explicit default constructors
authorJonathan Wakely <jwakely@redhat.com>
Tue, 12 Jun 2018 19:10:55 +0000 (20:10 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 12 Jun 2018 19:10:55 +0000 (20:10 +0100)
Explicit default constructors are problematic, so this change removes
them from <random> and <ext/random>, as per P0935R0.

* include/bits/random.h (linear_congruential_engine)
(mersenne_twister_engine, subtract_with_carry_engine, random_device)
(uniform_real_distribution, normal_distribution)
(lognormal_distribution, gamma_distribution, chi_squared_distribution)
(cauchy_distribution, fisher_f_distribution, student_t_distribution)
(bernoulli_distribution, binomial_distribution,geometric_distribution)
(negative_binomial_distribution, exponential_distribution)
(weibull_distribution, extreme_value_distribution): Add non-explicit
default constructors. Remove default argument for first parameter of
explicit constructors.
(piecewise_constant_distribution, piecewise_linear_distribution):
Make default constructor non-explicit.
* include/bits/uniform_int_dist.h (uniform_int_distribution): Add
non-explicit default constructors. Remove default argument for first
parameter of explicit constructor.
(simd_fast_mersenne_twister_engine, beta_distribution)
(rice_distribution, nakagami_distribution, pareto_distribution)
(k_distribution, arcsine_distribution, hoyt_distribution)
(triangular_distribution, von_mises_distribution)
(hypergeometric_distribution, logistic_distribution)
(uniform_inside_sphere_distribution): Likewise.
(uniform_on_sphere_distribution): Make default constructor
non-explicit.
* testsuite/26_numerics/random/bernoulli_distribution/cons/default.cc:
Test for non-explicit default constructor. Fix references to standard.
* testsuite/26_numerics/random/binomial_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/cauchy_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/chi_squared_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/discrete_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/exponential_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/fisher_f_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/gamma_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/geometric_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/lognormal_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/negative_binomial_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/normal_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/piecewise_constant_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/piecewise_linear_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/poisson_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/student_t_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/uniform_int_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/uniform_real_distribution/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/weibull_distribution/cons/default.cc:
Likewise.
* testsuite/ext/random/arcsine_distribution/cons/default.cc: Likewise.
* testsuite/ext/random/beta_distribution/cons/default.cc: Likewise.
* testsuite/ext/random/hoyt_distribution/cons/default.cc: Likewise.
* testsuite/ext/random/hypergeometric_distribution/cons/default.cc:
Likewise.
* testsuite/ext/random/k_distribution/cons/default.cc: Likewise.
* testsuite/ext/random/logistic_distribution/cons/default.cc: Likewise.
* testsuite/ext/random/nakagami_distribution/cons/default.cc: Likewise.
* testsuite/ext/random/normal_mv_distribution/cons/default.cc:
Likewise.
* testsuite/ext/random/pareto_distribution/cons/default.cc: Likewise.
* testsuite/ext/random/rice_distribution/cons/default.cc: Likewise.
* testsuite/ext/random/triangular_distribution/cons/default.cc:
Likewise.
* testsuite/ext/random/uniform_inside_sphere_distribution/cons/default.cc:
Likewise.
* testsuite/ext/random/uniform_on_sphere_distribution/cons/default.cc:
Likewise.
* testsuite/ext/random/von_mises_distribution/cons/default.cc:
Likewise.
* testsuite/util/testsuite_common_types.h
(implicitly_default_constructible): New helper.

From-SVN: r261522

39 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/random.h
libstdc++-v3/include/bits/uniform_int_dist.h
libstdc++-v3/include/ext/random
libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/arcsine_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/hoyt_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/k_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/logistic_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/nakagami_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/pareto_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/rice_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/triangular_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/uniform_inside_sphere_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/uniform_on_sphere_distribution/cons/default.cc
libstdc++-v3/testsuite/ext/random/von_mises_distribution/cons/default.cc
libstdc++-v3/testsuite/util/testsuite_common_types.h

index 84bc4a79622aa93f33c5d1112f658e004b518f14..368a91ebf33591eb29dbe77938d05f51e06727fa 100644 (file)
@@ -1,3 +1,92 @@
+2018-06-12  Jonathan Wakely  <jwakely@redhat.com>
+
+       P0935R0 Eradicating unnecessarily explicit default constructors
+       * include/bits/random.h (linear_congruential_engine)
+       (mersenne_twister_engine, subtract_with_carry_engine, random_device)
+       (uniform_real_distribution, normal_distribution)
+       (lognormal_distribution, gamma_distribution, chi_squared_distribution)
+       (cauchy_distribution, fisher_f_distribution, student_t_distribution)
+       (bernoulli_distribution, binomial_distribution,geometric_distribution)
+       (negative_binomial_distribution, exponential_distribution)
+       (weibull_distribution, extreme_value_distribution): Add non-explicit
+       default constructors. Remove default argument for first parameter of
+       explicit constructors.
+       (piecewise_constant_distribution, piecewise_linear_distribution):
+       Make default constructor non-explicit.
+       * include/bits/uniform_int_dist.h (uniform_int_distribution): Add
+       non-explicit default constructors. Remove default argument for first
+       parameter of explicit constructor.
+       (simd_fast_mersenne_twister_engine, beta_distribution)
+       (rice_distribution, nakagami_distribution, pareto_distribution)
+       (k_distribution, arcsine_distribution, hoyt_distribution)
+       (triangular_distribution, von_mises_distribution)
+       (hypergeometric_distribution, logistic_distribution)
+       (uniform_inside_sphere_distribution): Likewise.
+       (uniform_on_sphere_distribution): Make default constructor
+       non-explicit.
+       * testsuite/26_numerics/random/bernoulli_distribution/cons/default.cc:
+       Test for non-explicit default constructor. Fix references to standard.
+       * testsuite/26_numerics/random/binomial_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/cauchy_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/chi_squared_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/discrete_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/exponential_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/fisher_f_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/gamma_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/geometric_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/lognormal_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/negative_binomial_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/normal_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/piecewise_constant_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/piecewise_linear_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/poisson_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/student_t_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/uniform_int_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/uniform_real_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/weibull_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/ext/random/arcsine_distribution/cons/default.cc: Likewise.
+       * testsuite/ext/random/beta_distribution/cons/default.cc: Likewise.
+       * testsuite/ext/random/hoyt_distribution/cons/default.cc: Likewise.
+       * testsuite/ext/random/hypergeometric_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/ext/random/k_distribution/cons/default.cc: Likewise.
+       * testsuite/ext/random/logistic_distribution/cons/default.cc: Likewise.
+       * testsuite/ext/random/nakagami_distribution/cons/default.cc: Likewise.
+       * testsuite/ext/random/normal_mv_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/ext/random/pareto_distribution/cons/default.cc: Likewise.
+       * testsuite/ext/random/rice_distribution/cons/default.cc: Likewise.
+       * testsuite/ext/random/triangular_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/ext/random/uniform_inside_sphere_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/ext/random/uniform_on_sphere_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/ext/random/von_mises_distribution/cons/default.cc:
+       Likewise.
+       * testsuite/util/testsuite_common_types.h
+       (implicitly_default_constructible): New helper.
+
 2018-06-08  Jonathan Wakely  <jwakely@redhat.com>
 
        * include/bits/ios_base.h (ios::Init::Init(const Init&))
index b76cfbb558e1d3bbd520dfcf2ccc65f43064fd0b..252b14d6d11a5e7d61ef08fc233111f5c925a5b3 100644 (file)
@@ -264,6 +264,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       static constexpr result_type modulus      = __m;
       static constexpr result_type default_seed = 1u;
 
+      /**
+       * @brief Constructs a %linear_congruential_engine random number
+       *        generator engine with seed 1.
+       */
+      linear_congruential_engine() : linear_congruential_engine(default_seed)
+      { }
+
       /**
        * @brief Constructs a %linear_congruential_engine random number
        *        generator engine with seed @p __s.  The default seed value
@@ -272,7 +279,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        * @param __s The initial seed value.
        */
       explicit
-      linear_congruential_engine(result_type __s = default_seed)
+      linear_congruential_engine(result_type __s)
       { seed(__s); }
 
       /**
@@ -504,9 +511,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       static constexpr result_type initialization_multiplier = __f;
       static constexpr result_type default_seed = 5489u;
 
-      // constructors and member function
+      // constructors and member functions
+
+      mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
+
       explicit
-      mersenne_twister_engine(result_type __sd = default_seed)
+      mersenne_twister_engine(result_type __sd)
       { seed(__sd); }
 
       /**
@@ -691,12 +701,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       static constexpr size_t      long_lag     = __r;
       static constexpr result_type default_seed = 19780503u;
 
+      subtract_with_carry_engine() : subtract_with_carry_engine(default_seed)
+      { }
+
       /**
-       * @brief Constructs an explicitly seeded % subtract_with_carry_engine
+       * @brief Constructs an explicitly seeded %subtract_with_carry_engine
        *        random number generator.
        */
       explicit
-      subtract_with_carry_engine(result_type __sd = default_seed)
+      subtract_with_carry_engine(result_type __sd)
       { seed(__sd); }
 
       /**
@@ -1590,24 +1603,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     // constructors, destructors and member functions
 
 #ifdef _GLIBCXX_USE_RANDOM_TR1
+    random_device() { _M_init("default"); }
 
     explicit
-    random_device(const std::string& __token = "default")
-    {
-      _M_init(__token);
-    }
+    random_device(const std::string& __token) { _M_init(__token); }
 
     ~random_device()
     { _M_fini(); }
-
 #else
+    random_device() { _M_init("mt19937"); }
 
     explicit
     random_device(const std::string& __token = "mt19937")
     { _M_init_pretr1(__token); }
-
-  public:
-
 #endif
 
     static constexpr result_type
@@ -1767,6 +1775,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       };
 
     public:
+      /**
+       * @brief Constructs a uniform_real_distribution object.
+       *
+       * The lower bound is set to 0.0 and the upper bound to 1.0
+       */
+      uniform_real_distribution() : uniform_real_distribution(0.0) { }
+
       /**
        * @brief Constructs a uniform_real_distribution object.
        *
@@ -1774,8 +1789,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        * @param __b [IN]  The upper bound of the distribution.
        */
       explicit
-      uniform_real_distribution(_RealType __a = _RealType(0),
-                               _RealType __b = _RealType(1))
+      uniform_real_distribution(_RealType __a, _RealType __b = _RealType(1))
       : _M_param(__a, __b)
       { }
 
@@ -1991,12 +2005,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       };
 
     public:
+      normal_distribution() : normal_distribution(0.0) { }
+
       /**
        * Constructs a normal distribution with parameters @f$mean@f$ and
        * standard deviation.
        */
       explicit
-      normal_distribution(result_type __mean = result_type(0),
+      normal_distribution(result_type __mean,
                          result_type __stddev = result_type(1))
       : _M_param(__mean, __stddev), _M_saved_available(false)
       { }
@@ -2205,9 +2221,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _RealType _M_s;
       };
 
+      lognormal_distribution() : lognormal_distribution(0.0) { }
+
       explicit
-      lognormal_distribution(_RealType __m = _RealType(0),
-                            _RealType __s = _RealType(1))
+      lognormal_distribution(_RealType __m, _RealType __s = _RealType(1))
       : _M_param(__m, __s), _M_nd()
       { }
 
@@ -2425,12 +2442,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       };
 
     public:
+      /**
+       * @brief Constructs a gamma distribution with parameters 1 and 1.
+       */
+      gamma_distribution() : gamma_distribution(1.0) { }
+
       /**
        * @brief Constructs a gamma distribution with parameters
        * @f$\alpha@f$ and @f$\beta@f$.
        */
       explicit
-      gamma_distribution(_RealType __alpha_val = _RealType(1),
+      gamma_distribution(_RealType __alpha_val,
                         _RealType __beta_val = _RealType(1))
       : _M_param(__alpha_val, __beta_val), _M_nd()
       { }
@@ -2630,8 +2652,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _RealType _M_n;
       };
 
+      chi_squared_distribution() : chi_squared_distribution(1) { }
+
       explicit
-      chi_squared_distribution(_RealType __n = _RealType(1))
+      chi_squared_distribution(_RealType __n)
       : _M_param(__n), _M_gd(__n / 2)
       { }
 
@@ -2856,9 +2880,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _RealType _M_b;
       };
 
+      cauchy_distribution() : cauchy_distribution(0.0) { }
+
       explicit
-      cauchy_distribution(_RealType __a = _RealType(0),
-                         _RealType __b = _RealType(1))
+      cauchy_distribution(_RealType __a, _RealType __b = 1.0)
       : _M_param(__a, __b)
       { }
 
@@ -3062,8 +3087,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _RealType _M_n;
       };
 
+      fisher_f_distribution() : fisher_f_distribution(1.0) { }
+
       explicit
-      fisher_f_distribution(_RealType __m = _RealType(1),
+      fisher_f_distribution(_RealType __m,
                            _RealType __n = _RealType(1))
       : _M_param(__m, __n), _M_gd_x(__m / 2), _M_gd_y(__n / 2)
       { }
@@ -3285,8 +3312,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _RealType _M_n;
       };
 
+      student_t_distribution() : student_t_distribution(1.0) { }
+
       explicit
-      student_t_distribution(_RealType __n = _RealType(1))
+      student_t_distribution(_RealType __n)
       : _M_param(__n), _M_nd(), _M_gd(__n / 2, 2)
       { }
 
@@ -3508,6 +3537,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     };
 
   public:
+    /**
+     * @brief Constructs a Bernoulli distribution with likelihood 0.5.
+     */
+    bernoulli_distribution() : bernoulli_distribution(0.5) { }
+
     /**
      * @brief Constructs a Bernoulli distribution with likelihood @p p.
      *
@@ -3515,7 +3549,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
      *                   Must be in the interval @f$[0, 1]@f$.
      */
     explicit
-    bernoulli_distribution(double __p = 0.5)
+    bernoulli_distribution(double __p)
     : _M_param(__p)
     { }
 
@@ -3739,10 +3773,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        bool   _M_easy;
       };
 
-      // constructors and member function
+      // constructors and member functions
+
+      binomial_distribution() : binomial_distribution(1) { }
+
       explicit
-      binomial_distribution(_IntType __t = _IntType(1),
-                           double __p = 0.5)
+      binomial_distribution(_IntType __t, double __p = 0.5)
       : _M_param(__t, __p), _M_nd()
       { }
 
@@ -3964,9 +4000,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        double _M_log_1_p;
       };
 
-      // constructors and member function
+      // constructors and member functions
+
+      geometric_distribution() : geometric_distribution(0.5) { }
+
       explicit
-      geometric_distribution(double __p = 0.5)
+      geometric_distribution(double __p)
       : _M_param(__p)
       { }
 
@@ -4166,8 +4205,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        double _M_p;
       };
 
+      negative_binomial_distribution() : negative_binomial_distribution(1) { }
+
       explicit
-      negative_binomial_distribution(_IntType __k = 1, double __p = 0.5)
+      negative_binomial_distribution(_IntType __k, double __p = 0.5)
       : _M_param(__k, __p), _M_gd(__k, (1.0 - __p) / __p)
       { }
 
@@ -4399,9 +4440,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #endif
       };
 
-      // constructors and member function
+      // constructors and member functions
+
+      poisson_distribution() : poisson_distribution(1.0) { }
+
       explicit
-      poisson_distribution(double __mean = 1.0)
+      poisson_distribution(double __mean)
       : _M_param(__mean), _M_nd()
       { }
 
@@ -4610,12 +4654,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       };
 
     public:
+      /**
+       * @brief Constructs an exponential distribution with inverse scale
+       *        parameter 1.0
+       */
+      exponential_distribution() : exponential_distribution(1.0) { }
+
       /**
        * @brief Constructs an exponential distribution with inverse scale
        *        parameter @f$\lambda@f$.
        */
       explicit
-      exponential_distribution(const result_type& __lambda = result_type(1))
+      exponential_distribution(_RealType __lambda)
       : _M_param(__lambda)
       { }
 
@@ -4820,9 +4870,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _RealType _M_b;
       };
 
+      weibull_distribution() : weibull_distribution(1.0) { }
+
       explicit
-      weibull_distribution(_RealType __a = _RealType(1),
-                          _RealType __b = _RealType(1))
+      weibull_distribution(_RealType __a, _RealType __b = _RealType(1))
       : _M_param(__a, __b)
       { }
 
@@ -5028,9 +5079,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _RealType _M_b;
       };
 
+      extreme_value_distribution() : extreme_value_distribution(0.0) { }
+
       explicit
-      extreme_value_distribution(_RealType __a = _RealType(0),
-                                _RealType __b = _RealType(1))
+      extreme_value_distribution(_RealType __a, _RealType __b = _RealType(1))
       : _M_param(__a, __b)
       { }
 
@@ -5496,7 +5548,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        std::vector<double> _M_cp;
       };
 
-      explicit
       piecewise_constant_distribution()
       : _M_param()
       { }
@@ -5769,7 +5820,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        std::vector<double> _M_m;
       };
 
-      explicit
       piecewise_linear_distribution()
       : _M_param()
       { }
index 64d4445aa33e259494f9168fc77988adbf206c87..3b6d504466df9a7bf4b68fd434d24626e3f1aa4b 100644 (file)
@@ -98,11 +98,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       };
 
     public:
+      /**
+       * @brief Constructs a uniform distribution object.
+       */
+      uniform_int_distribution() : uniform_int_distribution(0) { }
+
       /**
        * @brief Constructs a uniform distribution object.
        */
       explicit
-      uniform_int_distribution(_IntType __a = 0,
+      uniform_int_distribution(_IntType __a,
                           _IntType __b = std::numeric_limits<_IntType>::max())
       : _M_param(__a, __b)
       { }
index 7e931865af33a43d1151b0d44eaa4ae6bec0e5b5..3c714f5672cf18b9919262fd20bc261f75100587 100644 (file)
@@ -96,9 +96,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                                                        / sizeof(result_type));
       static constexpr result_type default_seed = 5489u;
 
-      // constructors and member function
+      // constructors and member functions
+
+      simd_fast_mersenne_twister_engine()
+      : simd_fast_mersenne_twister_engine(default_seed)
+      { }
+
       explicit
-      simd_fast_mersenne_twister_engine(result_type __sd = default_seed)
+      simd_fast_mersenne_twister_engine(result_type __sd)
       { seed(__sd); }
 
       template<typename _Sseq, typename = _If_seed_seq<_Sseq>>
@@ -454,12 +459,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       };
 
     public:
+      beta_distribution() : beta_distribution(1.0) { }
+
       /**
        * @brief Constructs a beta distribution with parameters
        * @f$\alpha@f$ and @f$\beta@f$.
        */
       explicit
-      beta_distribution(_RealType __alpha_val = _RealType(1),
+      beta_distribution(_RealType __alpha_val,
                        _RealType __beta_val = _RealType(1))
       : _M_param(__alpha_val, __beta_val)
       { }
@@ -998,9 +1005,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        * @brief Constructors.
+       * @{
        */
+
+      rice_distribution() : rice_distribution(0) { }
+
       explicit
-      rice_distribution(result_type __nu_val = result_type(0),
+      rice_distribution(result_type __nu_val,
                        result_type __sigma_val = result_type(1))
       : _M_param(__nu_val, __sigma_val),
        _M_ndx(__nu_val, __sigma_val),
@@ -1014,6 +1025,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _M_ndy(result_type(0), __p.sigma())
       { }
 
+      // @}
+
       /**
        * @brief Resets the distribution state.
        */
@@ -1244,9 +1257,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        * @brief Constructors.
+       * @{
        */
+
+      nakagami_distribution() : nakagami_distribution(1) { }
+
       explicit
-      nakagami_distribution(result_type __mu_val = result_type(1),
+      nakagami_distribution(result_type __mu_val,
                            result_type __omega_val = result_type(1))
       : _M_param(__mu_val, __omega_val),
        _M_gd(__mu_val, __omega_val / __mu_val)
@@ -1258,6 +1275,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _M_gd(__p.mu(), __p.omega() / __p.mu())
       { }
 
+      // @}
+
       /**
        * @brief Resets the distribution state.
        */
@@ -1481,9 +1500,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        * @brief Constructors.
+       * @{
        */
+
+      pareto_distribution() : pareto_distribution(1) { }
+
       explicit
-      pareto_distribution(result_type __alpha_val = result_type(1),
+      pareto_distribution(result_type __alpha_val,
                          result_type __mu_val = result_type(1))
       : _M_param(__alpha_val, __mu_val),
        _M_ud()
@@ -1495,6 +1518,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _M_ud()
       { }
 
+      // @}
+
       /**
        * @brief Resets the distribution state.
        */
@@ -1731,9 +1756,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        * @brief Constructors.
+       * @{
        */
+
+      k_distribution() : k_distribution(1) { }
+
       explicit
-      k_distribution(result_type __lambda_val = result_type(1),
+      k_distribution(result_type __lambda_val,
                     result_type __mu_val = result_type(1),
                     result_type __nu_val = result_type(1))
       : _M_param(__lambda_val, __mu_val, __nu_val),
@@ -1748,6 +1777,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _M_gd2(__p.nu(), __p.mu() / __p.nu())
       { }
 
+      // @}
+
       /**
        * @brief Resets the distribution state.
        */
@@ -1965,10 +1996,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        * @brief Constructors.
+       * :{
        */
+
+      arcsine_distribution() : arcsine_distribution(0) { }
+
       explicit
-      arcsine_distribution(result_type __a = result_type(0),
-                          result_type __b = result_type(1))
+      arcsine_distribution(result_type __a, result_type __b = result_type(1))
       : _M_param(__a, __b),
        _M_ud(-1.5707963267948966192313216916397514L,
              +1.5707963267948966192313216916397514L)
@@ -1981,6 +2015,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
              +1.5707963267948966192313216916397514L)
       { }
 
+      // @}
+
       /**
        * @brief Resets the distribution state.
        */
@@ -2207,10 +2243,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        * @brief Constructors.
+       * @{
        */
+
+      hoyt_distribution() : hoyt_distribution(0.5) { }
+
       explicit
-      hoyt_distribution(result_type __q = result_type(0.5L),
-                       result_type __omega = result_type(1))
+      hoyt_distribution(result_type __q, result_type __omega = result_type(1))
       : _M_param(__q, __omega),
        _M_ad(result_type(0.5L) * (result_type(1) + __q * __q),
              result_type(0.5L) * (result_type(1) + __q * __q)
@@ -2459,12 +2498,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _RealType _M_f_bc_ac;
       };
 
+      triangular_distribution() : triangular_distribution(0.0) { }
+
       /**
        * @brief Constructs a triangle distribution with parameters
        * @f$ a @f$, @f$ b @f$ and @f$ c @f$.
        */
       explicit
-      triangular_distribution(result_type __a = result_type(0),
+      triangular_distribution(result_type __a,
                              result_type __b = result_type(0.5),
                              result_type __c = result_type(1))
       : _M_param(__a, __b, __c)
@@ -2668,6 +2709,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     public:
       /** The type of the range of the distribution. */
       typedef _RealType result_type;
+
       /** Parameter type. */
       struct param_type
       {
@@ -2711,14 +2753,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        _RealType _M_r;
       };
 
+      von_mises_distribution() : von_mises_distribution(0.0) { }
+
       /**
        * @brief Constructs a von Mises distribution with parameters
        * @f$\mu@f$ and @f$\kappa@f$.
        */
       explicit
-      von_mises_distribution(result_type __mu = result_type(0),
+      von_mises_distribution(result_type __mu,
                             result_type __kappa = result_type(1))
-       : _M_param(__mu, __kappa)
+      : _M_param(__mu, __kappa)
       { }
 
       explicit
@@ -2956,9 +3000,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        result_type _M_n;
       };
 
-      // constructors and member function
+      // constructors and member functions
+
+      hypergeometric_distribution() : hypergeometric_distribution(10) { }
+
       explicit
-      hypergeometric_distribution(result_type __N = 10, result_type __K = 5,
+      hypergeometric_distribution(result_type __N, result_type __K = 5,
                                  result_type __n = 1)
       : _M_param{__N, __K, __n}
       { }
@@ -3209,10 +3256,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        * @brief Constructors.
+       * @{
        */
+      logistic_distribution() : logistic_distribution(0.0) { }
+
       explicit
-      logistic_distribution(result_type __a = result_type(0),
-                           result_type __b = result_type(1))
+      logistic_distribution(result_type __a, result_type __b = result_type(1))
       : _M_param(__a, __b)
       { }
 
@@ -3221,6 +3270,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       : _M_param(__p)
       { }
 
+      // @}
+
       /**
        * @brief Resets the distribution state.
        */
@@ -3401,7 +3452,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       /**
        * @brief Constructs a uniform on sphere distribution.
        */
-      explicit
       uniform_on_sphere_distribution()
       : _M_param(), _M_nd()
       { }
@@ -3609,9 +3659,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       /**
        * @brief Constructors.
+       * @{
        */
+
+      uniform_inside_sphere_distribution()
+      : uniform_inside_sphere_distribution(1.0)
+      { }
+
       explicit
-      uniform_inside_sphere_distribution(_RealType __radius = _RealType(1))
+      uniform_inside_sphere_distribution(_RealType __radius)
       : _M_param(__radius), _M_uosd()
       { }
 
@@ -3620,6 +3676,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       : _M_param(__p), _M_uosd()
       { }
 
+      // @}
+
       /**
        * @brief Resets the distribution state.
        */
index 46c5af0f2a462fcd6e3cb2852f043e9093cb223d..42096c0fd34f95ab888b41bb156e58a952514254 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.2.1 Class template bernoulli_distribution [rand.dist.bern.bernoulli]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.3.1 Class bernoulli_distribution [rand.dist.bern.bernoulli]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -35,8 +37,15 @@ test01()
   VERIFY( u.max() == std::numeric_limits<bool>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::bernoulli_distribution>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index 74a7a786064cb4cf1fd36225606f6a059a7006ad..6cf82f1b86c481a56fdb71e66944ee70b6eb48ad 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.2.2 Class template binomial_distribution [rand.dist.bern.bin]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.3.2 Class template binomial_distribution [rand.dist.bern.bin]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -36,8 +38,15 @@ test01()
   VERIFY( u.max() == u.t() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::binomial_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index 04bc15c5182217ec2dfde17c5c36c5a280cefc54..c1c71ce2ce796839b192ef324051edf9c4e997fd 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.4.4 Class template cauchy_distribution [rand.dist.norm.cauchy]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.5.4 Class template cauchy_distribution [rand.dist.norm.cauchy]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,8 +39,15 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::cauchy_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index df985c3e653d3dd5094da3edcde1fbf8e187f5d4..8ecf7c0ce4ad0d9e3d39e02824b26c3a0bbb5421 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.4.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.5.3 Class template chi_squared_distribution [rand.dist.norm.chisq]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -36,8 +38,15 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::chi_squared_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index 6a82f46a686edf76133269c030f5730279a99c1c..0e837ed1046a6f33e45883330b43b31b02f69e4d 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.5.1 Class template discrete_distribution [rand.dist.samp.discrete]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.6.1 Class template discrete_distribution [rand.dist.samp.discrete]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -35,8 +37,15 @@ test01()
   VERIFY( probablility[0] == 1.0 );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::discrete_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index 00b1f003c61473e3915da42f27f7b0235519340d..7285bd351a33b81235564d6ec5cd28de927c4d3c 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.3.2 Class template exponential_distribution [rand.dist.pois.exp]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.4.2 Class template exponential_distribution [rand.dist.pois.exp]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -36,8 +38,15 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::exponential_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index db3dc19dbe4a3c422f54d725e489326c54f99e9c..f9187fc7586ef33604d8dd98772e21f17e07e898 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.3.5 Class template extreme_value_distribution [rand.dist.pois.extreme]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.4.5 Class template extreme_value_distribution [rand.dist.pois.extreme]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,8 +39,15 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::extreme_value_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index 16c2077b7da0c7d00d75fed2a9ce97c10f884aff..3032adea816faf78744b70a26fd8327572c0b28c 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.4.5 Class template fisher_f_distribution [rand.dist.norm.f]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.5.5 Class template fisher_f_distribution [rand.dist.norm.f]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,8 +39,15 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::fisher_f_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index 8274d45d669e52079455f0a2828d558d9c338e07..84d2bb73502a44ed36ccc3290a9d6161420b3cab 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.3.3 Class template gamma_distribution [rand.dist.pois.gamma]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.4.3 Class template gamma_distribution [rand.dist.pois.gamma]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,8 +39,15 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::gamma_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index 35221f313fea57b6b7f7fb984a9be3799974f455..d16a2f06db2590f20dc03a88bc3cec49d1d8dc8c 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.2.3 Class template geometric_distribution [rand.dist.bern.geo]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.3.3 Class template geometric_distribution [rand.dist.bern.geo]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -36,8 +38,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::geometric_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index b6d57737cfa99cd8b0c0375e5aa7df33b8b60419..5512905cf612e0af06e11fbb0dd99d644c5008da 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.4.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.5.2 Class template lognormal_distribution [rand.dist.norm.lognormal]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,8 +39,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::lognormal_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index f6e2f1d7798fe4ee77acc7d4d837d5b9d5e30799..32847dfe69977b452d351622222ddf18bbdee5af 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.2.4 Class template negative_binomial_distribution [rand.dist.bern.negbin]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.3.4 Class template negative_binomial_distribution [rand.dist.bern.negbin]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,8 +39,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::negative_binomial_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index 941927ba0b483f60f6627a94e17f701bc503b92c..dd3e0d2165507a500fad1ba88f38fd32e501dd7c 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.4.1 Class template normal_distribution [rand.dist.norm.normal]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.5.1 Class template normal_distribution [rand.dist.norm.normal]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,8 +39,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::normal_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index 40eb9da422d311274555ec486c131f9d49c22c0c..84507b45ae7cd8c3d8cf14fcab0848693ce2166a 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.5.2 Class template piecewise_constant_distribution [rand.dist.samp.pconst]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.6.2 Class template piecewise_constant_distribution [rand.dist.samp.pconst]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -39,8 +41,16 @@ test01()
   VERIFY( density[0] == 1.0 );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::piecewise_constant_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index 11fbc2c537e0c1e10a123c5ae3a963cdb4397cf4..e439adf2a3f915a19702e6c477a9998fce4baeb8 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.5.3 Class template piecewise_linear_distribution [rand.dist.samp.plinear]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.6.3 Class template piecewise_linear_distribution [rand.dist.samp.plinear]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -40,8 +42,16 @@ test01()
   VERIFY( density[1] == 1.0 );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::piecewise_linear_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index 71d0ca0f048673bed7e1c99fbacd9cae2c0ff911..c357581785ee826b637882841d3cf995013d5ec7 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.3.1 Class template poisson_distribution [rand.dist.pois.poisson]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.4.1 Class template poisson_distribution [rand.dist.pois.poisson]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -36,8 +38,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::poisson_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index 3524a45b9ff272f68bbf9a3bae8abc2f2ffb281b..06c7deef0949c8617b567834f99ac525a08b043c 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.4.6 Class template student_t_distribution [rand.dist.norm.t]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.5.6 Class template student_t_distribution [rand.dist.norm.t]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -36,8 +38,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::student_t_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index ccfbe26f3c08629d7e924d0b5479b862a34d4542..8774e660e59a930475695802fd8e89714ecad219 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.1.1 Class template uniform_int_distribution [rand.dist.uni.int]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.2.1 Class template uniform_int_distribution [rand.dist.uni.int]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <limits>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,8 +39,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<int>::max() );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::uniform_int_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index 662f898109908f85af0e014605df748f357e2a6a..6a47a4dc47362f907428830047f9942aaaf2e4d0 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.1.1 Class template uniform_real_distribution [rand.dist.uni.real]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.2.2 Class template uniform_real_distribution [rand.dist.uni.real]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -36,8 +38,16 @@ test01()
   VERIFY( u.max() == 1.0 );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::uniform_real_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index 369805eaed94960c61319cc92e5cb089bde78120..96db58f2ca60ff790b0c5b3e4cf7c7559348bc06 100644 (file)
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.8.3.4 Class template weibull_distribution [rand.dist.pois.weibull]
-// 26.4.2.4 Concept RandomNumberDistribution [rand.concept.dist]
+// C++11
+// 26.5.8.4.4 Class template weibull_distribution [rand.dist.pois.weibull]
+// 26.5.1.6 random number distribution requirements [rand.req.dist]
 
 #include <random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,8 +39,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
-int main()
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<std::weibull_distribution<>>();
+}
+
+int
+main()
 {
   test01();
-  return 0;
+  test02();
 }
index 3b6ed697c7294fe83cbaa5f757eaab322c4862f6..76b5166caf59f4527d958849e3ff7483f6e283b1 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -33,9 +34,16 @@ test01()
   VERIFY( u.max() == 1.0 );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::arcsine_distribution<>>();
+}
+
 int
 main()
 {
   test01();
-  return 0;
+  test02();
 }
index 375d6c538b3be25980ca289b752320db092c97d6..9675a557a9a2279856bf8da95751c1998dadc224 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -34,8 +35,15 @@ test01()
   VERIFY( u.max() == 1.0 );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::beta_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index c4c9a9c0961c39a5e8e582d777a731d2071ca7af..53022345aea1a55927a304faa9ef2c951bc99065 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -34,9 +35,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::hoyt_distribution<>>();
+}
+
 int
 main()
 {
   test01();
-  return 0;
+  test02();
 }
index 659db01dc76ec991940570d732e5b20aca3b6c06..d4078d4df37693155c80432fb53f2d0ab13c0a46 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,9 +38,16 @@ test01()
   VERIFY( u.max() == 1 );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::hypergeometric_distribution<>>();
+}
+
 int
 main()
 {
   test01();
-  return 0;
+  test02();
 }
index 6e06683c26e4198cc8a9fd1fb455ade86a50b8b2..cc11ccb27018f95c70f4688626bff5dd94860d3c 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -38,9 +39,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::k_distribution<>>();
+}
+
 int
 main()
 {
   test01();
-  return 0;
+  test02();
 }
index 6d90278540281eb91b59447db0e32b695e0afc1a..3d7db75524d57427bb8d76a4519e252e4519f2ca 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -38,9 +39,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::logistic_distribution<>>();
+}
+
 int
 main()
 {
   test01();
-  return 0;
+  test02();
 }
index 9bc6e2c41f8fcb8d3ee1d7fd480641756b39b560..ea473f2fca5faf01366df3ec85baeeb8413fb8da 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,9 +38,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::nakagami_distribution<>>();
+}
+
 int
 main()
 {
   test01();
-  return 0;
+  test02();
 }
index f691e13022bd69554a1dea7b975a9d6eae61e1ac..c209a8d89dcca264ca8136ba75368d7057031553 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -40,8 +41,15 @@ test01()
   VERIFY( u.max()[1] == std::numeric_limits<result_type::value_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::normal_mv_distribution<2>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index d320a6be0705afde74eabe0861bcdb50ee89656b..368d7da19101319c36ca1898276c537242659a74 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,9 +38,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::pareto_distribution<>>();
+}
+
 int
 main()
 {
   test01();
-  return 0;
+  test02();
 }
index 5a3b92787ce87e0aa7696ff30d0c3a65a30da6d8..1483f87000a6ae52e9a98bb4289c8dd511ef58ed 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -37,9 +38,16 @@ test01()
   VERIFY( u.max() == std::numeric_limits<result_type>::max() );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::rice_distribution<>>();
+}
+
 int
 main()
 {
   test01();
-  return 0;
+  test02();
 }
index 8f33e3acdef356bcd6136fc979d70e54c1a79e05..c7c6aba59364d12c0f4a77d295efa917a09bce9d 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -35,8 +36,15 @@ test01()
   VERIFY( u.max() == 1.0 );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::triangular_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index 7a7c04d6455ee4946a04dd6431cc3f6b31651a4a..e15a12d79ae43e46c432398c0a9387afc457a8b2 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -35,9 +36,16 @@ test01()
   __gnu_cxx::uniform_inside_sphere_distribution<5, float> u5;
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::uniform_inside_sphere_distribution<2>>();
+}
+
 int
 main()
 {
   test01();
-  return 0;
+  test02();
 }
index 446893dd1228d419e22bab3310c980c8f3b14659..8aa81b328a2417742ea3a4bb75632d85f5c89fb0 100644 (file)
@@ -24,6 +24,7 @@
 // 26.5.1.6 Random number distribution requirements [rand.req.dist]
 
 #include <ext/random>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -34,9 +35,16 @@ test01()
   __gnu_cxx::uniform_on_sphere_distribution<5, float> u5;
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::uniform_on_sphere_distribution<2>>();
+}
+
 int
 main()
 {
   test01();
-  return 0;
+  test02();
 }
index 9ae700257c9fa7d5299cd3dce7c1bdc6302a3ff4..1a4784d49d9bd649be603a512e648c8d31d89e8a 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <ext/random>
 #include <testsuite_hooks.h>
+#include <testsuite_common_types.h>
 
 void
 test01()
@@ -34,8 +35,15 @@ test01()
   VERIFY( u.max() == __gnu_cxx::__math_constants<double>::__pi );
 }
 
+void
+test02()
+{
+  __gnu_test::implicitly_default_constructible test;
+  test.operator()<__gnu_cxx::von_mises_distribution<>>();
+}
+
 int main()
 {
   test01();
-  return 0;
+  test02();
 }
index 1069a1a997bd3e17c7764ea32245b214a9fe9e74..2e977b57cf123ae178a3ca98e4f537f3e7a13067 100644 (file)
@@ -687,6 +687,26 @@ namespace __gnu_test
   };
 
 #if __cplusplus >= 201103L
+  // Generator to test non-explicit default constructor.
+  struct implicitly_default_constructible
+  {
+    template<typename _Tp>
+      void
+      operator()()
+      {
+       struct _Concept
+       {
+         struct Aggregate { _Tp v; };
+
+         void __constraint()
+         { Aggregate __v __attribute__((unused)) = { }; }
+       };
+
+       void (_Concept::*__x)() __attribute__((unused))
+         = &_Concept::__constraint;
+      }
+  };
+
   // Generator to test default constructor.
   struct constexpr_default_constructible
   {