Skip to content

Commit 6f3befe

Browse files
committed
remove Number implicit conversion
1 parent 3785a9c commit 6f3befe

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

include/units/units.hpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,6 @@ class Number : public Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std:
325325
value)
326326
: Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>, std::ratio<0>,
327327
std::ratio<0>, std::ratio<0>>(value) {};
328-
329-
template <typename T> constexpr operator T() const { return T(value); }
330328
};
331329

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

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

358-
[[maybe_unused]] constexpr Number percent = num / 100.0;
359-
360-
constexpr Number operator""_percent(long double value) { return value / 100.0; }
361-
362-
constexpr Number operator""_percent(unsigned long long value) { return value / 100.0; }
363-
364-
constexpr inline Number from_percent(double value) { return value / 100.0; }
365-
366-
constexpr inline Number from_percent(Number value) { return value / 100.0; }
367-
368-
constexpr inline double to_percent(Number quantity) { return quantity.internal() * 100.0; }
356+
NEW_UNIT_LITERAL(Number, percent, num / 100)
369357

370358
NEW_UNIT(Mass, kg, 1, 0, 0, 0, 0, 0, 0, 0)
371359
NEW_UNIT_LITERAL(Mass, g, kg / 1000)

0 commit comments

Comments
 (0)