diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-05-14 21:38:54 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-05-14 21:38:54 +0000 |
commit | 0e675818f14b917a50c26f51396247326840f495 (patch) | |
tree | 33e9385da7c7757fe48bf1ed0ce59fef37ef4e37 /libcxx/test | |
parent | e9ac7ad68c3cf1d7d5ef6d3e1e4fb9809da8c419 (diff) | |
download | bcm5719-llvm-0e675818f14b917a50c26f51396247326840f495.tar.gz bcm5719-llvm-0e675818f14b917a50c26f51396247326840f495.zip |
[rand.dist.pois.poisson]
llvm-svn: 103814
Diffstat (limited to 'libcxx/test')
18 files changed, 698 insertions, 0 deletions
diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/assign.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/assign.pass.cpp new file mode 100644 index 00000000000..51bb064a86a --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/assign.pass.cpp @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// poisson_distribution& operator=(const poisson_distribution&); + +#include <random> +#include <cassert> + +void +test1() +{ + typedef std::poisson_distribution<> D; + D d1(0.75); + D d2; + assert(d1 != d2); + d2 = d1; + assert(d1 == d2); +} + +int main() +{ + test1(); +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/copy.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/copy.pass.cpp new file mode 100644 index 00000000000..1b12f89dfb6 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/copy.pass.cpp @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// poisson_distribution(const poisson_distribution&); + +#include <random> +#include <cassert> + +void +test1() +{ + typedef std::poisson_distribution<> D; + D d1(1.75); + D d2 = d1; + assert(d1 == d2); +} + +int main() +{ + test1(); +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/ctor_double.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/ctor_double.pass.cpp new file mode 100644 index 00000000000..2a77e4e65cc --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/ctor_double.pass.cpp @@ -0,0 +1,32 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// explicit poisson_distribution(RealType lambda = 1.0); + +#include <random> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + D d; + assert(d.mean() == 1); + } + { + typedef std::poisson_distribution<> D; + D d(3.5); + assert(d.mean() == 3.5); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/ctor_param.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/ctor_param.pass.cpp new file mode 100644 index 00000000000..3494d84cdb3 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/ctor_param.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// explicit poisson_distribution(const param_type& parm); + +#include <random> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef D::param_type P; + P p(0.25); + D d(p); + assert(d.mean() == 0.25); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eq.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eq.pass.cpp new file mode 100644 index 00000000000..7bd27f42eb4 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eq.pass.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// bool operator=(const poisson_distribution& x, +// const poisson_distribution& y); +// bool operator!(const poisson_distribution& x, +// const poisson_distribution& y); + +#include <random> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + D d1(.25); + D d2(.25); + assert(d1 == d2); + } + { + typedef std::poisson_distribution<> D; + D d1(.28); + D d2(.25); + assert(d1 != d2); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp new file mode 100644 index 00000000000..f03f8871dd3 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval.pass.cpp @@ -0,0 +1,89 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// template<class _URNG> result_type operator()(_URNG& g); + +#include <random> +#include <cassert> +#include <vector> +#include <numeric> + +template <class T> +inline +T +sqr(T x) +{ + return x * x; +} + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef std::minstd_rand G; + G g; + D d(2); + const int N = 100000; + std::vector<double> u; + for (int i = 0; i < N; ++i) + u.push_back(d(g)); + double mean = std::accumulate(u.begin(), u.end(), 0.0) / u.size(); + double var = 0; + for (int i = 0; i < u.size(); ++i) + var += sqr(u[i] - mean); + var /= u.size(); + double x_mean = d.mean(); + double x_var = d.mean(); + assert(std::abs(mean - x_mean) / x_mean < 0.01); + assert(std::abs(var - x_var) / x_var < 0.01); + } + { + typedef std::poisson_distribution<> D; + typedef std::minstd_rand G; + G g; + D d(0.75); + const int N = 100000; + std::vector<double> u; + for (int i = 0; i < N; ++i) + u.push_back(d(g)); + double mean = std::accumulate(u.begin(), u.end(), 0.0) / u.size(); + double var = 0; + for (int i = 0; i < u.size(); ++i) + var += sqr(u[i] - mean); + var /= u.size(); + double x_mean = d.mean(); + double x_var = d.mean(); + assert(std::abs(mean - x_mean) / x_mean < 0.01); + assert(std::abs(var - x_var) / x_var < 0.01); + } + { + typedef std::poisson_distribution<> D; + typedef std::minstd_rand G; + G g; + D d(20); + const int N = 10000; + std::vector<double> u; + for (int i = 0; i < N; ++i) + u.push_back(d(g)); + double mean = std::accumulate(u.begin(), u.end(), 0.0) / u.size(); + double var = 0; + for (int i = 0; i < u.size(); ++i) + var += sqr(u[i] - mean); + var /= u.size(); + double x_mean = d.mean(); + double x_var = d.mean(); + assert(std::abs(mean - x_mean) / x_mean < 0.01); + assert(std::abs(var - x_var) / x_var < 0.01); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval_param.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval_param.pass.cpp new file mode 100644 index 00000000000..b7226a3fc8a --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/eval_param.pass.cpp @@ -0,0 +1,95 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm); + +#include <random> +#include <cassert> +#include <vector> +#include <numeric> + +template <class T> +inline +T +sqr(T x) +{ + return x * x; +} + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef D::param_type P; + typedef std::minstd_rand G; + G g; + D d(.75); + P p(2); + const int N = 100000; + std::vector<double> u; + for (int i = 0; i < N; ++i) + u.push_back(d(g, p)); + double mean = std::accumulate(u.begin(), u.end(), 0.0) / u.size(); + double var = 0; + for (int i = 0; i < u.size(); ++i) + var += sqr(u[i] - mean); + var /= u.size(); + double x_mean = p.mean(); + double x_var = p.mean(); + assert(std::abs(mean - x_mean) / x_mean < 0.01); + assert(std::abs(var - x_var) / x_var < 0.01); + } + { + typedef std::poisson_distribution<> D; + typedef D::param_type P; + typedef std::minstd_rand G; + G g; + D d(2); + P p(.75); + const int N = 100000; + std::vector<double> u; + for (int i = 0; i < N; ++i) + u.push_back(d(g, p)); + double mean = std::accumulate(u.begin(), u.end(), 0.0) / u.size(); + double var = 0; + for (int i = 0; i < u.size(); ++i) + var += sqr(u[i] - mean); + var /= u.size(); + double x_mean = p.mean(); + double x_var = p.mean(); + assert(std::abs(mean - x_mean) / x_mean < 0.01); + assert(std::abs(var - x_var) / x_var < 0.01); + } + { + typedef std::poisson_distribution<> D; + typedef D::param_type P; + typedef std::minstd_rand G; + G g; + D d(2); + P p(20); + const int N = 10000; + std::vector<double> u; + for (int i = 0; i < N; ++i) + u.push_back(d(g, p)); + double mean = std::accumulate(u.begin(), u.end(), 0.0) / u.size(); + double var = 0; + for (int i = 0; i < u.size(); ++i) + var += sqr(u[i] - mean); + var /= u.size(); + double x_mean = p.mean(); + double x_var = p.mean(); + assert(std::abs(mean - x_mean) / x_mean < 0.01); + assert(std::abs(var - x_var) / x_var < 0.01); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/get_param.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/get_param.pass.cpp new file mode 100644 index 00000000000..16e955bed64 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/get_param.pass.cpp @@ -0,0 +1,29 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// param_type param() const; + +#include <random> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef D::param_type P; + P p(.125); + D d(p); + assert(d.param() == p); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/io.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/io.pass.cpp new file mode 100644 index 00000000000..845cb4df46a --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/io.pass.cpp @@ -0,0 +1,41 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// template <class CharT, class Traits, class IntType> +// basic_ostream<CharT, Traits>& +// operator<<(basic_ostream<CharT, Traits>& os, +// const poisson_distribution<RealType>& x); + +// template <class CharT, class Traits, class IntType> +// basic_istream<CharT, Traits>& +// operator>>(basic_istream<CharT, Traits>& is, +// poisson_distribution<RealType>& x); + +#include <random> +#include <sstream> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + D d1(7); + std::ostringstream os; + os << d1; + std::istringstream is(os.str()); + D d2; + is >> d2; + assert(d1 == d2); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/max.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/max.pass.cpp new file mode 100644 index 00000000000..f1709777dfe --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/max.pass.cpp @@ -0,0 +1,28 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// result_type max() const; + +#include <random> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + D d(.25); + D::result_type m = d.max(); + assert(m == std::numeric_limits<int>::max()); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/min.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/min.pass.cpp new file mode 100644 index 00000000000..852ddc2a406 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/min.pass.cpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution + +// result_type min() const; + +#include <random> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + D d(.5); + assert(d.min() == 0); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_assign.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_assign.pass.cpp new file mode 100644 index 00000000000..b6ba102a344 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_assign.pass.cpp @@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution +// { +// class param_type; + +#include <random> +#include <limits> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef D::param_type param_type; + param_type p0(.7); + param_type p; + p = p0; + assert(p.mean() == .7); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_copy.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_copy.pass.cpp new file mode 100644 index 00000000000..a47da699e41 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_copy.pass.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution +// { +// class param_type; + +#include <random> +#include <limits> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef D::param_type param_type; + param_type p0(.125); + param_type p = p0; + assert(p.mean() == .125); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_ctor.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_ctor.pass.cpp new file mode 100644 index 00000000000..68422c33d63 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_ctor.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution +// { +// class param_type; + +#include <random> +#include <limits> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef D::param_type param_type; + param_type p; + assert(p.mean() == 1); + } + { + typedef std::poisson_distribution<> D; + typedef D::param_type param_type; + param_type p(10); + assert(p.mean() == 10); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_eq.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_eq.pass.cpp new file mode 100644 index 00000000000..726eacf331e --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_eq.pass.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution +// { +// class param_type; + +#include <random> +#include <limits> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef D::param_type param_type; + param_type p1(0.75); + param_type p2(0.75); + assert(p1 == p2); + } + { + typedef std::poisson_distribution<> D; + typedef D::param_type param_type; + param_type p1(0.75); + param_type p2(0.5); + assert(p1 != p2); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_types.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_types.pass.cpp new file mode 100644 index 00000000000..2ef9c5bf155 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/param_types.pass.cpp @@ -0,0 +1,28 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution +// { +// class param_type; + +#include <random> +#include <type_traits> + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef D::param_type param_type; + typedef param_type::distribution_type distribution_type; + static_assert((std::is_same<D, distribution_type>::value), ""); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/set_param.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/set_param.pass.cpp new file mode 100644 index 00000000000..22b22c8c051 --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/set_param.pass.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class RealType = double> +// class poisson_distribution; + +// void param(const param_type& parm); + +#include <random> +#include <cassert> + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef D::param_type P; + P p(0.25); + D d(0.75); + d.param(p); + assert(d.param() == p); + } +} diff --git a/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/types.pass.cpp b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/types.pass.cpp new file mode 100644 index 00000000000..639bb56731e --- /dev/null +++ b/libcxx/test/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/types.pass.cpp @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <random> + +// template<class IntType = int> +// class poisson_distribution +// { +// public: +// // types +// typedef RealType result_type; + +#include <random> +#include <type_traits> + +int main() +{ + { + typedef std::poisson_distribution<> D; + typedef D::result_type result_type; + static_assert((std::is_same<result_type, int>::value), ""); + } + { + typedef std::poisson_distribution<unsigned long long> D; + typedef D::result_type result_type; + static_assert((std::is_same<result_type, unsigned long long>::value), ""); + } +} |