]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix modernize-type-traits. 17672/head
authorMarc Fehling <mafehling.git@gmail.com>
Fri, 6 Sep 2024 09:13:11 +0000 (11:13 +0200)
committerMarc Fehling <mafehling.git@gmail.com>
Fri, 6 Sep 2024 09:13:11 +0000 (11:13 +0200)
include/deal.II/differentiation/ad/ad_number_traits.h
include/deal.II/differentiation/ad/sacado_number_types.h

index e549a4e91aa4b7ca667ed9d4b3be640c4784fa1f..abb225f986bc1c36f1e52b092539812d031f7003 100644 (file)
@@ -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
 
index 4f8f9865650488c44814a44d4f0e7bc6bdf8a529..d2dd4687c865793c066292249539fdc17c419833 100644 (file)
@@ -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;
       };

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.