ome-xml
5.6.0
|
Convert a quantity to a different unit. More...
#include <ome/xml/model/primitives/Quantity.h>
Public Member Functions | |
Quantity< Unit, Value > | operator() (const Quantity< Unit, Value > &quantity, typename Quantity< Unit, Value >::unit_type unit) const |
Convert quantity to another unit. More... | |
Convert a quantity to a different unit.
Helper to work around the lack of partial function template specialization. You shouldn't need to use this directly; use the plain convert() function instead.
Quantity<Unit, Value> ome::xml::model::primitives::QuantityConverter< Unit, Value >::operator() | ( | const Quantity< Unit, Value > & | quantity, |
typename Quantity< Unit, Value >::unit_type | unit | ||
) | const |
Convert quantity to another unit.
quantity | the quantity to convert. |
unit | the unit to which to convert the quantity. |
std::logic | error if the unit systems are incompatible making conversion impossible. |