Boost logo

Boost Users :

Subject: Re: [Boost-users] boost/units - converting forces (lbf->N)
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-12-01 17:35:08


On 12/01/2018 06:25 AM, Matt Vinson via Boost-users wrote:
> To see if I understand the library, I want to create metric and imperial systems without using Boost Units predefined systems*.  Conversions between lengths are going well.  Conversion between forces are going well until pounds-force to newtons; line 182 in the link.  What am I doing wrong when lbf will not convert to newtons?

There are a few problems.

  base unit) as its second argument.
- You are defining both a kilogram_base_unit and a kilo_gram_base_unit.
  Either one will work, but you need to be consistent. You're
  defining the conversion in terms of kilo_gram_base_unit, but
  metric::system uses kilogram_base_unit.
- The definition of a composite conversion for force is not
  needed and will be ignored.
- metric and imperial have separate definitions of second_base_unit
  with no conversion between them.
- lbf is not the same as (lbm in s^-2)

> Here is my code:
> Any help is appreciated.
> *
> //imperial
> namespace boost {namespace units {
> namespace us {}}}//sinamespace boost {
> namespace units {
> namespace si {}}}

In Christ,
Steven Watanabe

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