fix: symbols of named dimensionless units with the ratio = 1 were not printed

This commit is contained in:
Mateusz Pusz
2023-09-29 06:30:28 +02:00
parent caf0e66cb2
commit d5a0874bea

View File

@@ -695,7 +695,7 @@ constexpr Out print_separator(Out out, unit_symbol_formatting fmt)
template<Unit U>
[[nodiscard]] consteval bool has_unit_symbol(U)
{
return !std::derived_from<U, derived_unit<>>;
return requires { U::symbol; } || !std::derived_from<U, derived_unit<>>;
}
template<typename CharT, std::output_iterator<CharT> Out, Unit U>