Boost logo

Boost Users :

Subject: Re: [Boost-users] [units] slowness dimension
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2014-02-16 20:30:03


On 15/02/2014 03:49, Quoth Michael Powell:
> I've learned about a "new" (or potentially new-to-boost-units, at any
> rate) dimension this week. TBD whether we'll be using boost or even
> units, but in the event we would, I'd like to add a slowness
> dimension. Basically it is the inverse of velocity: where velocity is
> time per length, slowness is length per time. Taking a gander at the
> velocity.hpp physical dimension, doesn't seem like a terribly hard
> thing to do, and with the new Git-module decomp, even less so today?

It's fairly straightforward to define your own custom dimensions using
Boost.Units, especially when they're based on the existing dimensions
and base units.

You can do this in your application code, without touching Boost.Units
itself.

Have a look at boost/units/physical_dimensions/velocity.hpp and just
define your new dimension similarly -- you can then define units (see
boost/units/systems/si/velocity.hpp) and quantities using that and then
everything else should automatically recognise it and just work.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net