[libcxx-commits] [libcxx] [libc++] add floating point type check for uniform real distrubtion (PR #70564)

Nhat Nguyen via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 1 19:47:34 PDT 2023


================
@@ -27,6 +28,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 template<class _RealType = double>
 class _LIBCPP_TEMPLATE_VIS uniform_real_distribution
 {
+  static_assert(is_floating_point<_RealType>::value, "result_type must be floating type");
----------------
NhatNguyen1810 wrote:

@ldionne Ide
are you suggesting to replace `is_floating_point` by `__libcpp_random_is_valid_urng` in static assert? 

https://github.com/llvm/llvm-project/pull/70564


More information about the libcxx-commits mailing list