![]() |
Home | Libraries | People | FAQ | More |
BOOST_UNITS_DEFINE_CONVERSION_OFFSET
BOOST_UNITS_DEFINE_CONVERSION_OFFSET(From, To, type_, value_)
Macro to define the offset between two absolute units. Requires the value to be in the destination units e.g
定義了兩個絕對單位之間的編移值。其中的數值應用在目的單位上。
BOOST_UNITS_DEFINE_CONVERSION_OFFSET(celsius_base_unit, fahrenheit_base_unit, double, 32.0);
BOOST_UNITS_DEFINE_CONVERSION_FACTOR is also necessary to specify the conversion factor. Like BOOST_UNITS_DEFINE_CONVERSION_FACTOR this macro defines both forward and reverse conversions so defining, e.g., the conversion from celsius to fahrenheit as above will also define the inverse conversion from fahrenheit to celsius.
BOOST_UNITS_DEFINE_CONVERSION_FACTOR在定義轉換比例係數時是需要的。類似於BOOST_UNITS_DEFINE_CONVERSION_FACTOR,這個宏也定義了雙向的轉換,如上例,從攝氏到華氏的轉換以及反向的轉換都被定義了。