diff --git a/src/core/include/mp-units/framework/quantity_spec.h b/src/core/include/mp-units/framework/quantity_spec.h index fee95bb5..6a0bdc2a 100644 --- a/src/core/include/mp-units/framework/quantity_spec.h +++ b/src/core/include/mp-units/framework/quantity_spec.h @@ -1342,17 +1342,17 @@ template }; if constexpr ((NamedQuantitySpec && NamedQuantitySpec) || get_complexity(From{}) == get_complexity(To{})) - return convertible_impl(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from_kind), MP_UNITS_IS_CONST_EXPR_WORKAROUND(to_kind)); + return convertible_impl(from_kind, to_kind); else if constexpr (get_complexity(From{}) > get_complexity(To{})) return exploded_kind_result(convertible_impl( get_kind_tree_root( - explode(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from_kind)).quantity), - MP_UNITS_IS_CONST_EXPR_WORKAROUND(to_kind))); + explode(from_kind).quantity), + to_kind)); else return exploded_kind_result(convertible_impl( - MP_UNITS_IS_CONST_EXPR_WORKAROUND(from_kind), + from_kind, get_kind_tree_root( - explode(MP_UNITS_IS_CONST_EXPR_WORKAROUND(to_kind)).quantity))); + explode(to_kind).quantity))); } template @@ -1370,11 +1370,11 @@ template else if constexpr (get_complexity(From{}) != get_complexity(To{})) { if constexpr (get_complexity(From{}) > get_complexity(To{})) return convertible_impl( - explode(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from)).quantity, - MP_UNITS_IS_CONST_EXPR_WORKAROUND(to)); + explode(from).quantity, + to); else { - auto res = explode(MP_UNITS_IS_CONST_EXPR_WORKAROUND(to)); - return min(res.result, convertible_impl(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from), res.quantity)); + auto res = explode(to); + return min(res.result, convertible_impl(from, res.quantity)); } } } @@ -1390,31 +1390,30 @@ template else if constexpr (From::dimension != To::dimension) return no; else if constexpr (QuantityKindSpec || QuantityKindSpec) - return convertible_kinds(get_kind_tree_root(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from)), - get_kind_tree_root(MP_UNITS_IS_CONST_EXPR_WORKAROUND(to))); + return convertible_kinds(get_kind_tree_root(from), get_kind_tree_root(to)); else if constexpr (NestedQuantityKindSpecOf && get_kind_tree_root(To{}) == To{}) return yes; else if constexpr (NamedQuantitySpec && NamedQuantitySpec) - return convertible_named(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from), MP_UNITS_IS_CONST_EXPR_WORKAROUND(to)); + return convertible_named(from, to); else if constexpr (DerivedQuantitySpec && DerivedQuantitySpec) - return are_ingredients_convertible(from, MP_UNITS_IS_CONST_EXPR_WORKAROUND(to)); + return are_ingredients_convertible(from, to); else if constexpr (DerivedQuantitySpec) { - auto res = explode(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from)); + auto res = explode(from); if constexpr (NamedQuantitySpec) - return convertible_impl(res.quantity, MP_UNITS_IS_CONST_EXPR_WORKAROUND(to)); - else if constexpr (requires { To{}._equation_; }) { - auto eq = explode_to_equation(MP_UNITS_IS_CONST_EXPR_WORKAROUND(to)); + return convertible_impl(res.quantity, to); + else if constexpr (requires { to._equation_; }) { + auto eq = explode_to_equation(to); return min(eq.result, convertible_impl(res.quantity, eq.equation)); } else - return are_ingredients_convertible(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from), MP_UNITS_IS_CONST_EXPR_WORKAROUND(to)); + return are_ingredients_convertible(from, to); } else if constexpr (DerivedQuantitySpec) { - auto res = explode(MP_UNITS_IS_CONST_EXPR_WORKAROUND(to)); + auto res = explode(to); if constexpr (NamedQuantitySpec) - return min(res.result, convertible_impl(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from), res.quantity)); - else if constexpr (requires { From{}._equation_; }) - return min(res.result, convertible_impl(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from)._equation_, res.quantity)); + return min(res.result, convertible_impl(from, res.quantity)); + else if constexpr (requires { from._equation_; }) + return min(res.result, convertible_impl(from._equation_, res.quantity)); else - return min(res.result, are_ingredients_convertible(MP_UNITS_IS_CONST_EXPR_WORKAROUND(from), MP_UNITS_IS_CONST_EXPR_WORKAROUND(to))); + return min(res.result, are_ingredients_convertible(from, to)); } // NOLINTEND(bugprone-branch-clone) return no;