Boost logo

Boost Users :

Subject: [Boost-users] [Units] conversion between double and millimeter
From: Richel Bilderbeek (richel_at_[hidden])
Date: 2014-01-14 04:46:47


Hello Boost.Units users,

When I convert a double to a unit (e.g. meter) and back, this works as expected.
When I convert a double to a prefixed unit (e.g. millimeter) and back, this fails to compile.
The code below shows how I'd expect it to work.
What do I overlook?
Thanks, Richel Bilderbeek

const double x_in_mm = 1.0;
const Length x(x_in_mm * milli * meter);
//This works as expected:
const double x_again_in_m = x / meter;
//Why doesn't this:
const double x_again_in_mm = x / (milli * meter); //Fails



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net