我正在尝试为系统创建derived_dimension
质量boost::units
流量si
。我找不到任何有关如何执行此简单任务的文档。这是我到目前为止所拥有的,但我在编译过程中遇到了错误。
typedef boost::units::derived_dimension<
boost::units::mass_base_dimension, 3,
boost::units::time_base_dimension, -1
>::type mass_flow_rate_dimension;
typedef boost::units::unit<
mass_flow_rate_dimension,
boost::units::si::system
> mass_flow_rate_unit;
typedef boost::units::quantity<mass_flow_rate_unit, double> mass_flow_rate;
BOOST_UNITS_STATIC_CONSTANT(kilogram_per_seconds, mass_flow_rate);
这就是我得到错误的方式:
mass_flow_rate MFR;
quantity<mass_density> density = 1.0 * kilogram_per_cubic_meter;
quantity<si::time> Time = 1.0 * second;
quantity<volume> vol = 1.0 * cubic_meters;
MFR = density * vol / Time;
错误:C2338(is_simply_convertible::value == true)