Skip to content

Commit

Permalink
remove references to Number in NEW_UNIT macro
Browse files Browse the repository at this point in the history
  • Loading branch information
SizzinSeal committed Jan 7, 2025
1 parent 8dfa4de commit 93d4313
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions include/units/units.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,12 @@ template <isQuantity Q, isQuantity R> constexpr bool operator>(const Q& lhs, con
return os; \
} \
constexpr inline Name from_##suffix(double value) { return Name(value); } \
constexpr inline Name from_##suffix(Number value) { return Name(value.internal()); } \
constexpr inline double to_##suffix(Name quantity) { return quantity.internal(); }

#define NEW_UNIT_LITERAL(Name, suffix, multiple) \
[[maybe_unused]] constexpr Name suffix = multiple; \
constexpr Name operator""_##suffix(long double value) { return static_cast<double>(value) * multiple; } \
constexpr Name operator""_##suffix(unsigned long long value) { return static_cast<double>(value) * multiple; } \
constexpr inline Name from_##suffix(Number value) { return value.internal() * multiple; } \
constexpr inline double to_##suffix(Name quantity) { return quantity.convert(multiple); }

#define NEW_METRIC_PREFIXES(Name, base) \
Expand All @@ -333,8 +331,6 @@ template <isQuantity Q, isQuantity R> constexpr bool operator>(const Q& lhs, con
NEW_UNIT_LITERAL(Name, u##base, base / 1E6) \
NEW_UNIT_LITERAL(Name, n##base, base / 1E9)

NEW_UNIT_LITERAL(Number, percent, num / 100)

NEW_UNIT(Mass, kg, 1, 0, 0, 0, 0, 0, 0, 0)
NEW_UNIT_LITERAL(Mass, g, kg / 1000)
NEW_UNIT_LITERAL(Mass, lb, g * 453.6)
Expand Down

0 comments on commit 93d4313

Please sign in to comment.