Boost logo

Boost :

Subject: Re: [boost] Review Request: Boost.Itl; The Interval Template Library
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2009-09-30 11:02:42


Joachim Faulhaber wrote:
> 2009/9/25 Jeff Flinn <TriumphSprint2000_at_[hidden]>:
>> Joachim Faulhaber wrote:

...

> I thought you'd update the code from the boost sandbox ...
> wouldn't that be easier?

Yes it certainly is. I've been able to get what I currently need of the
itl to compile/link and pass tests under CodeWarrior 9.4 on windows and
Mac. The attached patch file clears up the ambiguous template definition
errors I was getting. The culprit was the use of 'using
base_type::insert' in boost/itl/map.hpp. CodeWarrior sees both
std::map::insert(const value_type&) and itl::map::insert(const
value_type&) because of the using declaration unhiding all overloads of
std::map::insert. I'm not sure what the standard says about this. So I
removed the 'using base_type::insert' and provide an explicit forwarding
function to insert(iterator, value_type). This is probably the case for
other classes that privately derive from std::containers.

There also were two add_front function bodies that didn't use the co_val
argument, so I commented out those args to quiet warnings.

Jeff

Index: boost/itl/split_interval_map.hpp
===================================================================
--- boost/itl/split_interval_map.hpp (revision 56475)
+++ boost/itl/split_interval_map.hpp (working copy)
@@ -229,7 +229,7 @@
 
 template <typename DomainT, typename CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
 inline void split_interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
- ::add_front(const interval_type& inter_val, const CodomainT& co_val, iterator& first_)
+ ::add_front(const interval_type& inter_val, const CodomainT& /*co_val*/, iterator& first_)
 {
     // If the collision sequence has a left residual 'left_resid' it will
     // be split, to provide a standardized start of algorithms:
Index: boost/itl/map.hpp
===================================================================
--- boost/itl/map.hpp (revision 56475)
+++ boost/itl/map.hpp (working copy)
@@ -170,7 +170,7 @@
     using base_type::key_comp;
     using base_type::value_comp;
 
- using base_type::insert;
+ //using base_type::insert;
     using base_type::erase;
     using base_type::find;
     using base_type::count;
@@ -272,6 +272,11 @@
         else
             return base_type::insert(value_pair);
     }
+
+ iterator insert(iterator position, const value_type& value_pair)
+ {
+ return base_type::insert(position, value_pair);
+ }
 
     /** With <tt>key_value_pair = (k,v)</tt> set value \c v for key \c k */
     map& set(const element_type& key_value_pair)
Index: boost/itl/interval_map.hpp
===================================================================
--- boost/itl/interval_map.hpp (revision 56475)
+++ boost/itl/interval_map.hpp (working copy)
@@ -330,7 +330,7 @@
 
 template <typename DomainT, typename CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, template<class,ITL_COMPARE>class Interval, ITL_ALLOC Alloc>
 inline void interval_map<DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
- ::add_front(const interval_type& inter_val, const CodomainT& co_val, iterator& first_)
+ ::add_front(const interval_type& inter_val, const CodomainT& /*co_val*/, iterator& first_)
 {
     // If the collision sequence has a left residual 'left_resid' it will
     // be split, to provide a standardized start of algorithms:


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk