On 9/14/2013 5:31 PM, Quoth Robert Ramey:
#include
#include #include int main(int argc, char * argv[]){ using namespace boost::units; using namespace boost::units::si; using namespace boost::units::us; quantity l1; l1 = 1.0 * meters; quantity l2; l2 = static_cast >(1.0 * miles); quantity l3 = l1 + l2; return 0; } [...] 1>z:\projects\geflightquest\simulator2\solvecpp\flight.cpp(18) : error C2678: binary '*' : no operator found which takes a left-hand operand of type 'double' (or there is no acceptable conversion) 1> z:\boost_1_54_0\boost\units\detail\one.hpp(47): could be 'T boost::units::operator *boost::units::us::mile_base_unit(const boost::units::one &,const T &)'
Incidentally, the reason why you're getting this error is that you're specifying the value type as "float" but then passing it double values. Replace your "1.0" with "1.0f" etc (or omit the "float" type parameter, which will make it use double by default) and then you'll probably have more luck.