Boost logo

Boost Users :

Subject: [Boost-users] [units] runtime conversion approach
From: Michael Powell (mwpowellnm_at_[hidden])
Date: 2011-07-28 22:43:01

Units developers/user,

I need some help understanding unit conversions using boost::units. I see
there are conversions.hpp header files. Does this mean that there are
built-in unit conversions for fundamental units, or even mainstream derived
ones by simply including the conversions and performing the appropriate

Can I do something like this, for instance?

quantity<si::length> test_m = 1.0 * meter;
quantity<us::inch> test_in = test_m * inch / meter;

What is the best way to go about setting up conversions, or for that matter,
defining a unit system; for instance, the us (english) unit system does not
appear to be available?

I've read a couple of the old mailing list entries, but I'm not sure I fully
understand the examples that I could follow them.

Thank you...



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at