Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49769 - sandbox/itl/boost/itl
From: afojgo_at_[hidden]
Date: 2008-11-15 06:09:03


Author: jofaber
Date: 2008-11-15 06:09:02 EST (Sat, 15 Nov 2008)
New Revision: 49769
URL: http://svn.boost.org/trac/boost/changeset/49769

Log:
Refactored: Introduced a template template parameter Compare to itl::interval and passed
the Compare parameter from all interval containers to their interval types.
Replaced constructor function templates for open/closed intervals by static member functions.
2. Committing conflicted files after revert. Stable {msvc-9.0}
Text files modified:
   sandbox/itl/boost/itl/separate_interval_set.hpp | 44 ++++++++++------------------------------
   1 files changed, 11 insertions(+), 33 deletions(-)

Modified: sandbox/itl/boost/itl/separate_interval_set.hpp
==============================================================================
--- sandbox/itl/boost/itl/separate_interval_set.hpp (original)
+++ sandbox/itl/boost/itl/separate_interval_set.hpp 2008-11-15 06:09:02 EST (Sat, 15 Nov 2008)
@@ -67,8 +67,8 @@
 template
 <
     typename DomainT,
- template<class>class Interval = itl::interval,
- class Compare = std::less<DomainT>,
+ template<class, template<class>class>class Interval = itl::interval,
+ template<class>class Compare = std::less,
     template<class>class Alloc = std::allocator
>
 class separate_interval_set:
@@ -91,10 +91,10 @@
     typedef DomainT codomain_type;
 
     /// The interval type of the set
- typedef Interval<DomainT> interval_type;
+ typedef Interval<DomainT,Compare> interval_type;
 
     /// Comparison functor for domain values
- typedef Compare domain_compare;
+ typedef Compare<DomainT> domain_compare;
     /// Comparison functor for intervals
     typedef exclusive_less<interval_type> interval_compare;
 
@@ -114,7 +114,7 @@
     typedef typename itl::set<DomainT,Compare,Alloc> atomized_type;
 
     /// Container type for the implementation
- typedef typename itl::set<interval_type,exclusive_less<interval_type>,Alloc> ImplSetT;
+ typedef typename itl::set<interval_type,exclusive_less,Alloc> ImplSetT;
 
     /// key type of the implementing container
     typedef typename ImplSetT::key_type key_type;
@@ -180,7 +180,7 @@
 } ;
 
 
-template <typename DomainT, template<class>class Interval, class Compare, template<class>class Alloc>
+template <typename DomainT, template<class, template<class>class>class Interval, template<class>class Compare, template<class>class Alloc>
 bool separate_interval_set<DomainT,Interval,Compare,Alloc>::contains_(const interval_type& interv)const
 {
     if(interv.empty())
@@ -192,7 +192,7 @@
 }
 
 
-template<class DomainT, template<class>class Interval, class Compare, template<class>class Alloc>
+template<class DomainT, template<class, template<class>class>class Interval, template<class>class Compare, template<class>class Alloc>
 void separate_interval_set<DomainT,Interval,Compare,Alloc>::add_(const value_type& x)
 {
     if(x.empty()) return;
@@ -207,8 +207,8 @@
         typename ImplSetT::iterator end_it = this->_set.upper_bound(x);
 
         typename ImplSetT::iterator it=fst_it, nxt_it=fst_it, victim;
- Interval<DomainT> leftResid; (*it).left_surplus(leftResid,x);
- Interval<DomainT> rightResid;
+ interval_type leftResid; (*it).left_surplus(leftResid,x);
+ interval_type rightResid;
 
         while(it!=end_it)
         {
@@ -217,7 +217,7 @@
             victim = it; it++; this->_set.erase(victim);
         }
 
- Interval<DomainT> extended = x;
+ interval_type extended = x;
         extended.extend(leftResid).extend(rightResid);
         extended.extend(rightResid);
         add_(extended);
@@ -225,7 +225,7 @@
 }
 
 
-template<class DomainT, template<class>class Interval, class Compare, template<class>class Alloc>
+template<class DomainT, template<class, template<class>class>class Interval, template<class>class Compare, template<class>class Alloc>
 void separate_interval_set<DomainT,Interval,Compare,Alloc>::subtract_(const value_type& x)
 {
     if(x.empty()) return;
@@ -251,28 +251,6 @@
 //-----------------------------------------------------------------------------
 // equality of elements
 //-----------------------------------------------------------------------------
-/*CL
-template
-<
- class DomainT, template<class>class Interval,
- class Compare, template<class>class Alloc
->
-inline bool
-is_element_equal
-(
- const separate_interval_set<DomainT,Interval,Compare,Alloc>& lhs,
- const separate_interval_set<DomainT,Interval,Compare,Alloc>& rhs
-)
-{
- typedef itl::interval_set<DomainT,Interval,Compare,Alloc> joined_type;
- if(&lhs == &rhs)
- return true;
- //OTHERWISE
- joined_type joined_lhs(lhs);
- joined_type joined_rhs(rhs);
- return Set::lexicographical_equal(joined_lhs, joined_rhs);
-}
-*/
 
 template <class Type>
 struct is_set<itl::separate_interval_set<Type> >


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