From: Wolfgang Bangerth Date: Thu, 13 Jul 2023 18:15:11 +0000 (-0600) Subject: Use std::is_floating_point_v instead of std::is_floating_point<...>::value. X-Git-Tag: relicensing~682^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9087b1f4bab39b6dc3e825eb18ea239546bc7a70;p=dealii.git Use std::is_floating_point_v instead of std::is_floating_point<...>::value. --- diff --git a/include/deal.II/base/complex_overloads.h b/include/deal.II/base/complex_overloads.h index 2241ab9555..a681029062 100644 --- a/include/deal.II/base/complex_overloads.h +++ b/include/deal.II/base/complex_overloads.h @@ -38,7 +38,7 @@ struct ProductType; */ template inline std::enable_if_t< - std::is_floating_point::value && std::is_floating_point::value, + std::is_floating_point_v && std::is_floating_point_v, typename ProductType, std::complex>::type> operator*(const std::complex &left, const std::complex &right) { @@ -56,7 +56,7 @@ operator*(const std::complex &left, const std::complex &right) */ template inline std::enable_if_t< - std::is_floating_point::value && std::is_floating_point::value, + std::is_floating_point_v && std::is_floating_point_v, typename ProductType, std::complex>::type> operator/(const std::complex &left, const std::complex &right) { @@ -73,8 +73,8 @@ operator/(const std::complex &left, const std::complex &right) * @relatesalso ProductType */ template -inline std::enable_if_t::value && - std::is_floating_point::value, +inline std::enable_if_t && + std::is_floating_point_v, typename ProductType, U>::type> operator*(const std::complex &left, const U &right) { @@ -90,8 +90,8 @@ operator*(const std::complex &left, const U &right) * @relatesalso ProductType */ template -inline std::enable_if_t::value && - std::is_floating_point::value, +inline std::enable_if_t && + std::is_floating_point_v, typename ProductType, U>::type> operator/(const std::complex &left, const U &right) { @@ -107,8 +107,8 @@ operator/(const std::complex &left, const U &right) * @relatesalso ProductType */ template -inline std::enable_if_t::value && - std::is_floating_point::value, +inline std::enable_if_t && + std::is_floating_point_v, typename ProductType>::type> operator*(const T &left, const std::complex &right) { @@ -124,8 +124,8 @@ operator*(const T &left, const std::complex &right) * @relatesalso ProductType */ template -inline std::enable_if_t::value && - std::is_floating_point::value, +inline std::enable_if_t && + std::is_floating_point_v, typename ProductType>::type> operator/(const T &left, const std::complex &right) { diff --git a/include/deal.II/base/template_constraints.h b/include/deal.II/base/template_constraints.h index 1856d0dfa4..87ca9c557b 100644 --- a/include/deal.II/base/template_constraints.h +++ b/include/deal.II/base/template_constraints.h @@ -252,7 +252,7 @@ struct is_same_as_any_of * do with something like * @code * template - * typename std::enable_if::value, T>::type + * typename std::enable_if, T>::type * abs (const T t); * @endcode * which declares a function template `abs()` that can only be @@ -284,7 +284,7 @@ struct enable_if_all * do with something like * @code * template - * std::enable_if_t::value, T> + * std::enable_if_t, T> * abs (const T t); * @endcode * which declares a function template `abs()` that can only be diff --git a/include/deal.II/differentiation/ad/ad_number_traits.h b/include/deal.II/differentiation/ad/ad_number_traits.h index c10e2bb1d8..77af2bd344 100644 --- a/include/deal.II/differentiation/ad/ad_number_traits.h +++ b/include/deal.II/differentiation/ad/ad_number_traits.h @@ -310,7 +310,7 @@ namespace Differentiation (void)std::declval(), void())> : std::conditional< - std::is_floating_point::value, + std::is_floating_point_v, std::false_type, std::true_type>::type {}; @@ -324,7 +324,7 @@ namespace Differentiation struct ADNumberInfoFromEnum< ScalarType, Differentiation::AD::NumberTypes::none, - std::enable_if_t::value>> + std::enable_if_t>> { static const bool is_taped = false; using real_type = ScalarType; @@ -339,9 +339,8 @@ namespace Differentiation * mechanism can be employed (e.g. Sacado types). */ template - struct Marking< - ScalarType, - std::enable_if_t::value>> + struct Marking>> { /** * Initialize the state of an independent variable. @@ -533,9 +532,8 @@ namespace Differentiation * mechanism can be employed (e.g. Sacado types). */ template - struct ExtractData< - NumberType, - std::enable_if_t::value>> + struct ExtractData>> { /** * Extract the floating point value. @@ -647,7 +645,7 @@ namespace Differentiation static T value(const F &f, std::enable_if_t::value && - std::is_floating_point::value> * = nullptr) + std::is_floating_point_v> * = nullptr) { // We recursively call this function in case the AD number is a // nested one. The recursion ends when the extracted value is @@ -696,7 +694,7 @@ namespace Differentiation static std::complex value(const F &f, std::enable_if_t::value && - std::is_floating_point::value> * = nullptr) + std::is_floating_point_v> * = nullptr) { // We recursively call this function in case the AD number is a // nested one. The recursion ends when the extracted value is @@ -745,7 +743,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point< typename internal::RemoveComplexWrapper::type>::value)>> @@ -944,7 +942,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_taped = @@ -958,7 +956,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_tapeless = @@ -970,7 +968,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_real_valued = @@ -982,7 +980,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_complex_valued = @@ -994,7 +992,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::n_supported_derivative_levels = @@ -1009,7 +1007,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_taped; @@ -1020,7 +1018,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_tapeless; @@ -1031,7 +1029,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_real_valued; @@ -1042,7 +1040,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_complex_valued; @@ -1053,7 +1051,7 @@ namespace Differentiation ScalarType, ADNumberTypeCode, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::n_supported_derivative_levels; @@ -1076,7 +1074,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point< typename internal::RemoveComplexWrapper::type>::value)>> @@ -1245,7 +1243,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_taped = false; @@ -1256,7 +1254,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_tapeless = false; @@ -1267,7 +1265,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_real_valued = @@ -1279,7 +1277,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_complex_valued = @@ -1291,7 +1289,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::n_supported_derivative_levels = 0; @@ -1303,7 +1301,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_taped; @@ -1314,7 +1312,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_tapeless; @@ -1325,7 +1323,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_real_valued; @@ -1336,7 +1334,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::is_complex_valued; @@ -1347,7 +1345,7 @@ namespace Differentiation ScalarType, NumberTypes::none, std::enable_if_t< - std::is_floating_point::value || + std::is_floating_point_v || (boost::is_complex::value && std::is_floating_point::type>::value)>>::n_supported_derivative_levels; @@ -1376,7 +1374,7 @@ namespace Differentiation template struct ADNumberTraits< ScalarType, - std::enable_if_t::value>> + std::enable_if_t>> : NumberTraits {}; @@ -1388,7 +1386,7 @@ namespace Differentiation ComplexScalarType, std::enable_if_t< boost::is_complex::value && - std::is_floating_point::value>> + std::is_floating_point_v>> : NumberTraits {}; diff --git a/include/deal.II/differentiation/ad/adolc_number_types.h b/include/deal.II/differentiation/ad/adolc_number_types.h index c80230def3..47b3a7c670 100644 --- a/include/deal.II/differentiation/ad/adolc_number_types.h +++ b/include/deal.II/differentiation/ad/adolc_number_types.h @@ -111,7 +111,7 @@ namespace Differentiation struct ADNumberInfoFromEnum< ScalarType, Differentiation::AD::NumberTypes::adolc_taped, - std::enable_if_t::value>> + std::enable_if_t>> { static const bool is_taped = true; using real_type = adouble; @@ -129,7 +129,7 @@ namespace Differentiation struct ADNumberInfoFromEnum< ScalarType, Differentiation::AD::NumberTypes::adolc_tapeless, - std::enable_if_t::value>> + std::enable_if_t>> { static const bool is_taped = false; using real_type = adtl::adouble; diff --git a/include/deal.II/differentiation/ad/sacado_number_types.h b/include/deal.II/differentiation/ad/sacado_number_types.h index 82112d1b3c..1ddc22f0a7 100644 --- a/include/deal.II/differentiation/ad/sacado_number_types.h +++ b/include/deal.II/differentiation/ad/sacado_number_types.h @@ -200,7 +200,7 @@ namespace Differentiation struct ADNumberInfoFromEnum< ScalarType, Differentiation::AD::NumberTypes::sacado_dfad, - std::enable_if_t::value>> + std::enable_if_t>> { static const bool is_taped = false; using real_type = Sacado::Fad::DFad; @@ -219,7 +219,7 @@ namespace Differentiation struct ADNumberInfoFromEnum< ScalarType, Differentiation::AD::NumberTypes::sacado_dfad_dfad, - std::enable_if_t::value>> + std::enable_if_t>> { static const bool is_taped = false; using real_type = Sacado::Fad::DFad>; @@ -238,7 +238,7 @@ namespace Differentiation struct ADNumberInfoFromEnum< ScalarType, Differentiation::AD::NumberTypes::sacado_rad, - std::enable_if_t::value>> + std::enable_if_t>> { static const bool is_taped = false; using real_type = Sacado::Rad::ADvar; @@ -257,7 +257,7 @@ namespace Differentiation struct ADNumberInfoFromEnum< ScalarType, Differentiation::AD::NumberTypes::sacado_rad_dfad, - std::enable_if_t::value>> + std::enable_if_t>> { static const bool is_taped = false; using real_type = Sacado::Rad::ADvar>;