Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Macro BOOST_UNITS_DEFINE_CONVERSION_OFFSET

BOOST_UNITS_DEFINE_CONVERSION_OFFSET

Synopsis

// In header: <boost/units/absolute.hpp>

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.


PrevUpHomeNext