|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55879 - in sandbox/itl: boost/itl boost/itl/detail libs/itl/test
From: afojgo_at_[hidden]
Date: 2009-08-30 13:23:07
Author: jofaber
Date: 2009-08-30 13:23:06 EDT (Sun, 30 Aug 2009)
New Revision: 55879
URL: http://svn.boost.org/trac/boost/changeset/55879
Log:
Portability: Adjustments for gcc. Stable {msvc-9.0, gcc-3.4.4}
Text files modified:
sandbox/itl/boost/itl/detail/interval_subset_comparer.hpp | 34 +++++++++++++++++++++++++---------
sandbox/itl/boost/itl/detail/subset_comparer.hpp | 39 ++++++++++++++++++++++++++++-----------
sandbox/itl/boost/itl/map.hpp | 2 +-
sandbox/itl/boost/itl/map_algo.hpp | 6 ++----
sandbox/itl/libs/itl/test/test_interval_map_shared.hpp | 2 +-
5 files changed, 57 insertions(+), 26 deletions(-)
Modified: sandbox/itl/boost/itl/detail/interval_subset_comparer.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/interval_subset_comparer.hpp (original)
+++ sandbox/itl/boost/itl/detail/interval_subset_comparer.hpp 2009-08-30 13:23:06 EDT (Sun, 30 Aug 2009)
@@ -12,6 +12,9 @@
#include <boost/itl/detail/notate.hpp>
#include <boost/itl/detail/relation_state.hpp>
#include <boost/itl/type_traits/neutron.hpp>
+#include <boost/itl/type_traits/is_concept_equivalent.hpp>
+#include <boost/itl/type_traits/is_interval_container.hpp>
+#include <boost/itl/type_traits/is_set.hpp>
#include <boost/itl/interval.hpp>
namespace boost{namespace itl
@@ -52,6 +55,26 @@
}
};
+template<class LeftT, class RightT>
+struct map_codomain_compare
+{
+ static int apply(typename LeftT::const_iterator& left_, typename RightT::const_iterator& right_)
+ {
+ using namespace boost::mpl;
+ typedef typename LeftT::codomain_type LeftCodomainT;
+ typedef typename RightT::codomain_type RightCodomainT;
+
+ return
+ if_<
+ bool_<is_concept_equivalent<is_set,LeftCodomainT,
+ RightCodomainT>::value>,
+ settic_codomain_compare<LeftT,RightT>,
+ atomic_codomain_compare<LeftT,RightT>
+ >
+ ::type::apply(left_, right_);
+ }
+};
+
//------------------------------------------------------------------------------
template<class LeftT, class RightT>
@@ -91,19 +114,12 @@
int co_compare(LeftIterT& left, RightIterT& right)
{
using namespace boost::mpl;
- typedef typename LeftT::codomain_type LeftCodomainT;
- typedef typename RightT::codomain_type RightCodomainT;
return
if_<
bool_<is_concept_equivalent<is_interval_map,LeftT,RightT>::value>,
- if_<
- bool_<is_concept_equivalent<is_set,LeftCodomainT,
- RightCodomainT>::value>,
- settic_codomain_compare<LeftT,RightT>, // codomain is a set
- atomic_codomain_compare<LeftT,RightT> // codomain is not a set
- >::type,
- empty_codomain_compare<LeftT,RightT> // no codomain component exits
+ map_codomain_compare<LeftT,RightT>,
+ empty_codomain_compare<LeftT,RightT>
>
::type::apply(left,right);
}
Modified: sandbox/itl/boost/itl/detail/subset_comparer.hpp
==============================================================================
--- sandbox/itl/boost/itl/detail/subset_comparer.hpp (original)
+++ sandbox/itl/boost/itl/detail/subset_comparer.hpp 2009-08-30 13:23:06 EDT (Sun, 30 Aug 2009)
@@ -12,6 +12,8 @@
#include <boost/itl/detail/notate.hpp>
#include <boost/itl/detail/relation_state.hpp>
#include <boost/itl/type_traits/neutron.hpp>
+#include <boost/itl/type_traits/is_concept_equivalent.hpp>
+#include <boost/itl/type_traits/is_element_container.hpp>
#include <boost/itl/interval.hpp>
namespace boost{namespace itl
@@ -52,6 +54,26 @@
}
};
+template<class LeftT, class RightT>
+struct map_codomain_compare
+{
+ static int apply(typename LeftT::const_iterator& left_, typename RightT::const_iterator& right_)
+ {
+ using namespace boost::mpl;
+ typedef typename LeftT::codomain_type LeftCodomainT;
+ typedef typename RightT::codomain_type RightCodomainT;
+
+ return
+ if_<
+ bool_<is_concept_equivalent<is_set,LeftCodomainT,
+ RightCodomainT>::value>,
+ settic_codomain_compare<LeftT,RightT>,
+ atomic_codomain_compare<LeftT,RightT>
+ >
+ ::type::apply(left_, right_);
+ }
+};
+
//------------------------------------------------------------------------------
template<class LeftT, class RightT>
@@ -97,13 +119,8 @@
return
if_<
bool_<is_concept_equivalent<is_element_map,LeftT,RightT>::value>,
- if_<
- bool_<is_concept_equivalent<is_set,LeftCodomainT,
- RightCodomainT>::value>,
- settic_codomain_compare<LeftT,RightT>, // codomain is a set
- atomic_codomain_compare<LeftT,RightT> // codomain is not a set
- >::type,
- empty_codomain_compare<LeftT,RightT> // no codomain component exits
+ map_codomain_compare<LeftT,RightT>,
+ empty_codomain_compare<LeftT,RightT>
>
::type::apply(left,right);
}
@@ -124,7 +141,7 @@
restrict_result(superset);
return stop;
}
- else if(LeftT::domain_compare()(LeftT::key_value(left), RightT::key_value(right)))
+ else if(typename LeftT::domain_compare()(LeftT::key_value(left), RightT::key_value(right)))
{ // left: *left . . *joint_ left could be superset
// right: *right ... if joint_ exists
restrict_result(superset);
@@ -134,7 +151,7 @@
{
LeftIterT joint_ = _left.lower_bound(RightT::key_value(right));
if( joint_ == _left.end()
- || LeftT::domain_compare()(RightT::key_value(right), LeftT::key_value(joint_)))
+ || typename LeftT::domain_compare()(RightT::key_value(right), LeftT::key_value(joint_)))
{
_result = unrelated;
return stop;
@@ -143,7 +160,7 @@
left = joint_;
}
}
- else if(LeftT::domain_compare()(RightT::key_value(right), LeftT::key_value(left)))
+ else if(typename LeftT::domain_compare()(RightT::key_value(right), LeftT::key_value(left)))
{ // left: *left left could be subset
// right:*right . . .*joint_ if *joint_ exists
restrict_result(subset);
@@ -153,7 +170,7 @@
{
RightIterT joint_ = _right.lower_bound(LeftT::key_value(left));
if( joint_ == _right.end()
- || LeftT::domain_compare()(LeftT::key_value(left), RightT::key_value(joint_)))
+ || typename LeftT::domain_compare()(LeftT::key_value(left), RightT::key_value(joint_)))
{
_result = unrelated;
return stop;
Modified: sandbox/itl/boost/itl/map.hpp
==============================================================================
--- sandbox/itl/boost/itl/map.hpp (original)
+++ sandbox/itl/boost/itl/map.hpp 2009-08-30 13:23:06 EDT (Sun, 30 Aug 2009)
@@ -356,7 +356,7 @@
/** Copy the key values of the map to \c domain_set. Complexity: Linear. */
void domain(set_type& domain_set)const
{
- set_type::iterator prior_ = domain_set.end();
+ typename set_type::iterator prior_ = domain_set.end();
const_FORALL_THIS(it_)
prior_ = domain_set.insert(prior_, it_->KEY_VALUE);
}
Modified: sandbox/itl/boost/itl/map_algo.hpp
==============================================================================
--- sandbox/itl/boost/itl/map_algo.hpp (original)
+++ sandbox/itl/boost/itl/map_algo.hpp 2009-08-30 13:23:06 EDT (Sun, 30 Aug 2009)
@@ -184,7 +184,7 @@
return left_ == left.end() && right_ == right.end();
}
-
+/*CL
//------------------------------------------------------------------------------
template<class LeftT, class RightT>
class subset_comparer
@@ -426,9 +426,7 @@
-
-
-
+*/
} // namespace Map
}} // namespace boost itl
Modified: sandbox/itl/libs/itl/test/test_interval_map_shared.hpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_interval_map_shared.hpp (original)
+++ sandbox/itl/libs/itl/test/test_interval_map_shared.hpp 2009-08-30 13:23:06 EDT (Sun, 30 Aug 2009)
@@ -422,7 +422,7 @@
void interval_map_contains_4_bicremental_types()
{
typedef IntervalMap<T,U> IntervalMapT;
- IntervalMapT itv_map(K_v(3,1));
+ IntervalMapT itv_map; itv_map.add(K_v(3,1));
BOOST_CHECK_EQUAL( itv_map.contains(K_v(3,1)), true );
BOOST_CHECK_EQUAL( IntervalMapT().add(K_v(3,1)).contains(K_v(3,1)), true );
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