|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72179 - in trunk/boost/icl: . concept type_traits
From: afojgo_at_[hidden]
Date: 2011-05-26 07:55:03
Author: jofaber
Date: 2011-05-26 07:55:01 EDT (Thu, 26 May 2011)
New Revision: 72179
URL: http://svn.boost.org/trac/boost/changeset/72179
Log:
Bug fix for ticket 5559: Assertion for numeric_minimum failed for std::greater ordering. Adjustments for portability.
Text files modified:
trunk/boost/icl/concept/interval.hpp | 16 ++++++++--------
trunk/boost/icl/concept/interval_bounds.hpp | 6 ------
trunk/boost/icl/left_open_interval.hpp | 3 ++-
trunk/boost/icl/open_interval.hpp | 3 ++-
trunk/boost/icl/type_traits/is_numeric.hpp | 2 --
5 files changed, 12 insertions(+), 18 deletions(-)
Modified: trunk/boost/icl/concept/interval.hpp
==============================================================================
--- trunk/boost/icl/concept/interval.hpp (original)
+++ trunk/boost/icl/concept/interval.hpp 2011-05-26 07:55:01 EDT (Thu, 26 May 2011)
@@ -110,7 +110,7 @@
typedef typename interval_traits<Type>::domain_type domain_type;
typedef typename interval_traits<Type>::domain_compare domain_compare;
BOOST_ASSERT((numeric_minimum<domain_type, domain_compare, is_numeric<domain_type>::value>
- ::is_less_than(value) ));
+ ::is_less_than(value) ));
return interval_traits<Type>::construct(domain_prior<Type>(value), value);
}
@@ -123,7 +123,7 @@
typedef typename interval_traits<Type>::domain_type domain_type;
typedef typename interval_traits<Type>::domain_compare domain_compare;
BOOST_ASSERT((numeric_minimum<domain_type, domain_compare, is_numeric<domain_type>::value>
- ::is_less_than(value)));
+ ::is_less_than(value)));
return interval_traits<Type>::construct( domain_prior<Type>(value)
, domain_next<Type>(value));
@@ -179,7 +179,7 @@
typedef typename interval_traits<Type>::domain_type domain_type;
typedef typename interval_traits<Type>::domain_compare domain_compare;
BOOST_ASSERT((numeric_minimum<domain_type, domain_compare, is_numeric<domain_type>::value>
- ::is_less_than(value) ));
+ ::is_less_than(value) ));
return interval_traits<Type>::construct(domain_prior<Type>(value), value);
}
@@ -196,7 +196,7 @@
typedef typename interval_traits<Type>::domain_type domain_type;
typedef typename interval_traits<Type>::domain_compare domain_compare;
BOOST_ASSERT((numeric_minimum<domain_type, domain_compare, is_numeric<domain_type>::value>
- ::is_less_than(value)));
+ ::is_less_than(value)));
return interval_traits<Type>::construct( domain_prior<Type>(value)
, domain_next<Type>(value));
@@ -292,13 +292,13 @@
if(interval_traits<Type>::domain_compare()(left,right))
{
BOOST_ASSERT((numeric_minimum<domain_type, domain_compare, is_numeric<domain_type>::value>
- ::is_less_than(left) ));
+ ::is_less_than(left) ));
return construct<Type>(domain_prior<Type>(left), right);
}
else
{
BOOST_ASSERT((numeric_minimum<domain_type, domain_compare, is_numeric<domain_type>::value>
- ::is_less_than(right) ));
+ ::is_less_than(right) ));
return construct<Type>(domain_prior<Type>(right), left);
}
}
@@ -324,14 +324,14 @@
if(interval_traits<Type>::domain_compare()(left,right))
{
BOOST_ASSERT((numeric_minimum<domain_type, domain_compare, is_numeric<domain_type>::value>
- ::is_less_than(left) ));
+ ::is_less_than(left) ));
return construct<Type>( domain_prior<Type>(left)
, domain_next<Type>(right));
}
else
{
BOOST_ASSERT((numeric_minimum<domain_type, domain_compare, is_numeric<domain_type>::value>
- ::is_less_than(right) ));
+ ::is_less_than(right) ));
return construct<Type>( domain_prior<Type>(right)
, domain_next<Type>(left));
}
Modified: trunk/boost/icl/concept/interval_bounds.hpp
==============================================================================
--- trunk/boost/icl/concept/interval_bounds.hpp (original)
+++ trunk/boost/icl/concept/interval_bounds.hpp 2011-05-26 07:55:01 EDT (Thu, 26 May 2011)
@@ -85,10 +85,7 @@
shift_lower(interval_bounds decl, interval_bounds repr, const Type& low)
{
if(is_left_closed(decl) && !is_left_closed(repr))
- {
- BOOST_ASSERT((numeric_minimum<Type, is_numeric<Type>::value >::is_less_than(low) ));
return icl::pred(low);
- }
else if(!is_left_closed(decl) && is_left_closed(repr))
return icl::succ(low);
else
@@ -100,10 +97,7 @@
shift_upper(interval_bounds decl, interval_bounds repr, const Type& up)
{
if(!is_right_closed(decl) && is_right_closed(repr))
- {
- BOOST_ASSERT((numeric_minimum<Type, is_numeric<Type>::value >::is_less_than(up) ));
return icl::pred(up);
- }
else if(is_right_closed(decl) && !is_right_closed(repr))
return icl::succ(up);
else
Modified: trunk/boost/icl/left_open_interval.hpp
==============================================================================
--- trunk/boost/icl/left_open_interval.hpp (original)
+++ trunk/boost/icl/left_open_interval.hpp 2011-05-26 07:55:01 EDT (Thu, 26 May 2011)
@@ -49,7 +49,8 @@
// Only for discrete types this ctor creates an interval containing
// a single element only.
BOOST_STATIC_ASSERT((icl::is_discrete<DomainT>::value));
- BOOST_ASSERT((numeric_minimum<DomainT, is_numeric<DomainT>::value >::is_less_than(val) ));
+ BOOST_ASSERT((numeric_minimum<DomainT, domain_compare, is_numeric<DomainT>::value >
+ ::is_less_than(val) ));
}
/** Interval from <tt>low</tt> to <tt>up</tt> with bounds <tt>bounds</tt> */
Modified: trunk/boost/icl/open_interval.hpp
==============================================================================
--- trunk/boost/icl/open_interval.hpp (original)
+++ trunk/boost/icl/open_interval.hpp 2011-05-26 07:55:01 EDT (Thu, 26 May 2011)
@@ -48,7 +48,8 @@
// Only for discrete types this ctor creates an interval containing
// a single element only.
BOOST_STATIC_ASSERT((icl::is_discrete<DomainT>::value));
- BOOST_ASSERT((numeric_minimum<DomainT, is_numeric<DomainT>::value >::is_less_than(val) ));
+ BOOST_ASSERT((numeric_minimum<DomainT, domain_compare, is_numeric<DomainT>::value >
+ ::is_less_than(val) ));
}
/** Interval from <tt>low</tt> to <tt>up</tt> with bounds <tt>bounds</tt> */
Modified: trunk/boost/icl/type_traits/is_numeric.hpp
==============================================================================
--- trunk/boost/icl/type_traits/is_numeric.hpp (original)
+++ trunk/boost/icl/type_traits/is_numeric.hpp 2011-05-26 07:55:01 EDT (Thu, 26 May 2011)
@@ -54,8 +54,6 @@
};
//--------------------------------------------------------------------------
-//CL template<class Type, class Compare, bool Enable = false> struct numeric_minimum;
-
template<class Type, class Compare, bool Enable = false>
struct numeric_minimum
{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk