Prefixed units support redesigned
This commit is contained in:
1 parent
95028d10a7
commit
b864461636
30 files changed
+284
-236
No files matched your search
@@ -23,7 +23,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <units/bits/concepts.h>
|
||||
#include <units/prefix.h>
|
||||
#include <units/unit.h>
|
||||
#include <units/format.h>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
|
||||
@@ -283,7 +284,7 @@ namespace units {
|
||||
os << q.count() << " ";
|
||||
if constexpr(!detail::is_unit<quantity::unit>) {
|
||||
// print user-defined unit
|
||||
os << unit::symbol::c_str();
|
||||
os << unit::symbol;
|
||||
}
|
||||
else {
|
||||
using ratio = quantity::unit::ratio;
|
||||
@@ -291,8 +292,8 @@ namespace units {
|
||||
if constexpr(!detail::is_dimension<dim>) {
|
||||
// print as a prefix or ratio of a coherent unit symbol defined by the user
|
||||
using coherent_unit = downcast_target<units::unit<dim, units::ratio<1>>>;
|
||||
detail::print_prefix_or_ratio<ratio, typename coherent_unit::prefix>(os);
|
||||
os << coherent_unit::symbol::c_str();
|
||||
detail::print_prefix_or_ratio<ratio, typename coherent_unit::prefix_type>(os);
|
||||
os << coherent_unit::symbol;
|
||||
}
|
||||
else {
|
||||
// print as a ratio of a coherent unit
|
||||
|
||||
Reference in new issue
Block a user