AMDG On 11/20/2018 06:46 PM, Matt Vinson via Boost-users wrote:
<snip> <some reformatting to reduce line wrapping> *.h-----------------------------------------------------
namespace dimensional_analysis {
typedef length_base_dimension::dimension_type length_dimension; typedef mass_base_dimension::dimension_type mass_dimension;
typedef make_system
::type ip_system;
This should be pound_force_base_unit.
namespace lineal_force { typedef mpl::divides
::type lineal_force_dimension; namespace imperial {
//////////////// ////lb/in, right?
////boost::units::force_dimension =pound ////boost::units::length_dimension = in //////////////// typedef unit
lineal_force_unit;
This unit is nonsensical because the ip_system as written is unable to represent the lineal_force_dimension. That this doesn't give a hard compiler error is a bug in the library. Once you fix ip_system, the conversions should be right.
} namespace si { //////////////// ////N/m, right?
Yep.
////boost::units::force_dimension = newton ////boost::units::length_dimension = meter //////////////// typedef unit
lineal_force_unit; } }//lineal_force }//dimensional_analysis *.cpp-----------------------------------------------------
//Imperiallb/in to SI N/m
The following conversion definitions are unnecessary and have no effect:
BOOST_UNITS_DEFINE_CONVERSION_FACTOR( dimensional_analysis::lineal_force::imperial::lineal_force_unit, dimensional_analysis::lineal_force::si::lineal_force_unit, double, 175.1268369864); // exact conversion
BOOST_UNITS_DEFAULT_CONVERSION( dimensional_analysis::lineal_force::imperial::lineal_force_unit, dimensional_analysis::lineal_force::si::lineal_force_unit);
//SI N/mto Imperial lb/in
BOOST_UNITS_DEFINE_CONVERSION_FACTOR( dimensional_analysis::lineal_force::si::lineal_force_unit, dimensional_analysis::lineal_force::imperial::lineal_force_unit, double, 0.1837185501); // exact conversion
BOOST_UNITS_DEFAULT_CONVERSION( dimensional_analysis::lineal_force::si::lineal_force_unit, dimensional_analysis::lineal_force::imperial::lineal_force_unit);
<snip>
In Christ, Steven Watanabe