Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71035 - in sandbox/icl/boost/icl: . type_traits
From: afojgo_at_[hidden]
Date: 2011-04-06 12:28:47


Author: jofaber
Date: 2011-04-06 12:28:46 EDT (Wed, 06 Apr 2011)
New Revision: 71035
URL: http://svn.boost.org/trac/boost/changeset/71035

Log:
Due to Chris Jefferson's problem report on function equal_range in libxx I changed its implementation using lower_bound and upper_bound directly.
Properties modified:
   sandbox/icl/boost/icl/ (props changed)
Text files modified:
   sandbox/icl/boost/icl/interval_base_map.hpp | 26 ++++++++++++++++----------
   sandbox/icl/boost/icl/interval_base_set.hpp | 15 +++++++++++----
   sandbox/icl/boost/icl/map.hpp | 2 ++
   sandbox/icl/boost/icl/split_interval_set.hpp | 2 +-
   sandbox/icl/boost/icl/type_traits/difference_type_of.hpp | 1 +
   sandbox/icl/boost/icl/type_traits/is_key_container_of.hpp | 1 +
   sandbox/icl/boost/icl/type_traits/size_type_of.hpp | 1 +
   7 files changed, 33 insertions(+), 15 deletions(-)

Modified: sandbox/icl/boost/icl/interval_base_map.hpp
==============================================================================
--- sandbox/icl/boost/icl/interval_base_map.hpp (original)
+++ sandbox/icl/boost/icl/interval_base_map.hpp 2011-04-06 12:28:46 EDT (Wed, 06 Apr 2011)
@@ -426,10 +426,17 @@
     { return _map.upper_bound(interval); }
 
     std::pair<iterator,iterator> equal_range(const key_type& interval)
- { return _map.equal_range(interval); }
+ {
+ return std::pair<iterator,iterator>
+ (lower_bound(interval), upper_bound(interval));
+ }
 
- std::pair<const_iterator,const_iterator> equal_range(const key_type& interval)const
- { return _map.equal_range(interval); }
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& interval)const
+ {
+ return std::pair<const_iterator,const_iterator>
+ (lower_bound(interval), upper_bound(interval));
+ }
 
     iterator begin() { return _map.begin(); }
     iterator end() { return _map.end(); }
@@ -492,8 +499,7 @@
         if(icl::is_empty(inter_val))
             return;
 
- std::pair<const_iterator, const_iterator> exterior
- = this->_map.equal_range(inter_val);
+ std::pair<const_iterator, const_iterator> exterior = equal_range(inter_val);
         if(exterior.first == exterior.second)
             return;
 
@@ -963,7 +969,7 @@
     else
     {
         // Detect the first and the end iterator of the collision sequence
- std::pair<iterator,iterator> overlap = this->_map.equal_range(inter_val);
+ std::pair<iterator,iterator> overlap = equal_range(inter_val);
         iterator it_ = overlap.first,
                  last_ = prior(overlap.second);
         interval_type rest_interval = inter_val;
@@ -1045,7 +1051,7 @@
     if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(co_val))
         return;
 
- std::pair<iterator, iterator> exterior = this->_map.equal_range(inter_val);
+ std::pair<iterator, iterator> exterior = equal_range(inter_val);
     if(exterior.first == exterior.second)
         return;
 
@@ -1149,7 +1155,7 @@
         return that()->handle_inserted(insertion.first);
     {
         // Detect the first and the end iterator of the collision sequence
- std::pair<iterator,iterator> overlap = this->_map.equal_range(inter_val);
+ std::pair<iterator,iterator> overlap = equal_range(inter_val);
         iterator it_ = overlap.first,
                  last_ = prior(overlap.second);
         insert_main(inter_val, co_val, it_, last_);
@@ -1194,7 +1200,7 @@
     if(on_codomain_absorbtion::is_absorbable(co_val))
         return *that();
 
- std::pair<iterator,iterator> exterior = this->_map.equal_range(inter_val);
+ std::pair<iterator,iterator> exterior = equal_range(inter_val);
     if(exterior.first == exterior.second)
         return *that();
 
@@ -1251,7 +1257,7 @@
     if(icl::is_empty(minuend))
         return *that();
 
- std::pair<iterator, iterator> exterior = this->_map.equal_range(minuend);
+ std::pair<iterator, iterator> exterior = equal_range(minuend);
     if(exterior.first == exterior.second)
         return *that();
 

Modified: sandbox/icl/boost/icl/interval_base_set.hpp
==============================================================================
--- sandbox/icl/boost/icl/interval_base_set.hpp (original)
+++ sandbox/icl/boost/icl/interval_base_set.hpp 2011-04-06 12:28:46 EDT (Wed, 06 Apr 2011)
@@ -345,10 +345,17 @@
     { return _set.upper_bound(interval); }
 
     std::pair<iterator,iterator> equal_range(const key_type& interval)
- { return _set.equal_range(interval); }
+ {
+ return std::pair<iterator,iterator>
+ (_set.lower_bound(interval), _set.upper_bound(interval));
+ }
 
- std::pair<const_iterator,const_iterator> equal_range(const key_type& interval)const
- { return _set.equal_range(interval); }
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& interval)const
+ {
+ return std::pair<const_iterator,const_iterator>
+ (_set.lower_bound(interval), _set.upper_bound(interval));
+ }
 
 private:
     iterator _add(const segment_type& addend);
