Boost logo

Boost Users :

Subject: Re: [Boost-users] Flow rate dimensional analysis
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-09-19 15:14:36


On 09/19/2011 12:01 PM, Michael Powell wrote:
> On Mon, Sep 19, 2011 at 12:57 PM, Steven Watanabe <watanabesj_at_[hidden]>wrote:
>> On 09/19/2011 11:29 AM, Michael Powell wrote:
>>> However, when I do this, I do get a compiler error:
>>> quantity<cs::units::si::flow_rate, float> __fr = __C_flow * __a_orifice
>> *
>>> boost::units::sqrt(__two * __p_diff / __d);
> If it can be fixed from a library perspective, great. It's easy enough to
> workaround, however, taking static_cast<float>(x.value()) of the
> intermediate result, and so that we don't get too far removed from the
> dimensional analysis.

Actually, you can directly convert the quantities.
The conversion is just explicit. You're getting
an error because the code tries to do an implicit

In Christ,
Steven Watanabe

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at