diff options
Diffstat (limited to 'libcxx/include/__random/cauchy_distribution.h')
| -rw-r--r-- | libcxx/include/__random/cauchy_distribution.h | 4 |
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)); |
