Subject: [Boost-bugs] [Boost C++ Libraries] #1489: BOOST_CHECK_CLOSE fails to compile with templated value type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-11-30 21:12:47
#1489: BOOST_CHECK_CLOSE fails to compile with templated value type
-------------------------------------------------+--------------------------
Reporter: Hugo Duncan <hugo_duncan_at_[hidden]> | Owner: rogeeff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------------------+--------------------------
I was wanting to check two boost::numeric::interval's for closeness, but
find I get a compile error. The below fails to compile, with the error
messages shown.
I believe this is because
i) the comparison operator for interval is templated,
ii) boost.test wraps one of the values with a readonly_property
and therefore the template is not an exact match. Changing the tolerance
to an interval does not change anything. This is with MSVC8 and with gcc
3.4.4 on windows.
Is this a bug, a missing feature - or am I misusing BOOST_CHECK_CLOSE ?
c:\cygwin\home\duncan\boost\boost/test/floating_point_comparison.hpp(184)
: error C2679: binary '<=' : no operator found which takes a right-hand
operand of type 'const boost::unit_test::readonly_property<PropertyType>'
(or there is no acceptable conversion)
with
[
PropertyType=boost::numeric::interval<double>
]
c:\cygwin\home\duncan\boost\boost/numeric/interval/interval.hpp(82):
could be 'bool boost::numeric::interval<T>::operator <=(const
boost::numeric::interval<T>::interval_holder &) const'
with
[
T=double
]
c:\cygwin\home\duncan\boost\boost/numeric/interval/interval.hpp(89):
or 'bool boost::numeric::interval<T>::operator <=(const
boost::numeric::interval<T>::number_holder &) const'
with
[
T=double
]
while trying to match the argument list
'(boost::numeric::interval<T>, const
boost::unit_test::readonly_property<PropertyType>)'
with
[
T=double
]
and
[
PropertyType=boost::numeric::interval<double>
]
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1489>
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:49:57 UTC