id summary reporter owner description type status milestone component version severity resolution keywords cc 6872 units/io.hpp: autoprefix_norm_impl<> should resolve to no-op for unsigned built-in types Vassilii Khachaturov Steven Watanabe "The code using namespace boost::units; const quantity boa = 5 * si::meters; std::cout << boa << std::endl; prints ""5 m"", as expected, yet using namespace boost::units; const quantity boa = 5 * si::meters; std::cout << boa << std::endl; fails to compile due to the std::abs call being ambiguous in io.hpp: template struct autoprefix_norm_impl { typedef double type; static double call(const T& arg) { return std::abs(arg); } }; There should be a specialization resolving to a no-op (just return the arg) for unsigned types. A (probably slightly heavier) user-side workaround possible one can use is to forcibly define the missing std::abs to be a no-op as follows: namespace std { template typename boost::enable_if, Unsigned>::type abs(const Unsigned& x) { return x; // unsigned type... } } Alternatively, boost::units should do a static assert that the type underlying the quantity is signed if that is what is intended (but why restrict it thus?) Found and tested the workaround on 1.47.0, but confirmed to still exist on the trunk. " Bugs new To Be Determined units Boost Development Trunk Problem