Skip to content

Commit

Permalink
remove Number implicit conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
SizzinSeal committed Dec 29, 2024
1 parent 3785a9c commit 6f3befe
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions include/units/units.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,6 @@ class Number : public Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std:
value)
: Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>,
std::ratio<0>, std::ratio<0>>(value) {};

template <typename T> constexpr operator T() const { return T(value); }
};

template <> struct LookupName<Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>,
Expand Down Expand Up @@ -355,17 +353,7 @@ constexpr inline Number from_num(double value) { return Number(value); }

constexpr inline double to_num(Number quantity) { return quantity.internal(); }

[[maybe_unused]] constexpr Number percent = num / 100.0;

constexpr Number operator""_percent(long double value) { return value / 100.0; }

constexpr Number operator""_percent(unsigned long long value) { return value / 100.0; }

constexpr inline Number from_percent(double value) { return value / 100.0; }

constexpr inline Number from_percent(Number value) { return value / 100.0; }

constexpr inline double to_percent(Number quantity) { return quantity.internal() * 100.0; }
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)
Expand Down

0 comments on commit 6f3befe

Please sign in to comment.