diff --git a/test/test_cpp_double_float_arithmetic.cpp b/test/test_cpp_double_float_arithmetic.cpp index 4ca4d746..078a6f9d 100644 --- a/test/test_cpp_double_float_arithmetic.cpp +++ b/test/test_cpp_double_float_arithmetic.cpp @@ -26,14 +26,17 @@ namespace test_arithmetic_cpp_double_float { // FIXME: this looks like a duplicate from test_cpp_double_float_comparision.cpp file. -template constexpr bool is_floating_point = std::is_floating_point::value +template struct is_floating_point { +static const bool value; +}; +template const bool is_floating_point::value = std::is_floating_point::value #ifdef BOOST_MATH_USE_FLOAT128 or std::is_same::value #endif ; template , bool>::type = true> + typename std::enable_if::value, bool>::type = true> FloatingPointType uniform_real() { static std::random_device rd; @@ -49,7 +52,7 @@ int rand_in_range(int a, int b) } template , bool>::type = true> + typename std::enable_if::value, bool>::type = true> FloatingPointType uniform_rand() { return uniform_real(); @@ -62,7 +65,7 @@ boost::multiprecision::backends::cpp_double_float(uniform_real()) * boost::multiprecision::backends::cpp_double_float(uniform_real()); } -template >::type const* = nullptr> +template ::value>::type const* = nullptr> FloatingPointType log_rand() { if (uniform_real() < (1. / 100.)) diff --git a/test/test_cpp_double_float_comparision.cpp b/test/test_cpp_double_float_comparision.cpp index 1f340b89..ed263da7 100644 --- a/test/test_cpp_double_float_comparision.cpp +++ b/test/test_cpp_double_float_comparision.cpp @@ -25,15 +25,18 @@ #include namespace test_cpp_double_comparision { -// TODO: this looks like a duplicate from test_cpp_double_float_arithmetic.cpp file. -template constexpr bool is_floating_point = std::is_floating_point::value +// FIXME: this looks like a duplicate from test_cpp_double_float_comparision.cpp file. +template struct is_floating_point { +static const bool value; +}; +template const bool is_floating_point::value = std::is_floating_point::value #ifdef BOOST_MATH_USE_FLOAT128 or std::is_same::value #endif ; template , bool>::type = true> + typename std::enable_if::value, bool>::type = true> FloatingPointType uniform_real() { //static std::random_device rd; @@ -44,7 +47,7 @@ FloatingPointType uniform_real() } template ::value && !is_floating_point, bool>::type = true> + typename std::enable_if::value && !is_floating_point::value, bool>::type = true> NumericType uniform_integral_number() { NumericType out = 0; @@ -61,14 +64,14 @@ int rand_in_range(int a, int b) } template ::value && !is_floating_point, bool>::type = true> + typename std::enable_if::value && !is_floating_point::value, bool>::type = true> NumericType uniform_rand() { return uniform_integral_number(); } template , bool>::type = true> + typename std::enable_if::value, bool>::type = true> FloatingPointType uniform_rand() { return uniform_real(); @@ -88,7 +91,7 @@ NumericType log_rand() return uniform_integral_number() >> int(uniform_real() * float(std::numeric_limits::digits+1)); } -template >::type const* = nullptr> +template ::value>::type const* = nullptr> FloatingPointType log_rand() { if (uniform_real() < (1. / 100.)) diff --git a/test/test_cpp_double_float_constructors.cpp b/test/test_cpp_double_float_constructors.cpp index 071e4532..9d8e7990 100644 --- a/test/test_cpp_double_float_constructors.cpp +++ b/test/test_cpp_double_float_constructors.cpp @@ -35,15 +35,18 @@ constexpr T max(T a, T b) } -// TODO: this looks like a duplicate from test_cpp_double_float_comparision.cpp file. -template constexpr bool is_floating_point = std::is_floating_point::value +// FIXME: this looks like a duplicate from test_cpp_double_float_comparision.cpp file. +template struct is_floating_point { +static const bool value; +}; +template const bool is_floating_point::value = std::is_floating_point::value #ifdef BOOST_MATH_USE_FLOAT128 or std::is_same::value #endif ; template , bool>::type = true> + typename std::enable_if::value, bool>::type = true> FloatingPointType uniform_real() { static std::random_device rd; @@ -67,14 +70,14 @@ NumericType uniform_integral_number() template ::value && !is_floating_point, bool>::type = true> + typename std::enable_if::value && !is_floating_point::value, bool>::type = true> NumericType get_rand() { return uniform_integral_number(); } template , bool>::type = true> + typename std::enable_if::value, bool>::type = true> FloatingPointType get_rand() { return uniform_real(); diff --git a/test/test_cpp_double_float_io.cpp b/test/test_cpp_double_float_io.cpp index 3a66276c..0e1272ba 100644 --- a/test/test_cpp_double_float_io.cpp +++ b/test/test_cpp_double_float_io.cpp @@ -22,15 +22,18 @@ namespace test_cpp_double_float_io { -// TODO: this looks like a duplicate from test_cpp_double_float_comparision.cpp file. -template constexpr bool is_floating_point = std::is_floating_point::value +// FIXME: this looks like a duplicate from test_cpp_double_float_comparision.cpp file. +template struct is_floating_point { +static const bool value; +}; +template const bool is_floating_point::value = std::is_floating_point::value #ifdef BOOST_MATH_USE_FLOAT128 or std::is_same::value #endif ; template , bool>::type = true> + typename std::enable_if::value, bool>::type = true> FloatingPointType uniform_real() { //static std::random_device rd; @@ -52,7 +55,7 @@ int rand_in_range(int a, int b) return a + int(float(b - a) * uniform_real()); } -template >::type const* = nullptr> +template ::value>::type const* = nullptr> FloatingPointType log_rand() { if (uniform_real() < (1. / 100.))