From 977ac63eab69884aa8d4bd317d7c1b80627d75ef Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 14 Jun 2018 14:32:53 +0100 Subject: [PATCH] P0935R0 Eradicating unnecessarily explicit default constructors The param_type constructors of each random number distribution should mirror the constructors of the distribution itself, so make the same changes w.r.t explicit on default constructors. * include/bits/random.h (uniform_real_distribution::param_type) (normal_distribution::param_type, lognormal_distribution::param_type) (gamma_distribution::param_type, chi_squared_distribution::param_type) (cauchy_distribution::param_type, fisher_f_distribution::param_type) (student_t_distribution::param_type) (bernoulli_distribution::param_type) (binomial_distribution::param_type) (geometric_distribution::param_type) (negative_binomial_distribution::param_type) (poisson_distribution::param_type) (exponential_distribution::param_type) (weibull_distribution::param_type) (extreme_value_distribution::param_type): Add non-explicit default constructors. Remove default argument for first parameter of explicit constructors. * include/bits/uniform_int_dist.h (uniform_int_distribution::param_type): Likewise. * include/ext/random (beta_distribution::param_type, rice_distribution::param_type) (nakagami_distribution::param_type, pareto_distribution::param_type) (k_distribution::param_type, arcsine_distribution::param_type) (hoyt_distribution::param_type, triangular_distribution::param_type) (von_mises_distribution::param_type) (hypergeometric_distribution::param_type) (logistic_distribution::param_type) (uniform_inside_sphere_distribution::param_type): Likewise. (uniform_on_sphere_distribution::param_type): Make default constructor non-explicit. * testsuite/26_numerics/random/bernoulli_distribution/cons/default.cc: Test param_type for non-explicit default constructor. * 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. From-SVN: r261592 --- libstdc++-v3/ChangeLog | 92 +++++++++++++++++++ libstdc++-v3/include/bits/random.h | 72 ++++++++++----- libstdc++-v3/include/bits/uniform_int_dist.h | 8 +- libstdc++-v3/include/ext/random | 58 ++++++++---- .../bernoulli_distribution/cons/default.cc | 1 + .../binomial_distribution/cons/default.cc | 1 + .../cauchy_distribution/cons/default.cc | 1 + .../chi_squared_distribution/cons/default.cc | 1 + .../discrete_distribution/cons/default.cc | 1 + .../exponential_distribution/cons/default.cc | 1 + .../cons/default.cc | 1 + .../fisher_f_distribution/cons/default.cc | 1 + .../random/gamma_distribution/cons/default.cc | 1 + .../geometric_distribution/cons/default.cc | 1 + .../lognormal_distribution/cons/default.cc | 1 + .../cons/default.cc | 1 + .../normal_distribution/cons/default.cc | 1 + .../cons/default.cc | 1 + .../cons/default.cc | 1 + .../poisson_distribution/cons/default.cc | 1 + .../student_t_distribution/cons/default.cc | 1 + .../uniform_int_distribution/cons/default.cc | 1 + .../uniform_real_distribution/cons/default.cc | 1 + .../weibull_distribution/cons/default.cc | 1 + .../arcsine_distribution/cons/default.cc | 1 + .../random/beta_distribution/cons/default.cc | 1 + .../random/hoyt_distribution/cons/default.cc | 1 + .../cons/default.cc | 1 + .../ext/random/k_distribution/cons/default.cc | 1 + .../logistic_distribution/cons/default.cc | 1 + .../nakagami_distribution/cons/default.cc | 1 + .../normal_mv_distribution/cons/default.cc | 1 + .../pareto_distribution/cons/default.cc | 1 + .../random/rice_distribution/cons/default.cc | 1 + .../triangular_distribution/cons/default.cc | 1 + .../cons/default.cc | 1 + .../cons/default.cc | 1 + .../von_mises_distribution/cons/default.cc | 1 + 38 files changed, 217 insertions(+), 47 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 490dd247b1d..738b7acc8f2 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,95 @@ +2018-06-14 Jonathan Wakely + + P0935R0 Eradicating unnecessarily explicit default constructors + * include/bits/random.h (uniform_real_distribution::param_type) + (normal_distribution::param_type, lognormal_distribution::param_type) + (gamma_distribution::param_type, chi_squared_distribution::param_type) + (cauchy_distribution::param_type, fisher_f_distribution::param_type) + (student_t_distribution::param_type) + (bernoulli_distribution::param_type) + (binomial_distribution::param_type) + (geometric_distribution::param_type) + (negative_binomial_distribution::param_type) + (poisson_distribution::param_type) + (exponential_distribution::param_type) + (weibull_distribution::param_type) + (extreme_value_distribution::param_type): Add non-explicit default + constructors. Remove default argument for first parameter of explicit + constructors. + * include/bits/uniform_int_dist.h + (uniform_int_distribution::param_type): Likewise. + * include/ext/random + (beta_distribution::param_type, rice_distribution::param_type) + (nakagami_distribution::param_type, pareto_distribution::param_type) + (k_distribution::param_type, arcsine_distribution::param_type) + (hoyt_distribution::param_type, triangular_distribution::param_type) + (von_mises_distribution::param_type) + (hypergeometric_distribution::param_type) + (logistic_distribution::param_type) + (uniform_inside_sphere_distribution::param_type): Likewise. + (uniform_on_sphere_distribution::param_type): Make default constructor + non-explicit. + * testsuite/26_numerics/random/bernoulli_distribution/cons/default.cc: + Test param_type for non-explicit default constructor. + * 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. + 2018-06-14 Daniel Trebbien Jonathan Wakely diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h index 252b14d6d11..738c62fccd1 100644 --- a/libstdc++-v3/include/bits/random.h +++ b/libstdc++-v3/include/bits/random.h @@ -1745,9 +1745,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef uniform_real_distribution<_RealType> distribution_type; + param_type() : param_type(0) { } + explicit - param_type(_RealType __a = _RealType(0), - _RealType __b = _RealType(1)) + param_type(_RealType __a, _RealType __b = _RealType(1)) : _M_a(__a), _M_b(__b) { __glibcxx_assert(_M_a <= _M_b); @@ -1974,9 +1975,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef normal_distribution<_RealType> distribution_type; + param_type() : param_type(0.0) { } + explicit - param_type(_RealType __mean = _RealType(0), - _RealType __stddev = _RealType(1)) + param_type(_RealType __mean, _RealType __stddev = _RealType(1)) : _M_mean(__mean), _M_stddev(__stddev) { __glibcxx_assert(_M_stddev > _RealType(0)); @@ -2194,9 +2196,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef lognormal_distribution<_RealType> distribution_type; + param_type() : param_type(0.0) { } + explicit - param_type(_RealType __m = _RealType(0), - _RealType __s = _RealType(1)) + param_type(_RealType __m, _RealType __s = _RealType(1)) : _M_m(__m), _M_s(__s) { } @@ -2405,9 +2408,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef gamma_distribution<_RealType> distribution_type; friend class gamma_distribution<_RealType>; + param_type() : param_type(1.0) { } + explicit - param_type(_RealType __alpha_val = _RealType(1), - _RealType __beta_val = _RealType(1)) + param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1)) : _M_alpha(__alpha_val), _M_beta(__beta_val) { __glibcxx_assert(_M_alpha > _RealType(0)); @@ -2631,8 +2635,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef chi_squared_distribution<_RealType> distribution_type; + param_type() : param_type(1) { } + explicit - param_type(_RealType __n = _RealType(1)) + param_type(_RealType __n) : _M_n(__n) { } @@ -2853,9 +2859,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef cauchy_distribution<_RealType> distribution_type; + param_type() : param_type(0) { } + explicit - param_type(_RealType __a = _RealType(0), - _RealType __b = _RealType(1)) + param_type(_RealType __a, _RealType __b = _RealType(1)) : _M_a(__a), _M_b(__b) { } @@ -3060,9 +3067,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef fisher_f_distribution<_RealType> distribution_type; + param_type() : param_type(1) { } + explicit - param_type(_RealType __m = _RealType(1), - _RealType __n = _RealType(1)) + param_type(_RealType __m, _RealType __n = _RealType(1)) : _M_m(__m), _M_n(__n) { } @@ -3291,8 +3299,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef student_t_distribution<_RealType> distribution_type; + param_type() : param_type(1) { } + explicit - param_type(_RealType __n = _RealType(1)) + param_type(_RealType __n) : _M_n(__n) { } @@ -3513,8 +3523,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef bernoulli_distribution distribution_type; + param_type() : param_type(0.5) { } + explicit - param_type(double __p = 0.5) + param_type(double __p) : _M_p(__p) { __glibcxx_assert((_M_p >= 0.0) && (_M_p <= 1.0)); @@ -3732,8 +3744,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef binomial_distribution<_IntType> distribution_type; friend class binomial_distribution<_IntType>; + param_type() : param_type(1) { } + explicit - param_type(_IntType __t = _IntType(1), double __p = 0.5) + param_type(_IntType __t, double __p = 0.5) : _M_t(__t), _M_p(__p) { __glibcxx_assert((_M_t >= _IntType(0)) @@ -3970,8 +3984,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef geometric_distribution<_IntType> distribution_type; friend class geometric_distribution<_IntType>; + param_type() : param_type(0.5) { } + explicit - param_type(double __p = 0.5) + param_type(double __p) : _M_p(__p) { __glibcxx_assert((_M_p > 0.0) && (_M_p < 1.0)); @@ -4177,8 +4193,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef negative_binomial_distribution<_IntType> distribution_type; + param_type() : param_type(1) { } + explicit - param_type(_IntType __k = 1, double __p = 0.5) + param_type(_IntType __k, double __p = 0.5) : _M_k(__k), _M_p(__p) { __glibcxx_assert((_M_k > 0) && (_M_p > 0.0) && (_M_p <= 1.0)); @@ -4407,8 +4425,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef poisson_distribution<_IntType> distribution_type; friend class poisson_distribution<_IntType>; + param_type() : param_type(1.0) { } + explicit - param_type(double __mean = 1.0) + param_type(double __mean) : _M_mean(__mean) { __glibcxx_assert(_M_mean > 0.0); @@ -4630,8 +4650,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef exponential_distribution<_RealType> distribution_type; + param_type() : param_type(1.0) { } + explicit - param_type(_RealType __lambda = _RealType(1)) + param_type(_RealType __lambda) : _M_lambda(__lambda) { __glibcxx_assert(_M_lambda > _RealType(0)); @@ -4843,9 +4865,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef weibull_distribution<_RealType> distribution_type; + param_type() : param_type(1.0) { } + explicit - param_type(_RealType __a = _RealType(1), - _RealType __b = _RealType(1)) + param_type(_RealType __a, _RealType __b = _RealType(1.0)) : _M_a(__a), _M_b(__b) { } @@ -5052,9 +5075,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef extreme_value_distribution<_RealType> distribution_type; + param_type() : param_type(0.0) { } + explicit - param_type(_RealType __a = _RealType(0), - _RealType __b = _RealType(1)) + param_type(_RealType __a, _RealType __b = _RealType(1.0)) : _M_a(__a), _M_b(__b) { } diff --git a/libstdc++-v3/include/bits/uniform_int_dist.h b/libstdc++-v3/include/bits/uniform_int_dist.h index 3b6d504466d..f339f62a668 100644 --- a/libstdc++-v3/include/bits/uniform_int_dist.h +++ b/libstdc++-v3/include/bits/uniform_int_dist.h @@ -68,9 +68,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef uniform_int_distribution<_IntType> distribution_type; + param_type() : param_type(0) { } + explicit - param_type(_IntType __a = 0, - _IntType __b = std::numeric_limits<_IntType>::max()) + param_type(_IntType __a, + _IntType __b = numeric_limits<_IntType>::max()) : _M_a(__a), _M_b(__b) { __glibcxx_assert(_M_a <= _M_b); @@ -108,7 +110,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ explicit uniform_int_distribution(_IntType __a, - _IntType __b = std::numeric_limits<_IntType>::max()) + _IntType __b = numeric_limits<_IntType>::max()) : _M_param(__a, __b) { } diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random index 3c714f5672c..7b2d1eaba71 100644 --- a/libstdc++-v3/include/ext/random +++ b/libstdc++-v3/include/ext/random @@ -424,9 +424,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef beta_distribution<_RealType> distribution_type; friend class beta_distribution<_RealType>; + param_type() : param_type(1) { } + explicit - param_type(_RealType __alpha_val = _RealType(1), - _RealType __beta_val = _RealType(1)) + param_type(_RealType __alpha_val, _RealType __beta_val = _RealType(1)) : _M_alpha(__alpha_val), _M_beta(__beta_val) { __glibcxx_assert(_M_alpha > _RealType(0)); @@ -972,7 +973,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef rice_distribution distribution_type; - param_type(result_type __nu_val = result_type(0), + param_type() : param_type(0) { } + + param_type(result_type __nu_val, result_type __sigma_val = result_type(1)) : _M_nu(__nu_val), _M_sigma(__sigma_val) { @@ -1224,7 +1227,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef nakagami_distribution distribution_type; - param_type(result_type __mu_val = result_type(1), + param_type() : param_type(1) { } + + param_type(result_type __mu_val, result_type __omega_val = result_type(1)) : _M_mu(__mu_val), _M_omega(__omega_val) { @@ -1467,7 +1472,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef pareto_distribution distribution_type; - param_type(result_type __alpha_val = result_type(1), + param_type() : param_type(1) { } + + param_type(result_type __alpha_val, result_type __mu_val = result_type(1)) : _M_alpha(__alpha_val), _M_mu(__mu_val) { @@ -1712,7 +1719,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef k_distribution distribution_type; - param_type(result_type __lambda_val = result_type(1), + param_type() : param_type(1) { } + + param_type(result_type __lambda_val, result_type __mu_val = result_type(1), result_type __nu_val = result_type(1)) : _M_lambda(__lambda_val), _M_mu(__mu_val), _M_nu(__nu_val) @@ -1964,8 +1973,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef arcsine_distribution distribution_type; - param_type(result_type __a = result_type(0), - result_type __b = result_type(1)) + param_type() : param_type(0) { } + + param_type(result_type __a, result_type __b = result_type(1)) : _M_a(__a), _M_b(__b) { __glibcxx_assert(_M_a <= _M_b); @@ -2210,8 +2220,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef hoyt_distribution distribution_type; - param_type(result_type __q = result_type(0.5L), - result_type __omega = result_type(1)) + param_type() : param_type(0.5) { } + + param_type(result_type __q, result_type __omega = result_type(1)) : _M_q(__q), _M_omega(__omega) { __glibcxx_assert(_M_q > result_type(0)); @@ -2450,8 +2461,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { friend class triangular_distribution<_RealType>; + param_type() : param_type(0) { } + explicit - param_type(_RealType __a = _RealType(0), + param_type(_RealType __a, _RealType __b = _RealType(0.5), _RealType __c = _RealType(1)) : _M_a(__a), _M_b(__b), _M_c(__c) @@ -2715,9 +2728,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { friend class von_mises_distribution<_RealType>; + param_type() : param_type(0) { } + explicit - param_type(_RealType __mu = _RealType(0), - _RealType __kappa = _RealType(1)) + param_type(_RealType __mu, _RealType __kappa = _RealType(1)) : _M_mu(__mu), _M_kappa(__kappa) { const _RealType __pi = __gnu_cxx::__math_constants<_RealType>::__pi; @@ -2958,8 +2972,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef hypergeometric_distribution<_UIntType> distribution_type; friend class hypergeometric_distribution<_UIntType>; + param_type() : param_type(10) { } + explicit - param_type(result_type __N = 10, result_type __K = 5, + param_type(result_type __N, result_type __K = 5, result_type __n = 1) : _M_N{__N}, _M_K{__K}, _M_n{__n} { @@ -3224,8 +3240,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { typedef logistic_distribution distribution_type; - param_type(result_type __a = result_type(0), - result_type __b = result_type(1)) + param_type() : param_type(0) { } + + explicit + param_type(result_type __a, result_type __b = result_type(1)) : _M_a(__a), _M_b(__b) { __glibcxx_assert(_M_b > result_type(0)); @@ -3436,9 +3454,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** Parameter type. */ struct param_type { - explicit - param_type() - { } + param_type() { } friend bool operator==(const param_type&, const param_type&) @@ -3634,8 +3650,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION = uniform_inside_sphere_distribution<_Dimen, _RealType>; friend class uniform_inside_sphere_distribution<_Dimen, _RealType>; + param_type() : param_type(1.0) { } + explicit - param_type(_RealType __radius = _RealType(1)) + param_type(_RealType __radius) : _M_radius(__radius) { __glibcxx_assert(_M_radius > _RealType(0)); diff --git a/libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/cons/default.cc index 42096c0fd34..2d5cb074ea3 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/bernoulli_distribution/cons/default.cc @@ -42,6 +42,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()(); + test.operator()(); } int main() diff --git a/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/cons/default.cc index 6cf82f1b86c..b5d616e8761 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/binomial_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/default.cc index c1c71ce2ce7..5bcf183b3dc 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/cauchy_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/cons/default.cc index 8ecf7c0ce4a..bdd397f1ec8 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/chi_squared_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/cons/default.cc index 0e837ed1046..909986c7ea7 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/discrete_distribution/cons/default.cc @@ -42,6 +42,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/default.cc index 7285bd351a3..0edd542a581 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/exponential_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc index f9187fc7586..124ed8d6967 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/extreme_value_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/cons/default.cc index 3032adea816..44324eab403 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/fisher_f_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/cons/default.cc index 84d2bb73502..50f59337c0a 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/gamma_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/cons/default.cc index d16a2f06db2..a6f1244b859 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/geometric_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/cons/default.cc index 5512905cf61..3e6cd142d78 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/lognormal_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/cons/default.cc index 32847dfe699..8f74de953ac 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/negative_binomial_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/default.cc index dd3e0d21655..0c2b84ecc83 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/normal_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/default.cc index 84507b45ae7..a90f87beca8 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/piecewise_constant_distribution/cons/default.cc @@ -46,6 +46,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/default.cc index e439adf2a3f..7db4e3f0313 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/piecewise_linear_distribution/cons/default.cc @@ -47,6 +47,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/cons/default.cc index c357581785e..82b6a1cd1c1 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/poisson_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/default.cc index 06c7deef094..9bdba65984c 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/student_t_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/cons/default.cc index 8774e660e59..0774a147f7e 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/uniform_int_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/cons/default.cc index 6a47a4dc473..85a697f73a6 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/cons/default.cc index 96db58f2ca6..4bb2fb72eba 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/weibull_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()>(); + test.operator()::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/arcsine_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/arcsine_distribution/cons/default.cc index 76b5166caf5..fc06991fa93 100644 --- a/libstdc++-v3/testsuite/ext/random/arcsine_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/arcsine_distribution/cons/default.cc @@ -39,6 +39,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::arcsine_distribution<>>(); + test.operator()<__gnu_cxx::arcsine_distribution<>::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc index 9675a557a9a..3514796ba7e 100644 --- a/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc @@ -40,6 +40,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::beta_distribution<>>(); + test.operator()<__gnu_cxx::beta_distribution<>::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/ext/random/hoyt_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/hoyt_distribution/cons/default.cc index 53022345aea..1e11a90a811 100644 --- a/libstdc++-v3/testsuite/ext/random/hoyt_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/hoyt_distribution/cons/default.cc @@ -40,6 +40,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::hoyt_distribution<>>(); + test.operator()<__gnu_cxx::hoyt_distribution<>::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/cons/default.cc index d4078d4df37..06d9432f27e 100644 --- a/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::hypergeometric_distribution<>>(); + test.operator()<__gnu_cxx::hypergeometric_distribution<>::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/k_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/k_distribution/cons/default.cc index cc11ccb2701..f6677c78216 100644 --- a/libstdc++-v3/testsuite/ext/random/k_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/k_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::k_distribution<>>(); + test.operator()<__gnu_cxx::k_distribution<>::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/logistic_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/logistic_distribution/cons/default.cc index 3d7db75524d..d66d76ad1f7 100644 --- a/libstdc++-v3/testsuite/ext/random/logistic_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/logistic_distribution/cons/default.cc @@ -44,6 +44,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::logistic_distribution<>>(); + test.operator()<__gnu_cxx::logistic_distribution<>::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/nakagami_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/nakagami_distribution/cons/default.cc index ea473f2fca5..8c4159706bf 100644 --- a/libstdc++-v3/testsuite/ext/random/nakagami_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/nakagami_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::nakagami_distribution<>>(); + test.operator()<__gnu_cxx::nakagami_distribution<>::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc index c209a8d89dc..828c298e42b 100644 --- a/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/normal_mv_distribution/cons/default.cc @@ -46,6 +46,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::normal_mv_distribution<2>>(); + test.operator()<__gnu_cxx::normal_mv_distribution<2>::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/ext/random/pareto_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/pareto_distribution/cons/default.cc index 368d7da1910..440eefa00fb 100644 --- a/libstdc++-v3/testsuite/ext/random/pareto_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/pareto_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::pareto_distribution<>>(); + test.operator()<__gnu_cxx::pareto_distribution<>::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/rice_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/rice_distribution/cons/default.cc index 1483f87000a..014bcd5042b 100644 --- a/libstdc++-v3/testsuite/ext/random/rice_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/rice_distribution/cons/default.cc @@ -43,6 +43,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::rice_distribution<>>(); + test.operator()<__gnu_cxx::rice_distribution<>::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/triangular_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/triangular_distribution/cons/default.cc index c7c6aba5936..1726a828048 100644 --- a/libstdc++-v3/testsuite/ext/random/triangular_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/triangular_distribution/cons/default.cc @@ -41,6 +41,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::triangular_distribution<>>(); + test.operator()<__gnu_cxx::triangular_distribution<>::param_type>(); } int main() diff --git a/libstdc++-v3/testsuite/ext/random/uniform_inside_sphere_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/uniform_inside_sphere_distribution/cons/default.cc index e15a12d79ae..6b2f5793605 100644 --- a/libstdc++-v3/testsuite/ext/random/uniform_inside_sphere_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/uniform_inside_sphere_distribution/cons/default.cc @@ -41,6 +41,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::uniform_inside_sphere_distribution<2>>(); + test.operator()<__gnu_cxx::uniform_inside_sphere_distribution<2>::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/uniform_on_sphere_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/uniform_on_sphere_distribution/cons/default.cc index 8aa81b328a2..95e1783832b 100644 --- a/libstdc++-v3/testsuite/ext/random/uniform_on_sphere_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/uniform_on_sphere_distribution/cons/default.cc @@ -40,6 +40,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::uniform_on_sphere_distribution<2>>(); + test.operator()<__gnu_cxx::uniform_on_sphere_distribution<2>::param_type>(); } int diff --git a/libstdc++-v3/testsuite/ext/random/von_mises_distribution/cons/default.cc b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/cons/default.cc index 1a4784d49d9..7e17f4da23f 100644 --- a/libstdc++-v3/testsuite/ext/random/von_mises_distribution/cons/default.cc +++ b/libstdc++-v3/testsuite/ext/random/von_mises_distribution/cons/default.cc @@ -40,6 +40,7 @@ test02() { __gnu_test::implicitly_default_constructible test; test.operator()<__gnu_cxx::von_mises_distribution<>>(); + test.operator()<__gnu_cxx::von_mises_distribution<>::param_type>(); } int main() -- 2.30.2