Skip to content

Commit

Permalink
add explicit conversion operator for Number
Browse files Browse the repository at this point in the history
  • Loading branch information
SizzinSeal committed Jan 6, 2025
1 parent 100e3a2 commit 958c6a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/units/units.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ class Number : public Quantity<std::ratio<0>, std::ratio<0>, std::ratio<0>, std:
: 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>>(double(value)) {}

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

constexpr Number(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)
Expand Down

0 comments on commit 958c6a0

Please sign in to comment.