From 8eef11144b4cf9fa827edcb391c8b785af780061 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sat, 15 Feb 2025 14:29:52 +0100 Subject: [PATCH] refactor: branch with constant condition changed to `if constexpr` --- src/core/include/mp-units/framework/unit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/include/mp-units/framework/unit.h b/src/core/include/mp-units/framework/unit.h index 3dae2d99a..385aceac6 100644 --- a/src/core/include/mp-units/framework/unit.h +++ b/src/core/include/mp-units/framework/unit.h @@ -879,7 +879,7 @@ constexpr Out unit_symbol_impl(Out out, const type_list& nums, const ty if (fmt.solidus == always || (fmt.solidus == one_denominator && sizeof...(Dens) == 1)) { if constexpr (sizeof...(Nums) == 0) *out++ = '1'; *out++ = '/'; - if (sizeof...(Dens) > 1) *out++ = '('; + if constexpr (sizeof...(Dens) > 1) *out++ = '('; } else if constexpr (sizeof...(Nums) > 0) { out = print_separator(out, fmt); }