Length x = 3.0 ft did not compile, see below... terry #include <boost/units/systems/si.hpp> #include <boost/units/base_units/us/foot.hpp> #include <boost/units/quantity.hpp> #include <boost/units/io.hpp> #include <iostream> #include <iomanip> using namespace std; using namespace boost; using namespace boost::units; int main() { typedef quantity<si::length> Length; static const si::length m = si::meter; Length x = 2.0 * m; // This works! cout << x << endl; typedef us::foot_base_unit::unit_type foot_unit; static const foot_unit ft; Length y = 3.0 * ft; // This does not compile :o( cout << y << endl; return 0; } // main // Compiler output... tjg.cpp using native typeof tjg.cpp(21) : error C2440: 'initializing' : cannot convert from 'units::quantity<Unit, Y>' to 'units::quantity<Unit>' with [ Unit=units::unit< units::list< units::dim<units::length_base_dimension, units::static_rational<1>>, units::dimensionless_type >, units::heterogeneous_system< units::heterogeneous_system_impl< units::list< units::heterogeneous_system_dim< units::scaled_base_unit< units::us::yard_base_unit, units::scale<3, units::static_rational<-1>> >, units::static_rational<1> >, units::dimensionless_type >, units::list< units::dim<units::length_base_dimension, units::static_rational<1>>, units::dimensionless_type >, units::dimensionless_type > >
, Y=double ] and [ Unit=units::si::length ] Constructor for class 'units::quantity<Unit>' is declared 'explicit' with [ Unit=units::si::length ]