mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-09 15:14:27 +02:00
fix: symbols of named dimensionless units with the ratio = 1 were not printed
This commit is contained in:
@@ -695,7 +695,7 @@ constexpr Out print_separator(Out out, unit_symbol_formatting fmt)
|
|||||||
template<Unit U>
|
template<Unit U>
|
||||||
[[nodiscard]] consteval bool has_unit_symbol(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>
|
template<typename CharT, std::output_iterator<CharT> Out, Unit U>
|
||||||
|
Reference in New Issue
Block a user