2

In boost units, I usually assign values by multiplying with one of the static consts:

e.g.

using namespace boost::units;
quantity<si::angular_velocity> av = 0.5 * si::radians_per_second;

But how can I do it when there is no multiplier const defined?

e.g. This doesn't compile because boost::units::si::radians_per_second_per_second isn't defined.

quantity<si::angular_acceleration> aa = 0.5 * si::radians_per_second_per_second;
Matthew Smith
  • 6,165
  • 6
  • 34
  • 35

1 Answers1

1

As @celtschk suggested in the comments, the units can be assigned by applying the correct operation to the units multipliers:

quantity<si::angular_acceleration> aa = 0.5 * si::radians_per_second / si::seconds;
Matthew Smith
  • 6,165
  • 6
  • 34
  • 35