From: Marc Fehling <mafehling.git@gmail.com> Date: Fri, 6 Sep 2024 09:13:11 +0000 (+0200) Subject: Fix modernize-type-traits. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17672%2Fhead;p=dealii.git Fix modernize-type-traits. --- diff --git a/include/deal.II/differentiation/ad/ad_number_traits.h b/include/deal.II/differentiation/ad/ad_number_traits.h index e549a4e91a..abb225f986 100644 --- a/include/deal.II/differentiation/ad/ad_number_traits.h +++ b/include/deal.II/differentiation/ad/ad_number_traits.h @@ -741,8 +741,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point< - typename internal::RemoveComplexWrapper<ScalarType>::type>::value)>> + std::is_floating_point_v< + typename internal::RemoveComplexWrapper<ScalarType>::type>)>> { /** * The type of taping used @@ -862,8 +862,8 @@ namespace Differentiation /** * The actual auto-differentiable number type */ - using ad_type = typename std:: - conditional<is_real_valued, real_type, complex_type>::type; + using ad_type = + typename std::conditional_t<is_real_valued, real_type, complex_type>; /** * The actual auto-differentiable number directional derivative type @@ -940,8 +940,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_taped = + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_taped = internal::ADNumberInfoFromEnum< typename internal::RemoveComplexWrapper<ScalarType>::type, ADNumberTypeCode>::is_taped; @@ -954,8 +954,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_tapeless = + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_tapeless = !(NumberTraits<ScalarType, ADNumberTypeCode>::is_taped); @@ -966,8 +966,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_real_valued = + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_real_valued = (!boost::is_complex<ScalarType>::value); @@ -978,8 +978,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_complex_valued = + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_complex_valued = !(NumberTraits<ScalarType, ADNumberTypeCode>::is_real_valued); @@ -990,8 +990,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::n_supported_derivative_levels = + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::n_supported_derivative_levels = internal::ADNumberInfoFromEnum< typename internal::RemoveComplexWrapper<ScalarType>::type, ADNumberTypeCode>::n_supported_derivative_levels; @@ -1005,8 +1005,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_taped; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_taped; template <typename ScalarType, enum NumberTypes ADNumberTypeCode> @@ -1016,8 +1016,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_tapeless; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_tapeless; template <typename ScalarType, enum NumberTypes ADNumberTypeCode> @@ -1027,8 +1027,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_real_valued; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_real_valued; template <typename ScalarType, enum NumberTypes ADNumberTypeCode> @@ -1038,8 +1038,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_complex_valued; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_complex_valued; template <typename ScalarType, enum NumberTypes ADNumberTypeCode> @@ -1049,8 +1049,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::n_supported_derivative_levels; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::n_supported_derivative_levels; # endif @@ -1072,8 +1072,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point< - typename internal::RemoveComplexWrapper<ScalarType>::type>::value)>> + std::is_floating_point_v< + typename internal::RemoveComplexWrapper<ScalarType>::type>)>> { /** * The internal number type code. @@ -1241,8 +1241,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_taped = false; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_taped = false; template <typename ScalarType> @@ -1252,8 +1252,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_tapeless = false; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_tapeless = false; template <typename ScalarType> @@ -1263,8 +1263,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_real_valued = + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_real_valued = (!boost::is_complex<ScalarType>::value); @@ -1275,8 +1275,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_complex_valued = + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_complex_valued = !(NumberTraits<ScalarType, NumberTypes::none>::is_real_valued); @@ -1287,8 +1287,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::n_supported_derivative_levels = 0; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::n_supported_derivative_levels = 0; # else @@ -1299,8 +1299,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_taped; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_taped; template <typename ScalarType> @@ -1310,8 +1310,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_tapeless; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_tapeless; template <typename ScalarType> @@ -1321,8 +1321,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_real_valued; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_real_valued; template <typename ScalarType> @@ -1332,8 +1332,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::is_complex_valued; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::is_complex_valued; template <typename ScalarType> @@ -1343,8 +1343,8 @@ namespace Differentiation std::enable_if_t< std::is_floating_point_v<ScalarType> || (boost::is_complex<ScalarType>::value && - std::is_floating_point<typename internal::RemoveComplexWrapper< - ScalarType>::type>::value)>>::n_supported_derivative_levels; + std::is_floating_point_v<typename internal::RemoveComplexWrapper< + ScalarType>::type>)>>::n_supported_derivative_levels; # endif diff --git a/include/deal.II/differentiation/ad/sacado_number_types.h b/include/deal.II/differentiation/ad/sacado_number_types.h index 4f8f986565..d2dd4687c8 100644 --- a/include/deal.II/differentiation/ad/sacado_number_types.h +++ b/include/deal.II/differentiation/ad/sacado_number_types.h @@ -185,7 +185,7 @@ namespace Differentiation template <typename Number> struct SacadoNumberInfo< Number, - std::enable_if_t<std::is_arithmetic<std::decay_t<Number>>::value>> + std::enable_if_t<std::is_arithmetic_v<std::decay_t<Number>>>> { static const unsigned int n_supported_derivative_levels = 0; };