如何以度为单位定义增强单位角度?下面显示了有效的弧度和无效的度数。
#include <boost/units/unit.hpp>
#include <boost/units/systems/si/io.hpp>
#include <boost/units/systems/angle/degrees.hpp>
// This works for defining an angle in radians
boost::units::quantity<
boost::units::unit<
boost::units::plane_angle_dimension,
boost::units::si::system
>
> my_angle_radians(2.0 * boost::units::si::radian);
// This is what I'm trying to do that doesn't work
boost::units::quantity<
boost::units::unit<
boost::units::plane_angle_dimension,
boost::units::degree::system
>
> my_angle_degree(2.0 * boost::units::angle::degree_base_unit);