[units][phoenix] static physical constants don't play well with phoenix?

Hi, This post is just to point out a deficiency of either boost.phoenix or boost.units and see if there are workarounds. Phoenix 3 now plays well with Boos.units quantities out of the box but for some reason it does not play well with boost.units static physical constants. Like in the following example. This is because the constant 'hbar' is not a normal quantity type but a boost::units::constant< ... hbar_t > type. do you think physical constants could be defined as normal quantities in the future so it can play well with phoenix? #include<iostream> #include<boost/units/systems/si/io.hpp> #include<boost/units/systems/si/codata_constants.hpp> #include<boost/phoenix/phoenix.hpp> int main(){ using namespace boost::units; using namespace boost::phoenix; using namespace boost::phoenix::arg_names; quantity<si::action> const hbarvar = boost::units::si::constants::codata::hbar; std::clog << (arg1 * hbarvar)(5.) << std::endl; // works std::clog << (arg1 * boost::units::si::constants::codata::hbar)(5.) << std::endl; //doesn't work return 0; }
participants (1)
-
alfC