aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__random/cauchy_distribution.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-03 14:10:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-07-03 14:10:23 +0000
commit145449b1e420787bb99721a429341fa6be3adfb6 (patch)
tree1d56ae694a6de602e348dd80165cf881a36600ed /libcxx/include/__random/cauchy_distribution.h
parentecbca9f5fb7d7613d2b94982c4825eb0d33d6842 (diff)
Diffstat (limited to 'libcxx/include/__random/cauchy_distribution.h')
-rw-r--r--libcxx/include/__random/cauchy_distribution.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/include/__random/cauchy_distribution.h b/libcxx/include/__random/cauchy_distribution.h
index 6661e00bf939..5bc44ee8dd4c 100644
--- a/libcxx/include/__random/cauchy_distribution.h
+++ b/libcxx/include/__random/cauchy_distribution.h
@@ -10,13 +10,14 @@
#define _LIBCPP___RANDOM_CAUCHY_DISTRIBUTION_H
#include <__config>
+#include <__random/is_valid.h>
#include <__random/uniform_real_distribution.h>
#include <cmath>
#include <iosfwd>
#include <limits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
+# pragma GCC system_header
#endif
_LIBCPP_PUSH_MACROS
@@ -116,6 +117,7 @@ inline
_RealType
cauchy_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
{
+ static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
uniform_real_distribution<result_type> __gen;
// purposefully let tan arg get as close to pi/2 as it wants, tan will return a finite
return __p.a() + __p.b() * _VSTD::tan(3.1415926535897932384626433832795 * __gen(__g));