Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4988: [units] improve error messages when quantities are not convertible into one another.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-02-19 11:36:02
#4988: [units] improve error messages when quantities are not convertible into one
another.
--------------------------------------------------------+-------------------
Reporter: Alfredo Correa <alfredo.correa@â¦> | Owner: matthiasschabel
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: units
Version: Boost 1.46.0 | Severity: Problem
Resolution: | Keywords: conversion, error message
--------------------------------------------------------+-------------------
Comment (by Benaka Moorthi <benaka.moorthi@â¦>):
I've uploaded an archive w/ two patches that will provide better compiler
error messages. GCC will now output error messages similar to those
outputted by MSVC, and on every compiler, if derived dimension headers
aren't included or the constructed dimension isn't named anywhere, the
error message will no longer contain 'dim<X_base_dimension,
static_rational<N, D> >' types, but instead 'X<N, D>' types. This should
make it easier to see what's going on. I've included a README in the
archive detailing my changes.
As an example, here is the new output when compiling & running the
fail_implicit_conversion test using GCC:
...patience...
...found 719 targets...
...updating 3 targets...
gcc.compile.c++
../../../bin.v2/libs/units/test/fail_implicit_conversion.test/gcc-4.4.3/release/fail_implicit_conversion.o
fail_implicit_conversion.cpp: In function âint main(int, char**)â:
fail_implicit_conversion.cpp:32: error: conversion from âconst
boost::units::quantity<boost::units::unit<boost::units::length_dimension,
boost::units::si::system, void>, double>â to non-scalar type âconst
boost::units::quantity<boost::units::unit<boost::units::length_dimension,
boost::units::cgs::system, void>, double>â requested
(failed-as-expected)
../../../bin.v2/libs/units/test/fail_implicit_conversion.test/gcc-4.4.3/release/fail_implicit_conversion.o
**passed**
../../../bin.v2/libs/units/test/fail_implicit_conversion.test/gcc-4.4.3/release/fail_implicit_conversion.test
...updated 3 targets...
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4988#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC