template<typename Mass = std::ratio<0>, typename Length = std::ratio<0>, typename Time = std::ratio<0>, typename Current = std::ratio<0>, typename Angle = std::ratio<0>, typename
Temperature = std::ratio<0>, typename Luminosity = std::ratio<0>, typename Moles = std::ratio<0>>
class units::Quantity< Mass, Length, Time, Current, Angle, Temperature, Luminosity, Moles >
This class provides a physical unit conversion and dimensional analysis API. Quantities define a unit given the SI base dimensions. The dimensions are the exponents of each base, Mass, Length, Time, Current, Angle, Temperature, Luminosity, Moles. E.g. Velocity is length^1 * time^-1, length/time... Arithmetic and math functions can be used on Quantities like normal. Mass * Mass = Area.
|
|
constexpr | Quantity () |
| | Default to value of 0.
|
| constexpr | Quantity (double value) |
| constexpr | Quantity (double value) |
| constexpr | Quantity (double value, Self unit) |
| constexpr | operator double () const |
| constexpr | Quantity (const Self &other)=default |
| constexpr double | internal () const |
| constexpr double | to (Self unit) const |
|
constexpr Self & | operator+= (Self other) |
| | Adds another quantity's value to this.
|
| constexpr Self & | operator+= (double other) |
|
constexpr Self & | operator-= (Self other) |
| | Subtracts another quantity's value from this.
|
| constexpr Self & | operator-= (double other) |
|
constexpr Self & | operator*= (double scalar) |
| | Multiplies this quantity by a scalar.
|
|
constexpr Self & | operator/= (double divisor) |
| | Divides this quantity by a scalar.
|
| constexpr Self & | operator= (const double &rhs) |