mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-02 20:04:27 +02:00
refactor: branch with constant condition changed to if constexpr
This commit is contained in:
@@ -879,7 +879,7 @@ constexpr Out unit_symbol_impl(Out out, const type_list<Nums...>& nums, const ty
|
|||||||
if (fmt.solidus == always || (fmt.solidus == one_denominator && sizeof...(Dens) == 1)) {
|
if (fmt.solidus == always || (fmt.solidus == one_denominator && sizeof...(Dens) == 1)) {
|
||||||
if constexpr (sizeof...(Nums) == 0) *out++ = '1';
|
if constexpr (sizeof...(Nums) == 0) *out++ = '1';
|
||||||
*out++ = '/';
|
*out++ = '/';
|
||||||
if (sizeof...(Dens) > 1) *out++ = '(';
|
if constexpr (sizeof...(Dens) > 1) *out++ = '(';
|
||||||
} else if constexpr (sizeof...(Nums) > 0) {
|
} else if constexpr (sizeof...(Nums) > 0) {
|
||||||
out = print_separator<CharT>(out, fmt);
|
out = print_separator<CharT>(out, fmt);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user