Measurement unit for an accumulation of two quantities of different units
Synopsis
Base Classes
Name |
Description |
|
Types
Static Data Members
Description
While adding two quantities of different units we can often identify which of those unit should be used to prevent data truncation. For example, adding 1 m + 1 `mm` will end up in a quantity expressed in millimeters. However, for some cases this is not possible. Choosing any of the units from the arguments of the addition would result in a data truncation. For example, a common unit for `1 km + 1 `mi` is `[8/125] m
. Instead of returning such a complex unit type the library will return a common_unit<mi, km>
. This type is convertible to both mi
and km
without risking data truncation, but is not equal to any of them.
Note
|
User should not instantiate this type! It is not exported from the C++ module. The library will instantiate this type automatically based on the unit arithmetic equation provided by the user. |
Created with MrDocs