]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Do not use 'typename' where not necessary. 14147/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 18 Jul 2022 21:27:07 +0000 (15:27 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 18 Jul 2022 21:27:07 +0000 (15:27 -0600)
Specifically, we don't need it before 'std::enable_if_t' because we are not
referencing a nested type.

include/deal.II/base/thread_local_storage.h
include/deal.II/sundials/n_vector.templates.h

index 115df60ad7b312a1279436d66bbaee8aa64e998e..6da118575b8a06f62191cdd7c6a7857698804aa1 100644 (file)
@@ -374,7 +374,7 @@ namespace Threads
      * "if constexpr".
      */
     template <typename T>
-    typename std::enable_if_t<
+    std::enable_if_t<
       std::is_copy_constructible<typename unpack_container<T>::type>::value,
       T &>
     construct_element(std::map<std::thread::id, T> &  data,
@@ -390,7 +390,7 @@ namespace Threads
     }
 
     template <typename T>
-    typename std::enable_if_t<
+    std::enable_if_t<
       !std::is_copy_constructible<typename unpack_container<T>::type>::value,
       T &>
     construct_element(std::map<std::thread::id, T> &data,
index 092beb22f472888ed37f6bf0c912d06045159d84..8ba24589ce19887de13908a13428cc08598f7332 100644 (file)
@@ -186,39 +186,33 @@ namespace SUNDIALS
       void
       elementwise_product(N_Vector x, N_Vector y, N_Vector z);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<!IsBlockVector<VectorType>::value, int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<!IsBlockVector<VectorType>::value, int> = 0>
       void
       elementwise_div(N_Vector x, N_Vector y, N_Vector z);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<IsBlockVector<VectorType>::value, int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<IsBlockVector<VectorType>::value, int> = 0>
       void
       elementwise_div(N_Vector x, N_Vector y, N_Vector z);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<!IsBlockVector<VectorType>::value, int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<!IsBlockVector<VectorType>::value, int> = 0>
       void
       elementwise_inv(N_Vector x, N_Vector z);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<IsBlockVector<VectorType>::value, int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<IsBlockVector<VectorType>::value, int> = 0>
       void
       elementwise_inv(N_Vector x, N_Vector z);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<!IsBlockVector<VectorType>::value, int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<!IsBlockVector<VectorType>::value, int> = 0>
       void
       elementwise_abs(N_Vector x, N_Vector z);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<IsBlockVector<VectorType>::value, int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<IsBlockVector<VectorType>::value, int> = 0>
       void
       elementwise_abs(N_Vector x, N_Vector z);
 
@@ -234,25 +228,22 @@ namespace SUNDIALS
       realtype
       max_norm(N_Vector x);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<is_serial_vector<VectorType>::value, int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<is_serial_vector<VectorType>::value, int> = 0>
       realtype
       min_element(N_Vector x);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<!is_serial_vector<VectorType>::value &&
-                                    !IsBlockVector<VectorType>::value,
-                                  int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<!is_serial_vector<VectorType>::value &&
+                                   !IsBlockVector<VectorType>::value,
+                                 int> = 0>
       realtype
       min_element(N_Vector x);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<!is_serial_vector<VectorType>::value &&
-                                    IsBlockVector<VectorType>::value,
-                                  int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<!is_serial_vector<VectorType>::value &&
+                                   IsBlockVector<VectorType>::value,
+                                 int> = 0>
       realtype
       min_element(N_Vector x);
 
@@ -268,15 +259,13 @@ namespace SUNDIALS
       void
       add_constant(N_Vector x, realtype b, N_Vector z);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<!IsBlockVector<VectorType>::value, int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<!IsBlockVector<VectorType>::value, int> = 0>
       const MPI_Comm &
       get_communicator(N_Vector v);
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<IsBlockVector<VectorType>::value, int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<IsBlockVector<VectorType>::value, int> = 0>
       const MPI_Comm &
       get_communicator(N_Vector v);
 
@@ -284,15 +273,13 @@ namespace SUNDIALS
        * Sundials likes a void* but we want to use the above functions
        * internally with a safe type.
        */
-      template <
-        typename VectorType,
-        typename std::enable_if_t<is_serial_vector<VectorType>::value, int> = 0>
+      template <typename VectorType,
+                std::enable_if_t<is_serial_vector<VectorType>::value, int> = 0>
       inline void *
       get_communicator_as_void_ptr(N_Vector v);
 
       template <typename VectorType,
-                typename std::enable_if_t<!is_serial_vector<VectorType>::value,
-                                          int> = 0>
+                std::enable_if_t<!is_serial_vector<VectorType>::value, int> = 0>
       inline void *
       get_communicator_as_void_ptr(N_Vector v);
 
@@ -561,9 +548,8 @@ namespace SUNDIALS
 
 
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<is_serial_vector<VectorType>::value, int>>
+      template <typename VectorType,
+                std::enable_if_t<is_serial_vector<VectorType>::value, int>>
       void *get_communicator_as_void_ptr(N_Vector)
       {
         // required by SUNDIALS: MPI-unaware vectors should return the nullptr
@@ -573,9 +559,8 @@ namespace SUNDIALS
 
 
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<!is_serial_vector<VectorType>::value, int>>
+      template <typename VectorType,
+                std::enable_if_t<!is_serial_vector<VectorType>::value, int>>
       void *
       get_communicator_as_void_ptr(N_Vector v)
       {
@@ -739,9 +724,8 @@ namespace SUNDIALS
 
 
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<is_serial_vector<VectorType>::value, int>>
+      template <typename VectorType,
+                std::enable_if_t<is_serial_vector<VectorType>::value, int>>
       realtype
       min_element(N_Vector x)
       {
@@ -751,11 +735,10 @@ namespace SUNDIALS
 
 
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<!is_serial_vector<VectorType>::value &&
-                                    !IsBlockVector<VectorType>::value,
-                                  int>>
+      template <typename VectorType,
+                std::enable_if_t<!is_serial_vector<VectorType>::value &&
+                                   !IsBlockVector<VectorType>::value,
+                                 int>>
       realtype
       min_element(N_Vector x)
       {
@@ -778,11 +761,10 @@ namespace SUNDIALS
 
 
 
-      template <
-        typename VectorType,
-        typename std::enable_if_t<!is_serial_vector<VectorType>::value &&
-                                    IsBlockVector<VectorType>::value,
-                                  int>>
+      template <typename VectorType,
+                std::enable_if_t<!is_serial_vector<VectorType>::value &&
+                                   IsBlockVector<VectorType>::value,
+                                 int>>
       realtype
       min_element(N_Vector x)
       {

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.