Boost logo

Boost Users :

Subject: [Boost-users] boost::units implicit conversions
From: Michael Powell (mwpowellnm_at_[hidden])
Date: 2011-07-25 13:17:13

Boost::units users,

I have gotten my feet wet with boost::units over the past several days and
starting to get the hang of it, dimensions, quantities, and units, and so

Now I would like to start thinking more in terms of how these units-based
calculations should be used by the rest of our application. Of primary
concern is to receive a quantity of dimension from the application in a
specified unit and to be able to perform the calculations.

One concept I've been wondering about is whether there is any value in
converting units to a base unit for purposes of IPC (interprocess
communication), saving to or loading from files, or that sort of thing. In
this way we will know that if we see a quantity of length dimension, for
instance, we can always expect the value to be presented in terms of, let's
say, meters.

My question concerning calculations is something along these lines: how does
boost::units treat a quantity<dimension> when facilitating dimensioned
calculations? Or is it on us as developers to ensure that an appropriate
unit-conversion is taking place somewhere along the way when we are ready to
interpret the result for display, report, or whatever?

Let me know if I can clarify at all, because I am a little fuzzy along these
lines at the moment.

Thank you...



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