Macro BOOST_UNITS_DEFINE_CONVERSION_OFFSET

| Home | Libraries | People | FAQ | More

## Macro BOOST_UNITS_DEFINE_CONVERSION_OFFSET

BOOST_UNITS_DEFINE_CONVERSION_OFFSET

## Synopsis

    BOOST_UNITS_DEFINE_CONVERSION_OFFSET(From, To, type_, value_)

## Description

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.