|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56380 - in sandbox/itl: boost/itl boost/itl/type_traits libs/itl/test/test_casual_
From: afojgo_at_[hidden]
Date: 2009-09-25 06:49:04
Author: jofaber
Date: 2009-09-25 06:49:03 EDT (Fri, 25 Sep 2009)
New Revision: 56380
URL: http://svn.boost.org/trac/boost/changeset/56380
Log:
Portability: Modifications due to problems with CodeWarrior 9.4. reported by Jeff Flinn.
Replaced type instantiations from typedefs of is_inerval_set/map_derivative.
Renamed member function templates add<Combine>, subtract<Combine> by _add and _subtract.
Text files modified:
sandbox/itl/boost/itl/interval_base_map.hpp | 22 ++++++++++++++--------
sandbox/itl/boost/itl/map.hpp | 38 +++++++++++++++++++++++---------------
sandbox/itl/boost/itl/type_traits/is_combinable.hpp | 10 +++++-----
sandbox/itl/boost/itl/type_traits/unon.hpp | 4 ++--
sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp | 1 +
5 files changed, 45 insertions(+), 30 deletions(-)
Modified: sandbox/itl/boost/itl/interval_base_map.hpp
==============================================================================
--- sandbox/itl/boost/itl/interval_base_map.hpp (original)
+++ sandbox/itl/boost/itl/interval_base_map.hpp 2009-09-25 06:49:03 EDT (Fri, 25 Sep 2009)
@@ -340,8 +340,11 @@
This function is not public, because the `codomain_combine` shall be
an invariant for all itl maps.*/
template<class Combiner>
- SubType& add(const segment_type& interval_value_pair)
- { that()->template add_<Combiner>(interval_value_pair); return *that(); }
+ SubType& _add(const segment_type& interval_value_pair)
+ {
+ that()->template add_<Combiner>(interval_value_pair);
+ return *that();
+ }
public:
/** Addition of a key value pair to the map */
@@ -367,8 +370,11 @@
This function is not public, because the `codomain_combine` shall be
an invariant for all itl maps.*/
template<class Combiner>
- void subtract(const segment_type& interval_value_pair)
- { that()->template subtract_<Combiner>(interval_value_pair); }
+ SubType& _subtract(const segment_type& interval_value_pair)
+ {
+ that()->template subtract_<Combiner>(interval_value_pair);
+ return *that();
+ }
public:
/** Subtraction of a key value pair from the map */
@@ -955,7 +961,7 @@
if(!common_interval.empty())
{
section.that()->add(value_type(common_interval, it_->second));
- section.that()->template add<codomain_intersect>(value_type(common_interval, sectant.second));
+ section.that()->template _add<codomain_intersect>(value_type(common_interval, sectant.second));
}
}
else
@@ -965,7 +971,7 @@
if(!common_interval.empty())
{
section.that()->add(value_type(common_interval, it_->second) );
- section.that()->template add<codomain_combine>(value_type(common_interval, sectant.second));
+ section.that()->template _add<codomain_combine>(value_type(common_interval, sectant.second));
}
}
@@ -1440,7 +1446,7 @@
typedef interval_base_map<SubType,DomainT,CodomainT,
Traits,Compare,Combine,Section,Interval,Alloc> map_type;
ITL_const_FORALL(typename map_type, elem_, operand)
- object.template add<inplace_min >(*elem_);
+ object.template _add<inplace_min >(*elem_);
return object;
}
@@ -1465,7 +1471,7 @@
typedef interval_base_map<SubType,DomainT,CodomainT,
Traits,Compare,Combine,Section,Interval,Alloc> map_type;
ITL_const_FORALL(typename map_type, elem_, operand)
- object.template add<inplace_max>(*elem_);
+ object.template _add<inplace_max>(*elem_);
return object;
}
Modified: sandbox/itl/boost/itl/map.hpp
==============================================================================
--- sandbox/itl/boost/itl/map.hpp (original)
+++ sandbox/itl/boost/itl/map.hpp 2009-09-25 06:49:03 EDT (Fri, 25 Sep 2009)
@@ -237,21 +237,26 @@
not exist in the map.
If \c value_pairs's key value exists in the map, it's data
value is added to the data value already found in the map. */
- map& add(const value_type& value_pair) { return add<codomain_combine>(value_pair); }
+ map& add(const value_type& value_pair)
+ {
+ return _add<codomain_combine>(value_pair);
+ }
/** \c add add \c value_pair into the map using \c prior as a hint to
insert \c value_pair after the position \c prior is pointing to. */
iterator add(iterator prior, const value_type& value_pair)
- { return add<codomain_combine>(prior, value_pair); }
+ {
+ return _add<codomain_combine>(prior, value_pair);
+ }
/** If the \c value_pair's key value is in the map, it's data value is
subtraced from the data value stored in the map. */
map& subtract(const value_type& value_pair)
{
if(Traits::is_total && has_inverse<codomain_type>::value)
- this->template add<inverse_codomain_combine>(value_pair);
+ this->template _add<inverse_codomain_combine>(value_pair);
else
- this->template subtract<inverse_codomain_combine>(value_pair);
+ this->template _subtract<inverse_codomain_combine>(value_pair);
return *this;
}
@@ -270,7 +275,10 @@
/** With <tt>key_value_pair = (k,v)</tt> set value \c v for key \c k */
map& set(const element_type& key_value_pair)
- { (*this)[key_value_pair.first] = key_value_pair.second; return *this; }
+ {
+ (*this)[key_value_pair.first] = key_value_pair.second;
+ return *this;
+ }
/** erase \c key_value_pair from the map.
Erase only if, the exact value content \c val is stored for the given key. */
@@ -381,13 +389,13 @@
private:
template<class Combiner>
- map& add(const value_type& value_pair);
+ map& _add(const value_type& value_pair);
template<class Combiner>
- iterator add(iterator prior, const value_type& value_pair);
+ iterator _add(iterator prior, const value_type& value_pair);
template<class Combiner>
- map& subtract(const value_type& value_pair);
+ map& _subtract(const value_type& value_pair);
};
@@ -398,7 +406,7 @@
template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
template <class Combiner>
map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>&
- map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>::add(const value_type& val)
+ map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>::_add(const value_type& val)
{
if(Traits::absorbs_neutrons && val.second == Combiner::neutron())
return *this;
@@ -432,7 +440,7 @@
template <class Combiner>
typename map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>::iterator
map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>
- ::add(iterator prior_, const value_type& val)
+ ::_add(iterator prior_, const value_type& val)
{
if(Traits::absorbs_neutrons && val.second == Combiner::neutron())
return prior_;
@@ -455,7 +463,7 @@
template <class DomainT, class CodomainT, class Traits, ITL_COMPARE Compare, ITL_COMBINE Combine, ITL_SECTION Section, ITL_ALLOC Alloc>
template <class Combiner>
map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>&
- map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>::subtract(const value_type& val)
+ map<DomainT,CodomainT,Traits,Compare,Combine,Section,Alloc>::_subtract(const value_type& val)
{
iterator it_ = find(val.first);
if(it_ != end())
@@ -512,9 +520,9 @@
{
section.add(*it_);
if(is_set<codomain_type>::value)
- section.template add<codomain_intersect>(sectant);
+ section.template _add<codomain_intersect>(sectant);
else
- section.template add<codomain_combine>(sectant);
+ section.template _add<codomain_combine>(sectant);
}
}
}
@@ -562,9 +570,9 @@
{
section.add(*it_);
if(is_set<CodomainT>::value)
- section.template add<codomain_intersect>(*sec_);
+ section.template _add<codomain_intersect>(*sec_);
else
- section.template add<codomain_combine>(*sec_);
+ section.template _add<codomain_combine>(*sec_);
}
++sec_;
}
Modified: sandbox/itl/boost/itl/type_traits/is_combinable.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/is_combinable.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/is_combinable.hpp 2009-09-25 06:49:03 EDT (Fri, 25 Sep 2009)
@@ -140,14 +140,14 @@
template<class Type>
struct is_interval_set_derivative<Type, typename Type::domain_type>
{
- typedef is_interval_set_derivative<Type, typename Type::domain_type> type;
+ typedef is_interval_set_derivative type;
BOOST_STATIC_CONSTANT(bool, value = (is_interval_container<Type>::value));
};
template<class Type>
struct is_interval_set_derivative<Type, typename Type::interval_type>
{
- typedef is_interval_set_derivative<Type, typename Type::interval_type> type;
+ typedef is_interval_set_derivative type;
BOOST_STATIC_CONSTANT(bool, value = (is_interval_container<Type>::value));
};
@@ -167,21 +167,21 @@
template<class Type>
struct is_interval_map_derivative<Type, typename Type::domain_mapping_type>
{
- typedef is_interval_map_derivative<Type, typename Type::domain_mapping_type> type;
+ typedef is_interval_map_derivative type;
BOOST_STATIC_CONSTANT(bool, value = (is_interval_container<Type>::value));
};
template<class Type>
struct is_interval_map_derivative<Type, typename Type::interval_mapping_type>
{
- typedef is_interval_map_derivative<Type, typename Type::interval_mapping_type> type;
+ typedef is_interval_map_derivative type;
BOOST_STATIC_CONSTANT(bool, value = (is_interval_container<Type>::value));
};
template<class Type>
struct is_interval_map_derivative<Type, typename Type::value_type>
{
- typedef is_interval_map_derivative<Type, typename Type::value_type> type;
+ typedef is_interval_map_derivative type;
BOOST_STATIC_CONSTANT(bool, value = (is_interval_container<Type>::value));
};
Modified: sandbox/itl/boost/itl/type_traits/unon.hpp
==============================================================================
--- sandbox/itl/boost/itl/type_traits/unon.hpp (original)
+++ sandbox/itl/boost/itl/type_traits/unon.hpp 2009-09-25 06:49:03 EDT (Fri, 25 Sep 2009)
@@ -23,10 +23,10 @@
// Smallest 'visible' string that is greater than the empty string.
template <>
- inline std::string unon<std::string>::value(){ return std::string(" "); };
+ inline std::string unon<std::string>::value(){ return std::string(" "); }
template <class Type>
- inline Type unon<Type>::value(){ return succ(neutron<Type>::value()); };
+ inline Type unon<Type>::value(){ return succ(neutron<Type>::value()); }
}} // namespace boost itl
Modified: sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp
==============================================================================
--- sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp (original)
+++ sandbox/itl/libs/itl/test/test_casual_/test_casual.cpp 2009-09-25 06:49:03 EDT (Fri, 25 Sep 2009)
@@ -92,3 +92,4 @@
inclusion_compare(eleset_a, eleset_c);
BOOST_CHECK_EQUAL(inclusion_compare(eleset_a, eleset_c), inclusion::unrelated);
}
+
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