From: Daniel Arndt Date: Thu, 15 Aug 2019 17:49:59 +0000 (-0400) Subject: Fix clang-tidy complaints for Symengine X-Git-Tag: v9.2.0-rc1~1235^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8584%2Fhead;p=dealii.git Fix clang-tidy complaints for Symengine --- diff --git a/include/deal.II/differentiation/sd/symengine_number_types.h b/include/deal.II/differentiation/sd/symengine_number_types.h index 56bed0ba9f..7ba464c259 100644 --- a/include/deal.II/differentiation/sd/symengine_number_types.h +++ b/include/deal.II/differentiation/sd/symengine_number_types.h @@ -517,7 +517,7 @@ namespace Differentiation * to that of the @p rhs object. */ Expression & - operator=(Expression &&rhs); + operator=(Expression &&rhs) noexcept; /** * Addition assignment. diff --git a/include/deal.II/differentiation/sd/symengine_product_types.h b/include/deal.II/differentiation/sd/symengine_product_types.h index 06d78aa6c5..6ab5f71ea8 100644 --- a/include/deal.II/differentiation/sd/symengine_product_types.h +++ b/include/deal.II/differentiation/sd/symengine_product_types.h @@ -36,7 +36,7 @@ DEAL_II_NAMESPACE_OPEN template <> struct EnableIfScalar { - typedef Differentiation::SD::Expression type; + using type = Differentiation::SD::Expression; }; @@ -69,7 +69,7 @@ namespace internal Differentiation::SD::Expression, typename std::enable_if::value>::type> { - typedef Differentiation::SD::Expression type; + using type = Differentiation::SD::Expression; }; template @@ -80,7 +80,7 @@ namespace internal boost::is_complex::value && std::is_arithmetic::value>::type> { - typedef Differentiation::SD::Expression type; + using type = Differentiation::SD::Expression; }; } // namespace SD @@ -90,26 +90,22 @@ namespace internal struct ProductTypeImpl { - typedef Differentiation::SD::Expression type; + using type = Differentiation::SD::Expression; }; template struct ProductTypeImpl { - typedef - typename SD::GeneralProductTypeImpl::type - type; + using type = typename SD:: + GeneralProductTypeImpl::type; }; template struct ProductTypeImpl { - typedef - typename SD::GeneralProductTypeImpl::type - type; + using type = typename SD:: + GeneralProductTypeImpl::type; }; } // namespace internal diff --git a/source/differentiation/sd/symengine_number_types.cc b/source/differentiation/sd/symengine_number_types.cc index fce494713b..7851d8fbae 100644 --- a/source/differentiation/sd/symengine_number_types.cc +++ b/source/differentiation/sd/symengine_number_types.cc @@ -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); diff --git a/source/differentiation/sd/symengine_scalar_operations.cc b/source/differentiation/sd/symengine_scalar_operations.cc index 8fda61060a..33a5069f0f 100644 --- a/source/differentiation/sd/symengine_scalar_operations.cc +++ b/source/differentiation/sd/symengine_scalar_operations.cc @@ -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, diff --git a/source/differentiation/sd/symengine_utilities.cc b/source/differentiation/sd/symengine_utilities.cc index 3d499a9e4a..d7fed2e219 100644 --- a/source/differentiation/sd/symengine_utilities.cc +++ b/source/differentiation/sd/symengine_utilities.cc @@ -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; }