您可以使用单位运算符来操作更高级别的维度,然后将它们输入定义为有用的东西。<boost/units/operators.hpp>
这些单位运算符在头文件中可用。
文档中提供了示例,它们用于在此处为物理常数创建高级尺寸[<boost/units/systems/si/codata/typedefs.hpp>][1]
typedef divide_typeof_helper<frequency,electric_potential>::type frequency_over_electric_potential;
typedef divide_typeof_helper<electric_charge,mass>::type electric_charge_over_mass;
typedef divide_typeof_helper<mass,amount>::type mass_over_amount;
并针对您的具体情况:
typedef divide_typeof_helper< power , area >::type power_over_area;
typedef divide_typeof_helper< power_over_area, temperature >::type heat_transfer_coeff;