@@ -501,7 +508,7 @@
     if(icl::is_empty(minuend))
         return *that();
 
- std::pair<iterator, iterator> exterior = this->_set.equal_range(minuend);
+ std::pair<iterator, iterator> exterior = equal_range(minuend);
     if(exterior.first == exterior.second)
         return *that();
 

Modified: sandbox/icl/boost/icl/map.hpp
==============================================================================
--- sandbox/icl/boost/icl/map.hpp (original)
+++ sandbox/icl/boost/icl/map.hpp 2011-04-06 12:28:46 EDT (Wed, 06 Apr 2011)
@@ -13,6 +13,8 @@
 #if defined(ICL_USE_BOOST_INTERPROCESS_IMPLEMENTATION)
 #include <boost/interprocess/containers/map.hpp>
 #include <boost/interprocess/containers/set.hpp>
+#include <boost/interprocess/containers/flat_set.hpp> //FLAS
+#include <boost/interprocess/containers/flat_map.hpp> //FLAS
 #elif defined(ICL_USE_BOOST_MOVE_IMPLEMENTATION)
 #include <boost/container/map.hpp>
 #include <boost/container/set.hpp>

Modified: sandbox/icl/boost/icl/split_interval_set.hpp
==============================================================================
--- sandbox/icl/boost/icl/split_interval_set.hpp (original)
+++ sandbox/icl/boost/icl/split_interval_set.hpp 2011-04-06 12:28:46 EDT (Wed, 06 Apr 2011)
@@ -146,7 +146,7 @@
 
     iterator add_over(const interval_type& addend)
     {
- std::pair<iterator,iterator> overlap = this->_set.equal_range(addend);
+ std::pair<iterator,iterator> overlap = equal_range(addend);
         iterator first_ = overlap.first,
                  end_ = overlap.second,
                  last_ = end_; --last_;

Modified: sandbox/icl/boost/icl/type_traits/difference_type_of.hpp
==============================================================================
--- sandbox/icl/boost/icl/type_traits/difference_type_of.hpp (original)
+++ sandbox/icl/boost/icl/type_traits/difference_type_of.hpp 2011-04-06 12:28:46 EDT (Wed, 06 Apr 2011)
@@ -10,6 +10,7 @@
 
 #include <boost/config.hpp> // For macro BOOST_STATIC_CONSTANT
 #include <boost/type_traits/is_pointer.hpp>
+#include <boost/mpl/has_xxx.hpp>
 #include <boost/mpl/or.hpp>
 #include <boost/mpl/and.hpp>
 #include <boost/mpl/not.hpp>

Modified: sandbox/icl/boost/icl/type_traits/is_key_container_of.hpp
==============================================================================
--- sandbox/icl/boost/icl/type_traits/is_key_container_of.hpp (original)
+++ sandbox/icl/boost/icl/type_traits/is_key_container_of.hpp 2011-04-06 12:28:46 EDT (Wed, 06 Apr 2011)
@@ -8,6 +8,7 @@
 #ifndef BOOST_ICL_TYPE_TRAITS_IS_KEY_CONTAINER_OF_HPP_JOFA_100829
 #define BOOST_ICL_TYPE_TRAITS_IS_KEY_CONTAINER_OF_HPP_JOFA_100829
 
+#include <boost/mpl/has_xxx.hpp>
 #include <boost/icl/type_traits/is_combinable.hpp>
 #include <boost/icl/type_traits/is_container.hpp>
 

Modified: sandbox/icl/boost/icl/type_traits/size_type_of.hpp
==============================================================================
--- sandbox/icl/boost/icl/type_traits/size_type_of.hpp (original)
+++ sandbox/icl/boost/icl/type_traits/size_type_of.hpp 2011-04-06 12:28:46 EDT (Wed, 06 Apr 2011)
@@ -8,6 +8,7 @@
 #ifndef BOOST_ICL_TYPE_TRAITS_SIZE_TYPE_OF_HPP_JOFA_080911
 #define BOOST_ICL_TYPE_TRAITS_SIZE_TYPE_OF_HPP_JOFA_080911
 
+#include <boost/mpl/has_xxx.hpp>
 #include <boost/icl/type_traits/difference_type_of.hpp>
 
 namespace boost{ namespace icl


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