我可以从divide_typeof_helper中检索基本usint吗?

问题描述 投票:1回答:1

我们确实定义了我们计划在我们的应用程序中使用的相关单元(基础和派生)。已经使用divide_typeof_helper定义了一些派生单位(例如,对于速度数量,km_per_hour_unit)。

using namespace boost::units;

namespace my_units
{
    typedef metric::hour_base_unit::unit_type   hour_unit;
    typedef kilometer_base_unit::unit_type   kilometer_unit;
    typedef divide_typeof_helper<kilometer_unit, hour_unit>::type km_per_hour_unit;
}

现在......假设我知道我正在处理km_per_hour_unit,有没有办法可以检索用作速度派生单位的分子和分母的单位?

我希望以某种方式从km_per_hour_unit到达kilometer_unit和hour_unit。

任何提示?

c++ boost boost-units
1个回答
0
投票

根据the documentation的说法,没有办法收回这些信息。

这就是说,无论如何都有无效的C ++概要(typedef是一个成员函数怎么样?别名的名字是什么?)所以也许可以用一小撮盐来仔细检查一下Boost邮件列表。

© www.soinside.com 2019 - 2024. All rights reserved.