[libc++][random] Applied [[nodiscard]] to <random> (#204970)
Towards: #172124 - https://libcxx.llvm.org/CodingGuidelines.html#apply-nodiscard-where-relevant - https://wg21.link/rand Co-authored-by: Hristo Hristov <zingam@outlook.com>
This commit is contained in:
parent
582a20269e
commit
93b1f81e03
50 changed files with 847 additions and 240 deletions
|
|
@ -36,7 +36,7 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(double __p = 0.5) : __p_(__p) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
@ -60,20 +60,20 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return false; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return true; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return false; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return true; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const bernoulli_distribution& __x, const bernoulli_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __t = 1, double __p = 0.5);
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type t() const { return __t_; }
|
||||
_LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type t() const { return __t_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__t_ == __y.__t_ && __x.__p_ == __y.__p_;
|
||||
|
|
@ -74,21 +74,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type t() const { return __p_.t(); }
|
||||
_LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type t() const { return __p_.t(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return t(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return t(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const binomial_distribution& __x, const binomial_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = 1) : __a_(__a), __b_(__b) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;
|
||||
|
|
@ -70,21 +70,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const cauchy_distribution& __x, const cauchy_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __n = 1) : __n_(__n) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__n_ == __y.__n_;
|
||||
|
|
@ -65,22 +65,22 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
|
||||
return gamma_distribution<result_type>(__p.n() / 2, 2)(__g);
|
||||
}
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool
|
||||
operator==(const chi_squared_distribution& __x, const chi_squared_distribution& __y) {
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ public:
|
|||
static constexpr result_type _Max = _Engine::max();
|
||||
#endif
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Engine::min(); }
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Engine::max(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Engine::min(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Engine::max(); }
|
||||
|
||||
// constructors and seeding functions
|
||||
_LIBCPP_HIDE_FROM_ABI discard_block_engine() : __n_(0) {}
|
||||
|
|
@ -83,14 +83,14 @@ public:
|
|||
}
|
||||
|
||||
// generating functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()();
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()();
|
||||
_LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
|
||||
for (; __z; --__z)
|
||||
operator()();
|
||||
(void)operator()();
|
||||
}
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }
|
||||
|
||||
template <class _Eng, size_t _Pp, size_t _Rp>
|
||||
friend bool
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public:
|
|||
template <class _UnaryOperation>
|
||||
_LIBCPP_HIDE_FROM_ABI param_type(size_t __nw, double __xmin, double __xmax, _UnaryOperation __fw);
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI vector<double> probabilities() const;
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<double> probabilities() const;
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
@ -92,20 +92,20 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI vector<double> probabilities() const { return __p_.probabilities(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<double> probabilities() const { return __p_.probabilities(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__p_.size(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__p_.size(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const discrete_distribution& __x, const discrete_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __lambda = 1) : __lambda_(__lambda) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type lambda() const { return __lambda_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type lambda() const { return __lambda_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__lambda_ == __y.__lambda_;
|
||||
|
|
@ -67,20 +67,20 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type lambda() const { return __p_.lambda(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type lambda() const { return __p_.lambda(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool
|
||||
operator==(const exponential_distribution& __x, const exponential_distribution& __y) {
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = 1) : __a_(__a), __b_(__b) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;
|
||||
|
|
@ -70,21 +70,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool
|
||||
operator==(const extreme_value_distribution& __x, const extreme_value_distribution& __y) {
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __m = 1, result_type __n = 1) : __m_(__m), __n_(__n) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type m() const { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type m() const { return __m_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__m_ == __y.__m_ && __x.__n_ == __y.__n_;
|
||||
|
|
@ -69,21 +69,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type m() const { return __p_.m(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type m() const { return __p_.m(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const fisher_f_distribution& __x, const fisher_f_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __alpha = 1, result_type __beta = 1)
|
||||
: __alpha_(__alpha), __beta_(__beta) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type alpha() const { return __alpha_; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type beta() const { return __beta_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type alpha() const { return __alpha_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type beta() const { return __beta_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__alpha_ == __y.__alpha_ && __x.__beta_ == __y.__beta_;
|
||||
|
|
@ -72,21 +72,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type alpha() const { return __p_.alpha(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type beta() const { return __p_.beta(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type alpha() const { return __p_.alpha(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type beta() const { return __p_.beta(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const gamma_distribution& __x, const gamma_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
// generate_canonical
|
||||
|
||||
template <class _RealType, size_t __bits, class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI _RealType generate_canonical(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _RealType generate_canonical(_URNG& __g) {
|
||||
const size_t __dt = numeric_limits<_RealType>::digits;
|
||||
const size_t __b = __dt < __bits ? __dt : __bits;
|
||||
#ifdef _LIBCPP_CXX03_LANG
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(double __p = 0.5) : __p_(__p) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
@ -64,22 +64,22 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
|
||||
return negative_binomial_distribution<result_type>(1, __p.p())(__g);
|
||||
}
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const geometric_distribution& __x, const geometric_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ public:
|
|||
static_assert(_Min < _Max, "independent_bits_engine invalid parameters");
|
||||
|
||||
// engine characteristics
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
|
||||
// constructors and seeding functions
|
||||
_LIBCPP_HIDE_FROM_ABI independent_bits_engine() {}
|
||||
|
|
@ -105,7 +105,7 @@ public:
|
|||
}
|
||||
|
||||
// generating functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()() {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()() {
|
||||
if _LIBCPP_CONSTEXPR (_Rp != 0) {
|
||||
result_type __sp = 0;
|
||||
for (size_t __k = 0; __k < __n0; ++__k) {
|
||||
|
|
@ -130,11 +130,11 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
|
||||
for (; __z; --__z)
|
||||
operator()();
|
||||
(void)operator()();
|
||||
}
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }
|
||||
|
||||
template <class _Eng, size_t _Wp, class _UInt>
|
||||
friend bool operator==(const independent_bits_engine<_Eng, _Wp, _UInt>& __x,
|
||||
|
|
|
|||
|
|
@ -254,8 +254,8 @@ public:
|
|||
static inline _LIBCPP_CONSTEXPR const result_type multiplier = __a;
|
||||
static inline _LIBCPP_CONSTEXPR const result_type increment = __c;
|
||||
static inline _LIBCPP_CONSTEXPR const result_type modulus = __m;
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
static inline _LIBCPP_CONSTEXPR const result_type default_seed = 1u;
|
||||
|
||||
// constructors and seeding functions
|
||||
|
|
@ -296,12 +296,12 @@ public:
|
|||
}
|
||||
|
||||
// generating functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()() {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()() {
|
||||
return __x_ = static_cast<result_type>(__lce_ta<__a, __c, __m, _Mp>::next(__x_));
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
|
||||
for (; __z; --__z)
|
||||
operator()();
|
||||
(void)operator()();
|
||||
}
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __m = 0, result_type __s = 1) : __m_(__m), __s_(__s) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type m() const { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type s() const { return __s_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type m() const { return __m_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type s() const { return __s_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__m_ == __y.__m_ && __x.__s_ == __y.__s_;
|
||||
|
|
@ -68,28 +68,28 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return std::exp(__nd_(__g));
|
||||
}
|
||||
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
|
||||
typename normal_distribution<result_type>::param_type __pn(__p.m(), __p.s());
|
||||
return std::exp(__nd_(__g, __pn));
|
||||
}
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type m() const { return __nd_.mean(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type s() const { return __nd_.stddev(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type m() const { return __nd_.mean(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type s() const { return __nd_.stddev(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return param_type(__nd_.mean(), __nd_.stddev()); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return param_type(__nd_.mean(), __nd_.stddev()); }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) {
|
||||
typename normal_distribution<result_type>::param_type __pn(__p.m(), __p.s());
|
||||
__nd_.param(__pn);
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const lognormal_distribution& __x, const lognormal_distribution& __y) {
|
||||
return __x.__nd_ == __y.__nd_;
|
||||
|
|
|
|||
|
|
@ -161,8 +161,8 @@ public:
|
|||
static inline _LIBCPP_CONSTEXPR const result_type tempering_c = __c;
|
||||
static inline _LIBCPP_CONSTEXPR const size_t tempering_l = __l;
|
||||
static inline _LIBCPP_CONSTEXPR const result_type initialization_multiplier = __f;
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
static inline _LIBCPP_CONSTEXPR const result_type default_seed = 5489u;
|
||||
|
||||
// constructors and seeding functions
|
||||
|
|
@ -206,7 +206,7 @@ public:
|
|||
}
|
||||
|
||||
// generating functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()() {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()() {
|
||||
const size_t __j = (__i_ + 1) % __n;
|
||||
const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);
|
||||
const result_type __yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask);
|
||||
|
|
@ -221,7 +221,7 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
|
||||
for (; __z; --__z)
|
||||
operator()();
|
||||
(void)operator()();
|
||||
}
|
||||
|
||||
template <class _UInt,
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __k = 1, double __p = 0.5) : __k_(__k), __p_(__p) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type k() const { return __k_; }
|
||||
_LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type k() const { return __k_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__k_ == __y.__k_ && __x.__p_ == __y.__p_;
|
||||
|
|
@ -70,21 +70,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type k() const { return __p_.k(); }
|
||||
_LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type k() const { return __p_.k(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double p() const { return __p_.p(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool
|
||||
operator==(const negative_binomial_distribution& __x, const negative_binomial_distribution& __y) {
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __mean = 0, result_type __stddev = 1)
|
||||
: __mean_(__mean), __stddev_(__stddev) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type mean() const { return __mean_; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type stddev() const { return __stddev_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type mean() const { return __mean_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type stddev() const { return __stddev_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__mean_ == __y.__mean_ && __x.__stddev_ == __y.__stddev_;
|
||||
|
|
@ -73,21 +73,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type mean() const { return __p_.mean(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type stddev() const { return __p_.stddev(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type mean() const { return __p_.mean(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type stddev() const { return __p_.stddev(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const normal_distribution& __x, const normal_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_ && __x.__v_hot_ == __y.__v_hot_ && (!__x.__v_hot_ || __x.__v_ == __y.__v_);
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default;
|
||||
_LIBCPP_HIDE_FROM_ABI param_type& operator=(const param_type& __rhs);
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __b_; }
|
||||
_LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __densities_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __b_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __densities_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;
|
||||
|
|
@ -109,21 +109,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __p_.intervals(); }
|
||||
_LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __p_.densities(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __p_.intervals(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __p_.densities(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return __p_.__b_.front(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__b_.back(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return __p_.__b_.front(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__b_.back(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool
|
||||
operator==(const piecewise_constant_distribution& __x, const piecewise_constant_distribution& __y) {
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI param_type(param_type const&) = default;
|
||||
_LIBCPP_HIDE_FROM_ABI param_type& operator=(const param_type& __rhs);
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __b_; }
|
||||
_LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __densities_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __b_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __densities_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__densities_ == __y.__densities_ && __x.__b_ == __y.__b_;
|
||||
|
|
@ -110,21 +110,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __p_.intervals(); }
|
||||
_LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __p_.densities(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> intervals() const { return __p_.intervals(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI vector<result_type> densities() const { return __p_.densities(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return __p_.__b_.front(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__b_.back(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return __p_.__b_.front(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return __p_.__b_.back(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool
|
||||
operator==(const piecewise_linear_distribution& __x, const piecewise_linear_distribution& __y) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(double __mean = 1.0);
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI double mean() const { return __mean_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double mean() const { return __mean_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__mean_ == __y.__mean_;
|
||||
|
|
@ -79,20 +79,20 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI double mean() const { return __p_.mean(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI double mean() const { return __p_.mean(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::max(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const poisson_distribution& __x, const poisson_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ public:
|
|||
static _LIBCPP_CONSTEXPR const result_type _Min = 0;
|
||||
static _LIBCPP_CONSTEXPR const result_type _Max = 0xFFFFFFFFu;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
|
||||
// constructors
|
||||
# ifndef _LIBCPP_CXX03_LANG
|
||||
|
|
@ -64,10 +64,10 @@ public:
|
|||
~random_device();
|
||||
|
||||
// generating functions
|
||||
result_type operator()();
|
||||
[[__nodiscard__]] result_type operator()();
|
||||
|
||||
// property functions
|
||||
double entropy() const _NOEXCEPT;
|
||||
[[__nodiscard__]] double entropy() const _NOEXCEPT;
|
||||
|
||||
random_device(const random_device&) = delete;
|
||||
void operator=(const random_device&) = delete;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI void generate(_RandomAccessIterator __first, _RandomAccessIterator __last);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI size_t size() const _NOEXCEPT { return __v_.size(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI size_t size() const _NOEXCEPT { return __v_.size(); }
|
||||
template <class _OutputIterator>
|
||||
_LIBCPP_HIDE_FROM_ABI void param(_OutputIterator __dest) const {
|
||||
std::copy(__v_.begin(), __v_.end(), __dest);
|
||||
|
|
@ -65,7 +65,7 @@ public:
|
|||
seed_seq(const seed_seq&) = delete;
|
||||
void operator=(const seed_seq&) = delete;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI static result_type _Tp(result_type __x) { return __x ^ (__x >> 27); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static result_type _Tp(result_type __x) { return __x ^ (__x >> 27); }
|
||||
|
||||
private:
|
||||
template <class _InputIterator>
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ public:
|
|||
static _LIBCPP_CONSTEXPR const result_type _Max = _Engine::max();
|
||||
#endif
|
||||
static_assert(_Min < _Max, "shuffle_order_engine invalid parameters");
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
|
||||
static _LIBCPP_CONSTEXPR const unsigned long long _Rp = _Max - _Min + 1ull;
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ public:
|
|||
}
|
||||
|
||||
// generating functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()() {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()() {
|
||||
if _LIBCPP_CONSTEXPR (_Rp != 0 || !(__k & 1)) {
|
||||
using _Ratio = __uratio<__k, _Rp != 0 ? _Rp : 0x8000000000000000ull>;
|
||||
if _LIBCPP_CONSTEXPR (_Ratio::num > 0xFFFFFFFFFFFFFFFFull / (_Max - _Min)) {
|
||||
|
|
@ -126,11 +126,11 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
|
||||
for (; __z; --__z)
|
||||
operator()();
|
||||
(void)operator()();
|
||||
}
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI const _Engine& base() const _NOEXCEPT { return __e_; }
|
||||
|
||||
private:
|
||||
template <class _Eng, size_t _Kp>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __n = 1) : __n_(__n) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __n_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__n_ == __y.__n_;
|
||||
|
|
@ -68,20 +68,20 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type n() const { return __p_.n(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return -numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const student_t_distribution& __x, const student_t_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ public:
|
|||
static inline _LIBCPP_CONSTEXPR const size_t word_size = __w;
|
||||
static inline _LIBCPP_CONSTEXPR const size_t short_lag = __s;
|
||||
static inline _LIBCPP_CONSTEXPR const size_t long_lag = __r;
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type min() { return _Min; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
static inline _LIBCPP_CONSTEXPR const result_type default_seed = 19780503u;
|
||||
|
||||
// constructors and seeding functions
|
||||
|
|
@ -122,10 +122,10 @@ public:
|
|||
}
|
||||
|
||||
// generating functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()();
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()();
|
||||
_LIBCPP_HIDE_FROM_ABI void discard(unsigned long long __z) {
|
||||
for (; __z; --__z)
|
||||
operator()();
|
||||
(void)operator()();
|
||||
}
|
||||
|
||||
template <class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
|
||||
|
|
|
|||
|
|
@ -151,8 +151,8 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = numeric_limits<result_type>::max())
|
||||
: __a_(__a), __b_(__b) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI friend bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;
|
||||
|
|
@ -179,21 +179,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return a(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return b(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return a(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return b(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI friend bool
|
||||
operator==(const uniform_int_distribution& __x, const uniform_int_distribution& __y) {
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 0, result_type __b = 1) : __a_(__a), __b_(__b) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;
|
||||
|
|
@ -69,21 +69,21 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p);
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return a(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return b(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return a(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return b(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool
|
||||
operator==(const uniform_real_distribution& __x, const uniform_real_distribution& __y) {
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit param_type(result_type __a = 1, result_type __b = 1) : __a_(__a), __b_(__b) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __a_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __b_; }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const param_type& __x, const param_type& __y) {
|
||||
return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;
|
||||
|
|
@ -70,23 +70,23 @@ public:
|
|||
|
||||
// generating functions
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g) {
|
||||
return (*this)(__g, __p_);
|
||||
}
|
||||
template <class _URNG>
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()(_URNG& __g, const param_type& __p) {
|
||||
return __p.b() * std::pow(exponential_distribution<result_type>()(__g), 1 / __p.a());
|
||||
}
|
||||
|
||||
// property functions
|
||||
_LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type a() const { return __p_.a(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type b() const { return __p_.b(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI param_type param() const { return __p_; }
|
||||
_LIBCPP_HIDE_FROM_ABI void param(const param_type& __p) { __p_ = __p; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
_LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type min() const { return 0; }
|
||||
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type max() const { return numeric_limits<result_type>::infinity(); }
|
||||
|
||||
friend _LIBCPP_HIDE_FROM_ABI bool operator==(const weibull_distribution& __x, const weibull_distribution& __y) {
|
||||
return __x.__p_ == __y.__p_;
|
||||
|
|
|
|||
607
libcxx/test/libcxx/numerics/rand/nodiscard.verify.cpp
Normal file
607
libcxx/test/libcxx/numerics/rand/nodiscard.verify.cpp
Normal file
|
|
@ -0,0 +1,607 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <random>
|
||||
|
||||
// Check that functions are marked [[nodiscard]]
|
||||
|
||||
#include <random>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
void test() {
|
||||
std::mt19937_64 gen;
|
||||
|
||||
{
|
||||
std::bernoulli_distribution::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.p();
|
||||
|
||||
std::bernoulli_distribution d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.p();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::binomial_distribution<int>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.t();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.p();
|
||||
|
||||
std::binomial_distribution<int> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.p();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::cauchy_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.a();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.b();
|
||||
|
||||
std::cauchy_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.a();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.b();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::chi_squared_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.n();
|
||||
|
||||
std::chi_squared_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.n();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::discard_block_engine<std::mt19937_64, 10, 5> e;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e();
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.max();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.base();
|
||||
}
|
||||
{
|
||||
std::discrete_distribution<int>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.probabilities();
|
||||
|
||||
std::discrete_distribution<int> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.probabilities();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::exponential_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.lambda();
|
||||
|
||||
std::exponential_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.lambda();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::extreme_value_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.a();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.b();
|
||||
|
||||
std::extreme_value_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.a();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.b();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::fisher_f_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.m();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.n();
|
||||
|
||||
std::fisher_f_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.m();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.n();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::gamma_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.alpha();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.beta();
|
||||
|
||||
std::gamma_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.alpha();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.beta();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::generate_canonical<double, 10>(gen);
|
||||
}
|
||||
{
|
||||
std::geometric_distribution<int>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.p();
|
||||
|
||||
std::geometric_distribution<int> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.p();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::independent_bits_engine<std::mt19937_64, 10, unsigned int> e;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e();
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.max();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.base();
|
||||
}
|
||||
{
|
||||
std::linear_congruential_engine<unsigned int, 48271, 0, 2147483647> e(94);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e();
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.max();
|
||||
}
|
||||
{
|
||||
std::lognormal_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.m();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.s();
|
||||
|
||||
std::lognormal_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.m();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.s();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::mt19937_64 e;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e();
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.max();
|
||||
}
|
||||
{
|
||||
std::negative_binomial_distribution<int>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.k();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.p();
|
||||
|
||||
std::negative_binomial_distribution<int> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.k();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.p();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::normal_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.mean();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.stddev();
|
||||
|
||||
std::normal_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.mean();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.stddev();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::piecewise_constant_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.intervals();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.densities();
|
||||
|
||||
std::piecewise_constant_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.intervals();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.densities();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::piecewise_linear_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.intervals();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.densities();
|
||||
|
||||
std::piecewise_linear_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.intervals();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.densities();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::poisson_distribution<int>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.mean();
|
||||
|
||||
std::poisson_distribution<int> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.mean();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
#if !defined(TEST_HAS_NO_RANDOM_DEVICE)
|
||||
{
|
||||
std::random_device d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d();
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.entropy();
|
||||
}
|
||||
#endif
|
||||
{
|
||||
std::seed_seq s;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
s.size();
|
||||
}
|
||||
{
|
||||
std::shuffle_order_engine<std::mt19937_64, 10> e;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e();
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.max();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.base();
|
||||
}
|
||||
{
|
||||
std::student_t_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.n();
|
||||
|
||||
std::student_t_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.n();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::subtract_with_carry_engine<unsigned int, 24, 10, 24> e;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e();
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
e.max();
|
||||
}
|
||||
{
|
||||
std::uniform_int_distribution<int>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.a();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.b();
|
||||
|
||||
std::uniform_int_distribution<int> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.a();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.b();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::uniform_real_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.a();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.b();
|
||||
|
||||
std::uniform_real_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.a();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.b();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
{
|
||||
std::weibull_distribution<double>::param_type p;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.a();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
p.b();
|
||||
|
||||
std::weibull_distribution<double> d;
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen);
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d(gen, p);
|
||||
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.a();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.b();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.param();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.min();
|
||||
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
d.max();
|
||||
}
|
||||
}
|
||||
|
|
@ -25,6 +25,6 @@ void test(std::bernoulli_distribution dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::binomial_distribution<int> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ void test(std::geometric_distribution<int> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 7 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 7 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ void test(std::negative_binomial_distribution<int> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 7 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 7 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::cauchy_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::chi_squared_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 3 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 3 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ void test(std::fisher_f_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 4 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 4 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::lognormal_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::normal_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::student_t_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 5 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 5 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::exponential_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::extreme_value_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::gamma_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 3 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 3 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ void test(std::poisson_distribution<int> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 4 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 4 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::weibull_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::discrete_distribution<int> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::piecewise_constant_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::piecewise_linear_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* 2 {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ void test(std::uniform_int_distribution<int> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ void test(std::uniform_real_distribution<double> dist)
|
|||
G<int> badg;
|
||||
G<unsigned> okg;
|
||||
|
||||
dist(badg); //expected-error@*:* {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
dist(okg);
|
||||
(void)dist(badg); //expected-error@*:* {{static assertion failed}} //expected-note {{in instantiation}}
|
||||
(void)dist(okg);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue