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)
commitdd9db6f897cbe85f830a5606435afe51961dbda8
tree569acda1ce35ce3401fadf07906c81347bc203df
parentb80a188beea98da44228d6030932af0769946f83
P0935R0 Eradicating unnecessarily explicit default constructors

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