12 namespace duds {
namespace data {
A container for a value and a unit to better describe the value.
Unit unit
The units describing the value.
Indicates that two different Unit objects were used in an operation that requires identical Unit obje...
Quantity()=default
The default constructor; expect value and unit to be uninitialized.
bool operator<(const Quantity &q) const
Compares two quantities of the same units.
Quantity & operator-=(const Quantity &q)
Subtracts a quantity from another; they must use the same units.
Quantity & operator+=(const Quantity &q)
Adds two quantities; they must use the same units.
Quantity operator+(const Quantity &q) const
Adds two quantities; they must use the same units.
bool operator>(const Quantity &q) const
Compares two quantities of the same units.
Quantity operator-(const Quantity &q) const
Subtracts a quantity from another; they must use the same units.
bool operator<=(const Quantity &q) const
Compares two quantities of the same units.
Quantity & operator/=(const Quantity &q)
Divides a quantity by another; the units are also divided.
double value
Some value; probably something measured.
Quantity & operator*=(const Quantity &q)
Multiplies two quantities; the units are also multiplied.
#define DUDS_THROW_EXCEPTION(x)
Works like BOOST_THROW_EXCEPTION, but includes a stack trace if DUDS_ERRORS_VERBOSE is defined...
bool operator>=(const Quantity &q) const
Compares two quantities of the same units.