Hi,

I am trying to use Boost.Units to convert between different units.

I have implemented the example code for the "Radar Beam Height" [1] section but trying to convert between nautical mile and imperial foot result in a compiler error:

I have:
typedef boost::units::quantity<boost::units::si::length> Meters;
typedef boost::units::quantity<imperial::length> Feet;
typedef boost::units::quantity<nautical::length> NMiles;
double func()
{
    // Working
    const Meters si1(300.0*nautical::miles);
    const Meters si2(300.0*imperial::feet);
    const Feet feet1(300.0*imperial::feet);
    const Feet feet2(300.0*boost::units::si::meters);
    const NMiles mile1(300.0*nautical::miles);
    const NMiles mile2(300.0*boost::units::si::meters);

    // BROKEN
    const Feet feet3(300.0*nautical::miles);
    const NMiles mile3(300.0*imperial::feet);
}

The first few works, converting between meters and the new units, but converting between the two does not work. 

To see the issue see the code on Compiler Explorer here:

How can I get this working?


Regards,