[Units] How to use units from different systems
I am trying to use the boost::units library for the first time. I'm able to use the SI system. However, I would like to use units from different systems. Particularly, I would like to be able to write: quantity<si::length> L = 3.0 * us::inch + 0.50 * si::meter; The library comes with a us::inch_base_unit. But I don't know how to create a us::inch unit. Any help is appreciated. Juan José
AMDG Juan José Icaza wrote:
I am trying to use the boost::units library for the first time. I'm able to use the SI system. However, I would like to use units from different systems. Particularly, I would like to be able to write:
quantity<si::length> L = 3.0 * us::inch + 0.50 * si::meter;
The library comes with a us::inch_base_unit. But I don't know how to create a us::inch unit. Any help is appreciated.
us::inch_base_unit::unit_type inch; quantity<si::length> L = static_cast<quantity<si::length> >(3.0 * inch) + 0.50 * si::meter; In Christ, Steven Watanabe
participants (2)
-
Juan José Icaza
-
Steven Watanabe