I am trying to defined a constexpr in terms of kilometers instead of meters using boost units. Everything I have read indicates that both lines below should work, but only the top line compiles for me in clang 10.
Here's a godbolt link for the lazy: https://godbolt.org/z/38je3z
#include <boost/units/systems/si.hpp>
#include <boost/units/systems/si/prefixes.hpp>
#include <boost/units/unit.hpp>
class earthConstants{
public:
// Works
static constexpr boost::units::quantity<boost::units::si::length> earth_radius = (6371008.7714* boost::units::si::meters);
// doesn't work because of boost::units::si::kilo
static constexpr boost::units::quantity<boost::units::si::length> earth_radius_2 = (6371.0087714 * boost::units::si::kilo * boost::units::si::meters);
}
Note: I'm an embedded firmware guy trying to learn modern c++ so if you could use short simple sentences with small words in your answer, my pea sized brain would appreciate it.