]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix clang-tidy complaints for Symengine 8584/head
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 15 Aug 2019 17:49:59 +0000 (13:49 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 15 Aug 2019 17:49:59 +0000 (13:49 -0400)
include/deal.II/differentiation/sd/symengine_number_types.h
include/deal.II/differentiation/sd/symengine_product_types.h
source/differentiation/sd/symengine_number_types.cc
source/differentiation/sd/symengine_scalar_operations.cc
source/differentiation/sd/symengine_utilities.cc

index 56bed0ba9fc9b9645b022d096ec25d1b090f779a..7ba464c2592b6c02c50bcdd13adf3872db794090 100644 (file)
@@ -517,7 +517,7 @@ namespace Differentiation
        * to that of the @p rhs object.
        */
       Expression &
-      operator=(Expression &&rhs);
+      operator=(Expression &&rhs) noexcept;
 
       /**
        * Addition assignment.
index 06d78aa6c5d237e445345afeef163db364a9cb97..6ab5f71ea883fe8328c922e6ff5d190911c97e05 100644 (file)
@@ -36,7 +36,7 @@ DEAL_II_NAMESPACE_OPEN
 template <>
 struct EnableIfScalar<Differentiation::SD::Expression>
 {
-  typedef Differentiation::SD::Expression type;
+  using type = Differentiation::SD::Expression;
 };
 
 
@@ -69,7 +69,7 @@ namespace internal
       Differentiation::SD::Expression,
       typename std::enable_if<std::is_arithmetic<T>::value>::type>
     {
-      typedef Differentiation::SD::Expression type;
+      using type = Differentiation::SD::Expression;
     };
 
     template <typename T>
@@ -80,7 +80,7 @@ namespace internal
         boost::is_complex<T>::value &&
         std::is_arithmetic<typename T::value_type>::value>::type>
     {
-      typedef Differentiation::SD::Expression type;
+      using type = Differentiation::SD::Expression;
     };
 
   } // namespace SD
@@ -90,26 +90,22 @@ namespace internal
   struct ProductTypeImpl<Differentiation::SD::Expression,
                          Differentiation::SD::Expression>
   {
-    typedef Differentiation::SD::Expression type;
+    using type = Differentiation::SD::Expression;
   };
 
 
   template <typename T>
   struct ProductTypeImpl<T, Differentiation::SD::Expression>
   {
-    typedef
-      typename SD::GeneralProductTypeImpl<T,
-                                          Differentiation::SD::Expression>::type
-        type;
+    using type = typename SD::
+      GeneralProductTypeImpl<T, Differentiation::SD::Expression>::type;
   };
 
   template <typename T>
   struct ProductTypeImpl<Differentiation::SD::Expression, T>
   {
-    typedef
-      typename SD::GeneralProductTypeImpl<T,
-                                          Differentiation::SD::Expression>::type
-        type;
+    using type = typename SD::
+      GeneralProductTypeImpl<T, Differentiation::SD::Expression>::type;
   };
 
 } // namespace internal
index fce494713b547356b9715146bc441f3ea0505758..7851d8fbae089dc619316f533ee1fccf246242af 100644 (file)
@@ -317,7 +317,7 @@ namespace Differentiation
 
 
     Expression &
-    Expression::operator=(Expression &&rhs)
+    Expression::operator=(Expression &&rhs) noexcept
     {
       if (this != &rhs)
         this->expression = std::move(rhs.expression);
index 8fda61060af7a6b06734a0df4512c7c92649e8b4..33a5069f0f48004386f5f9ed4ccebf5360696a3b 100644 (file)
@@ -239,7 +239,7 @@ namespace Differentiation
                 }
 
               // Compute and store the hash of the new object
-              hash_old = std::move(hash_new);
+              hash_old = hash_new;
               hash_new = out.get_RCP()->hash();
               AssertThrow(
                 iter < size,
index 3d499a9e4aad9495927792bd657e5d53800c2ac3..d7fed2e219046ca3eb44193ad8f1255dbbbd1a72 100644 (file)
@@ -59,11 +59,8 @@ namespace Differentiation
         SD::types::symbol_vector symbols;
         symbols.reserve(substitution_values.size());
 
-        for (typename SD::types::substitution_map::const_iterator it =
-               substitution_values.begin();
-             it != substitution_values.end();
-             ++it)
-          symbols.push_back(it->first);
+        for (const auto &substitution : substitution_values)
+          symbols.push_back(substitution.first);
 
         return symbols;
       }

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.