Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6095: boost::icl::is_empty fails for certain open intervals
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-06 16:53:22
#6095: boost::icl::is_empty fails for certain open intervals
----------------------------------------------------------------+-----------
Reporter: Marvin Sielenkemper <m.sielenkemper@â¦> | Owner: jofaber
Type: Bugs | Status: new
Milestone: To Be Determined | Component: ICL
Version: Boost 1.47.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------------------------------------+-----------
Comment (by jofaber):
Hi Marvin,
thank you for your report and the attached patch. I agree that the
behavior of {{{icl::intervals}}} at open borders and for limited domain
types is kind of nasty. Nevertheless after examining your information I am
not convinced that we can speak of a bug here and that a code change is
needed.
In your test case you propose that
{{{
BOOST_CHECK( is_empty(Interval::open(max, max)));
}}}
is supposed to succeed. But an open interval {{{Interval::open(max, x)}}}
has an open lower bound of {{{max}}}, which means that values of its
domain_type do not exist that can be elements of the interval. My
interpretation of intervals of this kind is that they are ill formed
rather than empty. So the user has to take care via program logic that
these types of intervals are not constructed in the same way she has to
take care that {{{++i}}} is not called if {{{i ==
numeric_limits<int>::max()}}} already.
Best regards,
Joachim
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6095#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:07 UTC