id summary reporter owner description type status milestone component version severity resolution keywords cc 9582 Boost.Units: conversion to double with prefixed unit richel@… Matthias Schabel "A post to the Boost-users maillinglist suggested me to request this feature. In the code below, I convert a double that is known to be in millimeters to a unit and back again. The latter fails, where it works as expected for meters. I think that adding this feature increases the symmetry in the use of Boost.Units, as I have emphasised in my code. I am aware of the great care the Boost.Units developers have in maintaining type-safety, so it might be that I am unaware of code compiling that shouldn't would this request be acknowledged. {{{ using boost::units::conversion_factor; using boost::units::quantity; using boost::units::si::length; using boost::units::si::meter; using boost::units::si::milli; typedef quantity Length; //This value is read from file const double x_in_mm = 1.0; //Add units const Length x(x_in_mm * (milli * meter)); //Brackets added for emphasis const double x_again_in_m = x / meter; //Works const double x_again_in_mm { x / (milli * meter) //Same brackets as at emphasis }; //Why doesn't this? assert(x_in_mm == x_again_in_mm); }}} " Feature Requests new To Be Determined units Boost 1.54.0 Cosmetic Units conversion prefix