AMDG On 09/13/2013 01:54 PM, Robert Ramey wrote:
<snip> What I expect to see is:
#include
#include #include void main(){ using namespace boost::units; using namespace boost::units::si; using namespace boost::units::us; quantity l1; l1 = 1000.0 * meters; quantity l2; l2 = 1.0 * miles; // compile error quantity l3 = l1 + l2; } and I expect this to pretty much work. The documentation says " Implicit conversions between unit systems are allowed only when the reduced units are identical, allowing, for example, trivial conversions between equivalent units in different systems (such as SI seconds and CGS seconds)" so I expected that it can convert miles into kilometers.
Try static_cast.
This is a disappointment - but I'll assume that the authors have a good reason for this.
<snip>
In Christ, Steven Watanabe