[Boost-bugs] [Boost C++ Libraries] #11803: Fails with closed intervals fails in some border cases.

Subject: [Boost-bugs] [Boost C++ Libraries] #11803: Fails with closed intervals fails in some border cases.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-11-18 17:02:19


#11803: Fails with closed intervals fails in some border cases.
------------------------------+-------------------------
 Reporter: shewitt.au@… | Owner: jofaber
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: ICL
  Version: Boost 1.59.0 | Severity: Showstopper
 Keywords: |
------------------------------+-------------------------
 ICL seems not to handle sets that contain the maximum element of the
 domain type. I have attached a file that shows the problem.

 The problem is in the fie \boost\icl\concept\interval.hpp (line 1145) in
 the left_subtract.

 It should look like this:

 {{{
 template<class Type>
 typename boost::enable_if<is_static_closed<Type>, Type>::type
 left_subtract(Type right, const Type& left_minuend)
 {
     if(exclusive_less(left_minuend, right))
         return right;
     else if(upper_less_equal(right, left_minuend))
         return identity_element<Type>::value();

     return construct<Type>(domain_next<Type>(upper(left_minuend)),
 upper(right));
 }
 }}}

 Where as it actually looks like this:

 {{{
 template<class Type>
 typename boost::enable_if<is_static_closed<Type>, Type>::type
 left_subtract(Type right, const Type& left_minuend)
 {
     if(exclusive_less(left_minuend, right))
         return right;

     return construct<Type>(domain_next<Type>(upper(left_minuend)),
 upper(right));
 }
 }}}

 The right subtract function is ok.

 The comment for the left_subtract functions is also wrong.
 "Return the difference: The part of \c right '''right''' of \c
 left_minuend."

 The word "right" in BOLD should read "left".

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11803>
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:19 UTC