From: Wolfgang Bangerth Date: Tue, 11 Feb 2025 18:13:16 +0000 (-0700) Subject: Only overload complex-valued operators if T!=U. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18121%2Fhead;p=dealii.git Only overload complex-valued operators if T!=U. --- diff --git a/include/deal.II/base/complex_overloads.h b/include/deal.II/base/complex_overloads.h index 93d44ea5bd..0009637f65 100644 --- a/include/deal.II/base/complex_overloads.h +++ b/include/deal.II/base/complex_overloads.h @@ -64,7 +64,8 @@ struct ProductType; */ template inline std::enable_if_t< - std::is_floating_point_v && std::is_floating_point_v, + std::is_floating_point_v && std::is_floating_point_v && + !std::is_same_v, typename ProductType, std::complex>::type> operator*(const std::complex &left, const std::complex &right) { @@ -104,7 +105,8 @@ operator*(const std::complex &left, const std::complex &right) */ template inline std::enable_if_t< - std::is_floating_point_v && std::is_floating_point_v, + std::is_floating_point_v && std::is_floating_point_v && + !std::is_same_v, typename ProductType, std::complex>::type> operator/(const std::complex &left, const std::complex &right) { @@ -144,7 +146,7 @@ operator/(const std::complex &left, const std::complex &right) */ template inline std::enable_if_t && - std::is_floating_point_v, + std::is_floating_point_v && !std::is_same_v, typename ProductType, U>::type> operator*(const std::complex &left, const U &right) { @@ -183,7 +185,7 @@ operator*(const std::complex &left, const U &right) */ template inline std::enable_if_t && - std::is_floating_point_v, + std::is_floating_point_v && !std::is_same_v, typename ProductType, U>::type> operator/(const std::complex &left, const U &right) { @@ -222,7 +224,7 @@ operator/(const std::complex &left, const U &right) */ template inline std::enable_if_t && - std::is_floating_point_v, + std::is_floating_point_v && !std::is_same_v, typename ProductType>::type> operator*(const T &left, const std::complex &right) { @@ -261,7 +263,7 @@ operator*(const T &left, const std::complex &right) */ template inline std::enable_if_t && - std::is_floating_point_v, + std::is_floating_point_v && !std::is_same_v, typename ProductType>::type> operator/(const T &left, const std::complex &right) {