|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r70787 - in branches/release: boost/icl boost/icl/concept boost/icl/detail boost/icl/type_traits libs/icl libs/icl/doc libs/icl/doc/html libs/icl/doc/html/header/boost/icl libs/icl/test libs/icl/test/chrono libs/icl/test/fastest_icl_map_ libs/icl/test/fastest_partial_icl_quantifier_ libs/icl/test/fastest_partial_interval_quantifier_ libs/icl/test/fastest_set_icl_set_ libs/icl/test/fastest_set_interval_set_ libs/icl/test/fastest_total_icl_quantifier_ libs/icl/test/fastest_total_interval_quantifier_ libs/icl/test/test_casual_ libs/icl/test/test_changing_interval_defaults_ libs/icl/test/test_doc_code_ libs/icl/test/test_icl_map_ libs/icl/test/test_misc_ libs/icl/test/test_partial_icl_quantifier_ libs/icl/test/test_partial_interval_quantifier_ libs/icl/test/test_set_icl_set_ libs/icl/test/test_set_interval_set_ libs/icl/test/test_total_icl_quantifier_ libs/icl/test/test_total_interval_quantifier_ libs/icl/test/test_type_traits_
From: afojgo_at_[hidden]
Date: 2011-03-31 12:34:06
Author: jofaber
Date: 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
New Revision: 70787
URL: http://svn.boost.org/trac/boost/changeset/70787
Log:
Merged 69961-7083: (1) Fixed standard conformance issues, detected by Doug Gregor March-05. (2) Adapted implementation so boost::chrono types are usable in icl intervals and containers without customization. (3) Added tests for icl/chrono interoperability.
Added:
branches/release/boost/icl/type_traits/rep_type_of.hpp
- copied unchanged from r70783, /trunk/boost/icl/type_traits/rep_type_of.hpp
branches/release/libs/icl/test/chrono/
- copied from r70757, /trunk/libs/icl/test/chrono/
branches/release/libs/icl/test/chrono/utility.hpp
- copied unchanged from r70757, /trunk/libs/icl/test/chrono/utility.hpp
Properties modified:
branches/release/boost/icl/ (props changed)
branches/release/libs/icl/ (props changed)
branches/release/libs/icl/doc/ (props changed)
branches/release/libs/icl/doc/html/ (props changed)
branches/release/libs/icl/doc/html/header/boost/icl/ (props changed)
branches/release/libs/icl/test/ (props changed)
branches/release/libs/icl/test/test_doc_code_/ (props changed)
Text files modified:
branches/release/boost/icl/concept/element_associator.hpp | 6 +
branches/release/boost/icl/concept/element_map.hpp | 13 -
branches/release/boost/icl/concept/element_set.hpp | 7 -
branches/release/boost/icl/concept/interval.hpp | 4
branches/release/boost/icl/concept/interval_associator.hpp | 4
branches/release/boost/icl/concept/interval_associator_base.hpp | 10
branches/release/boost/icl/concept/interval_map.hpp | 18 +-
branches/release/boost/icl/concept/joinable.hpp | 4
branches/release/boost/icl/concept/map_value.hpp | 4
branches/release/boost/icl/detail/interval_map_algo.hpp | 2
branches/release/boost/icl/detail/map_algo.hpp | 2
branches/release/boost/icl/interval_base_map.hpp | 98 ++++++++--------
branches/release/boost/icl/interval_map.hpp | 10
branches/release/boost/icl/map.hpp | 18 +-
branches/release/boost/icl/split_interval_map.hpp | 10
branches/release/boost/icl/type_traits/difference_type_of.hpp | 53 ++++++++-
branches/release/boost/icl/type_traits/infinity.hpp | 186 +++++++++++++++++++++++++++-----
branches/release/boost/icl/type_traits/is_container.hpp | 2
branches/release/boost/icl/type_traits/is_discrete.hpp | 25 +++
branches/release/boost/icl/type_traits/is_key_container_of.hpp | 1
branches/release/boost/icl/type_traits/is_numeric.hpp | 30 +++++
branches/release/boost/icl/type_traits/size_type_of.hpp | 56 +++++++++
branches/release/libs/icl/test/Jamfile.v2 | 77 +++++++++++++
branches/release/libs/icl/test/fast_stat_interval_map_cases.hpp | 20 +-
branches/release/libs/icl/test/fastest_icl_map_/fastest_icl_map.cpp | 2
branches/release/libs/icl/test/fastest_partial_icl_quantifier_/fastest_partial_icl_quantifier.cpp | 2
branches/release/libs/icl/test/fastest_partial_interval_quantifier_/fastest_partial_interval_quantifier.cpp | 2
branches/release/libs/icl/test/fastest_set_icl_set_/fastest_set_icl_set.cpp | 2
branches/release/libs/icl/test/fastest_set_interval_set_/fastest_set_interval_set.cpp | 2
branches/release/libs/icl/test/fastest_total_icl_quantifier_/fastest_total_icl_quantifier.cpp | 2
branches/release/libs/icl/test/fastest_total_interval_quantifier_/fastest_total_interval_quantifier.cpp | 2
branches/release/libs/icl/test/test_casual_/test_casual.cpp | 184 +++++++++++++++++++++++++++++---
branches/release/libs/icl/test/test_changing_interval_defaults_/test_changing_interval_defaults.cpp | 2
branches/release/libs/icl/test/test_doc_code_/test_doc_code.cpp | 2
branches/release/libs/icl/test/test_icl_map.hpp | 4
branches/release/libs/icl/test/test_icl_map_/test_icl_map.cpp | 2
branches/release/libs/icl/test/test_interval_map_shared.hpp | 5
branches/release/libs/icl/test/test_misc_/test_misc.cpp | 2
branches/release/libs/icl/test/test_partial_icl_quantifier_/test_partial_icl_quantifier.cpp | 2
branches/release/libs/icl/test/test_partial_interval_quantifier_/test_partial_interval_quantifier.cpp | 2
branches/release/libs/icl/test/test_set_icl_set_/test_set_icl_set.cpp | 2
branches/release/libs/icl/test/test_set_interval_set_/test_set_interval_set.cpp | 2
branches/release/libs/icl/test/test_total_icl_quantifier_/test_total_icl_quantifier.cpp | 2
branches/release/libs/icl/test/test_total_interval_quantifier_/test_total_interval_quantifier.cpp | 2
branches/release/libs/icl/test/test_type_lists.hpp | 228 ++++++++++++++++++++++++++++-----------
branches/release/libs/icl/test/test_type_traits_/test_type_traits.cpp | 2
46 files changed, 845 insertions(+), 272 deletions(-)
Modified: branches/release/boost/icl/concept/element_associator.hpp
==============================================================================
--- branches/release/boost/icl/concept/element_associator.hpp (original)
+++ branches/release/boost/icl/concept/element_associator.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -422,6 +422,12 @@
return object;
}
+template<class Type>
+inline typename enable_if<is_associative_element_container<Type>, Type>::type
+operator & (Type object, const Type& operand)
+{
+ return object &= operand;
+}
//------------------------------------------------------------------------------
template<class Type, class CoType>
Modified: branches/release/boost/icl/concept/element_map.hpp
==============================================================================
--- branches/release/boost/icl/concept/element_map.hpp (original)
+++ branches/release/boost/icl/concept/element_map.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -42,7 +42,7 @@
{
typedef typename Type::const_iterator const_iterator;
const_iterator found_ = super.find(value_pair.first);
- return found_ != super.end() && found_->second == value_pair.second;
+ return found_ != super.end() && (*found_).second == value_pair.second;
}
//------------------------------------------------------------------------------
@@ -109,7 +109,7 @@
return identity_element<size_type>::value();
iterator it_ = object.find(value_pair.first);
- if(it_ != object.end() && value_pair.second == it_->second)
+ if(it_ != object.end() && value_pair.second == (*it_).second)
{
object.erase(it_);
return unit_element<size_type>::value();
@@ -284,13 +284,6 @@
template<class Type>
inline typename enable_if<is_element_map<Type>, Type>::type
-operator & (Type object, const Type& operand)
-{
- return object &= operand;
-}
-
-template<class Type>
-inline typename enable_if<is_element_map<Type>, Type>::type
operator & (Type object, const typename Type::key_object_type& operand)
{
return object &= operand;
@@ -401,7 +394,7 @@
icl::flip(object, *it_);
ICL_FORALL(typename Type, it2_, object)
- it2_->second = identity_element<typename Type::codomain_type>::value();
+ (*it2_).second = identity_element<typename Type::codomain_type>::value();
return object;
}
Modified: branches/release/boost/icl/concept/element_set.hpp
==============================================================================
--- branches/release/boost/icl/concept/element_set.hpp (original)
+++ branches/release/boost/icl/concept/element_set.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -60,13 +60,6 @@
//= Intersection
//==============================================================================
template<class Type>
-inline typename enable_if<is_element_set<Type>, Type>::type
-operator & (Type object, const Type& operand)
-{
- return object &= operand;
-}
-
-template<class Type>
inline typename enable_if<is_element_set<Type>, bool>::type
intersects(const Type& object, const typename Type::key_type& operand)
{
Modified: branches/release/boost/icl/concept/interval.hpp
==============================================================================
--- branches/release/boost/icl/concept/interval.hpp (original)
+++ branches/release/boost/icl/concept/interval.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -923,7 +923,7 @@
&& domain_equal<Type>(lower(object), upper(object)))
return icl::unit_element<SizeT>::value();
else
- return infinity<SizeT>::value();
+ return icl::infinity<SizeT>::value();
}
template<class Type>
@@ -945,7 +945,7 @@
if(icl::is_empty(object))
return icl::identity_element<SizeT>::value();
else
- return infinity<SizeT>::value();
+ return icl::infinity<SizeT>::value();
}
template<class Type>
Modified: branches/release/boost/icl/concept/interval_associator.hpp
==============================================================================
--- branches/release/boost/icl/concept/interval_associator.hpp (original)
+++ branches/release/boost/icl/concept/interval_associator.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -146,7 +146,7 @@
ICL_const_FORALL(typename Type, it, object)
{
interval_size = icl::cardinality(key_value<Type>(it));
- if(interval_size == infinity<size_type>::value())
+ if(interval_size == icl::infinity<size_type>::value())
return interval_size;
else
size += interval_size;
@@ -662,7 +662,7 @@
bool>::type
intersects(const Type& left, const CoType& right)
{
- return left.find(right) != left.end();
+ return icl::find(left, right) != left.end();
}
Modified: branches/release/boost/icl/concept/interval_associator_base.hpp
==============================================================================
--- branches/release/boost/icl/concept/interval_associator_base.hpp (original)
+++ branches/release/boost/icl/concept/interval_associator_base.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -21,7 +21,7 @@
//==============================================================================
//= Selection<IntervalSet|IntervalMap>
//==============================================================================
-template<class Type>
+template<class Type> inline
typename enable_if<mpl::and_< is_interval_container<Type>
, is_discrete<typename domain_type_of<Type>::type>
>
@@ -33,7 +33,7 @@
return object.find(icl::detail::unit_trail<interval_type>(key_val));
}
-template<class Type>
+template<class Type> inline
typename enable_if<mpl::and_< is_interval_container<Type>
, is_continuous<typename domain_type_of<Type>::type>
, has_dynamic_bounds<typename interval_type_of<Type>::type>
@@ -46,7 +46,7 @@
return object.find(icl::singleton<interval_type>(key_val));
}
-template<class Type>
+template<class Type> inline
typename enable_if<mpl::and_< is_interval_container<Type>
, is_continuous<typename domain_type_of<Type>::type>
, is_static_right_open<typename interval_type_of<Type>::type>
@@ -66,7 +66,7 @@
: object.end();
}
-template<class Type>
+template<class Type> inline
typename enable_if<mpl::and_< is_interval_container<Type>
, is_continuous<typename domain_type_of<Type>::type>
, is_static_left_open<typename interval_type_of<Type>::type>
@@ -91,7 +91,7 @@
// NOTE: find(object, key) won't compile if key is of continuous type that does
// not implement in(de)crementation (e.g. std::string).
-template<class Type>
+template<class Type> inline
typename enable_if< is_interval_container<Type>
, typename Type::const_iterator>::type
find(const Type& object, const typename interval_type_of<Type>::type& inter_val)
Modified: branches/release/boost/icl/concept/interval_map.hpp
==============================================================================
--- branches/release/boost/icl/concept/interval_map.hpp (original)
+++ branches/release/boost/icl/concept/interval_map.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -44,7 +44,7 @@
{
typedef typename Type::const_iterator const_iterator;
const_iterator it_ = icl::find(super, key_value_pair.key);
- return it_ != super.end() && it_->second == key_value_pair.data;
+ return it_ != super.end() && (*it_).second == key_value_pair.data;
}
template<class Type>
@@ -102,7 +102,7 @@
, bool>::type
contains(const Type& super, const typename Type::domain_type& key)
{
- return super.find(key) != super.end();
+ return icl::find(super, key) != super.end();
}
template<class Type>
@@ -372,9 +372,9 @@
typedef typename Type::segment_type segment_type;
typedef typename Type::const_iterator const_iterator;
- const_iterator it_ = object.find(key_value);
+ const_iterator it_ = icl::find(object, key_value);
if(it_ != object.end())
- add(section, segment_type(interval_type(key_value),it_->second));
+ add(section, segment_type(interval_type(key_value),(*it_).second));
}
template<class Type>
@@ -398,10 +398,10 @@
iterator prior_ = section.end();
for(const_iterator it_=exterior.first; it_ != exterior.second; it_++)
{
- interval_type common_interval = it_->first & inter_val;
+ interval_type common_interval = (*it_).first & inter_val;
if(!icl::is_empty(common_interval))
prior_ = add(section, prior_,
- value_type(common_interval, it_->second) );
+ value_type(common_interval, (*it_).second) );
}
}
@@ -514,7 +514,7 @@
object += operand;
ICL_FORALL(typename Type, it_, object)
- it_->second = identity_element<codomain_type>::value();
+ (*it_).second = identity_element<codomain_type>::value();
if(mpl::not_<is_interval_splitter<Type> >::value)
icl::join(object);
@@ -572,7 +572,7 @@
result.clear();
set_iterator prior_ = result.end();
ICL_const_FORALL(typename Type, it_, object)
- prior_ = icl::insert(result, prior_, it_->first);
+ prior_ = icl::insert(result, prior_, (*it_).first);
return result;
}
@@ -664,7 +664,7 @@
{
stream << "{";
ICL_const_FORALL(typename Type, it_, object)
- stream << "(" << it_->first << "->" << it_->second << ")";
+ stream << "(" << (*it_).first << "->" << (*it_).second << ")";
return stream << "}";
}
Modified: branches/release/boost/icl/concept/joinable.hpp
==============================================================================
--- branches/release/boost/icl/concept/joinable.hpp (original)
+++ branches/release/boost/icl/concept/joinable.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -27,8 +27,8 @@
typename enable_if<is_interval_map<Type>, bool>::type
is_joinable(typename Type::iterator it_, typename Type::iterator next_, Type* = 0)
{
- return touches(it_->first, next_->first)
- && it_->second == next_->second ;
+ return touches((*it_).first, (*next_).first)
+ && (*it_).second == (*next_).second ;
}
}
Modified: branches/release/boost/icl/concept/map_value.hpp
==============================================================================
--- branches/release/boost/icl/concept/map_value.hpp (original)
+++ branches/release/boost/icl/concept/map_value.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -22,14 +22,14 @@
inline typename enable_if<is_map<Type>, const typename Type::key_type>::type&
key_value(Iterator it_)
{
- return it_->first;
+ return (*it_).first;
}
template<class Type, class Iterator>
inline typename enable_if<is_map<Type>, const typename Type::codomain_type>::type&
co_value(Iterator it_)
{
- return it_->second;
+ return (*it_).second;
}
template<class Type>
Modified: branches/release/boost/icl/detail/interval_map_algo.hpp
==============================================================================
--- branches/release/boost/icl/detail/interval_map_algo.hpp (original)
+++ branches/release/boost/icl/detail/interval_map_algo.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -130,7 +130,7 @@
const typename IntervalMapT::element_type& key_value_pair)
{
typename IntervalMapT::const_iterator it_ = container.find(key_value_pair.key);
- return it_ != container.end() && it_->second == key_value_pair.data;
+ return it_ != container.end() && (*it_).second == key_value_pair.data;
}
template<class IntervalMapT>
Modified: branches/release/boost/icl/detail/map_algo.hpp
==============================================================================
--- branches/release/boost/icl/detail/map_algo.hpp (original)
+++ branches/release/boost/icl/detail/map_algo.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -45,7 +45,7 @@
typename MapT::const_iterator next_proton(typename MapT::const_iterator& iter_, const MapT& object)
{
while( iter_ != object.end()
- && iter_->second == identity_element<typename MapT::codomain_type>::value())
+ && (*iter_).second == identity_element<typename MapT::codomain_type>::value())
++iter_;
return iter_;
Modified: branches/release/boost/icl/interval_base_map.hpp
==============================================================================
--- branches/release/boost/icl/interval_base_map.hpp (original)
+++ branches/release/boost/icl/interval_base_map.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -270,7 +270,7 @@
{
const_iterator it_ = icl::find(*this, key_value);
return it_==end() ? identity_element<codomain_type>::value()
- : it_->second;
+ : (*it_).second;
}
//==========================================================================
@@ -499,10 +499,10 @@
for(const_iterator it_=exterior.first; it_ != exterior.second; it_++)
{
- interval_type common_interval = it_->first & inter_val;
+ interval_type common_interval = (*it_).first & inter_val;
if(!icl::is_empty(common_interval))
{
- section.template _add<codomain_combine> (value_type(common_interval, it_->second) );
+ section.template _add<codomain_combine> (value_type(common_interval, (*it_).second) );
section.template _add<codomain_intersect>(value_type(common_interval, operand.second));
}
}
@@ -537,9 +537,9 @@
iterator inserted_
= this->_map.insert(prior_, value_type(inter_val, Combiner::identity_element()));
- if(inserted_->first == inter_val && inserted_->second == Combiner::identity_element())
+ if((*inserted_).first == inter_val && (*inserted_).second == Combiner::identity_element())
{
- Combiner()(inserted_->second, co_val);
+ Combiner()((*inserted_).second, co_val);
return std::pair<iterator,bool>(inserted_, true);
}
else
@@ -555,7 +555,7 @@
if(inserted_ == prior_)
return std::pair<iterator,bool>(inserted_, false);
- else if(inserted_->first == inter_val)
+ else if((*inserted_).first == inter_val)
return std::pair<iterator,bool>(inserted_, true);
else
return std::pair<iterator,bool>(inserted_, false);
@@ -694,7 +694,7 @@
{
object += operand;
ICL_FORALL(typename Type, it_, object)
- it_->second = identity_element<codomain_type>::value();
+ (*it_).second = identity_element<codomain_type>::value();
if(mpl::not_<is_interval_splitter<Type> >::value)
icl::join(object);
@@ -737,7 +737,7 @@
while(it_ != end_ )
{
- const codomain_type& co_value = it_->second;
+ const codomain_type& co_value = (*it_).second;
covered = (*it_++).first;
//[a ... : span
// [b ... : covered
@@ -788,16 +788,16 @@
// The addend interval 'inter_val' covers the beginning of the collision sequence.
// only for the first there can be a left_resid: a part of *first_ left of inter_val
- interval_type left_resid = right_subtract(first_->first, inter_val);
+ interval_type left_resid = right_subtract((*first_).first, inter_val);
if(!icl::is_empty(left_resid))
{ // [------------ . . .
// [left_resid---first_ --- . . .
iterator prior_ = cyclic_prior(*this, first_);
- const_cast<interval_type&>(first_->first)
- = left_subtract(first_->first, left_resid);
+ const_cast<interval_type&>((*first_).first)
+ = left_subtract((*first_).first, left_resid);
//NOTE: Only splitting
- this->_map.insert(prior_, segment_type(left_resid, first_->second));
+ this->_map.insert(prior_, segment_type(left_resid, (*first_).second));
}
//POST:
// [----- inter_val ---- . . .
@@ -809,7 +809,7 @@
inline void interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
::add_segment(const interval_type& inter_val, const CodomainT& co_val, iterator& it_)
{
- interval_type lead_gap = right_subtract(inter_val, it_->first);
+ interval_type lead_gap = right_subtract(inter_val, (*it_).first);
if(!icl::is_empty(lead_gap))
{
// [lead_gap--- . . .
@@ -821,7 +821,7 @@
// . . . --------- . . . addend interval
// [-- it_ --) has a common part with the first overval
- Combiner()(it_->second, co_val);
+ Combiner()((*it_).second, co_val);
that()->template handle_left_combined<Combiner>(it_++);
}
@@ -835,7 +835,7 @@
interval_type cur_interval;
while(it_!=last_)
{
- cur_interval = it_->first ;
+ cur_interval = (*it_).first ;
add_segment<Combiner>(inter_val, co_val, it_);
// shrink interval
inter_val = left_subtract(inter_val, cur_interval);
@@ -848,7 +848,7 @@
::add_rear(const interval_type& inter_val, const CodomainT& co_val, iterator& it_)
{
iterator prior_ = cyclic_prior(*that(), it_);
- interval_type cur_itv = it_->first ;
+ interval_type cur_itv = (*it_).first ;
interval_type lead_gap = right_subtract(inter_val, cur_itv);
if(!icl::is_empty(lead_gap))
@@ -863,7 +863,7 @@
{
// [----------------end_gap)
// . . . -- it_ --)
- Combiner()(it_->second, co_val);
+ Combiner()((*it_).second, co_val);
that()->template gap_insert_at<Combiner>(it_, prior_, end_gap, co_val);
}
else
@@ -875,22 +875,22 @@
{
// [---------------)
// [-- it_ ---)
- Combiner()(it_->second, co_val);
+ Combiner()((*it_).second, co_val);
that()->template handle_preceeded_combined<Combiner>(prior_, it_);
}
else
{
// [--------------)
// [-- it_ --right_resid)
- const_cast<interval_type&>(it_->first) = right_subtract(it_->first, right_resid);
+ const_cast<interval_type&>((*it_).first) = right_subtract((*it_).first, right_resid);
//NOTE: This is NOT an insertion that has to take care for correct application of
// the Combiner functor. It only reestablished that state after splitting the
// 'it_' interval value pair. Using _map_insert<Combiner> does not work here.
- iterator insertion_ = this->_map.insert(it_, value_type(right_resid, it_->second));
+ iterator insertion_ = this->_map.insert(it_, value_type(right_resid, (*it_).second));
that()->handle_reinserted(insertion_);
- Combiner()(it_->second, co_val);
+ Combiner()((*it_).second, co_val);
that()->template handle_preceeded_combined<Combiner>(insertion_, it_);
}
}
@@ -983,13 +983,13 @@
inline void interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
::subtract_front(const interval_type& inter_val, iterator& it_)
{
- interval_type left_resid = right_subtract(it_->first, inter_val);
+ interval_type left_resid = right_subtract((*it_).first, inter_val);
if(!icl::is_empty(left_resid)) // [--- inter_val ---)
{ //[prior_) [left_resid)[--- it_ . . .
iterator prior_ = cyclic_prior(*this, it_);
- const_cast<interval_type&>(it_->first) = left_subtract(it_->first, left_resid);
- this->_map.insert(prior_, value_type(left_resid, it_->second));
+ const_cast<interval_type&>((*it_).first) = left_subtract((*it_).first, left_resid);
+ this->_map.insert(prior_, value_type(left_resid, (*it_).second));
// The segemnt *it_ is split at inter_val.first(), so as an invariant
// segment *it_ is always "under" inter_val and a left_resid is empty.
}
@@ -1003,7 +1003,7 @@
{
while(it_ != last_)
{
- Combiner()(it_->second, co_val);
+ Combiner()((*it_).second, co_val);
that()->template handle_left_combined<Combiner>(it_++);
}
}
@@ -1013,18 +1013,18 @@
inline void interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
::subtract_rear(interval_type& inter_val, const CodomainT& co_val, iterator& it_)
{
- interval_type right_resid = left_subtract(it_->first, inter_val);
+ interval_type right_resid = left_subtract((*it_).first, inter_val);
if(icl::is_empty(right_resid))
{
- Combiner()(it_->second, co_val);
+ Combiner()((*it_).second, co_val);
that()->template handle_combined<Combiner>(it_);
}
else
{
- const_cast<interval_type&>(it_->first) = right_subtract(it_->first, right_resid);
- iterator next_ = this->_map.insert(it_, value_type(right_resid, it_->second));
- Combiner()(it_->second, co_val);
+ const_cast<interval_type&>((*it_).first) = right_subtract((*it_).first, right_resid);
+ iterator next_ = this->_map.insert(it_, value_type(right_resid, (*it_).second));
+ Combiner()((*it_).second, co_val);
that()->template handle_succeeded_combined<Combiner>(it_, next_);
}
}
@@ -1073,7 +1073,7 @@
while(it_ != end_ )
{
- cur_itv = it_->first ;
+ cur_itv = (*it_).first ;
left_gap = right_subtract(rest_interval, cur_itv);
if(!icl::is_empty(left_gap))
@@ -1165,20 +1165,20 @@
::erase_rest(interval_type& inter_val, const CodomainT& co_val,
iterator& it_, const iterator& last_)
{
- // For all intervals within loop: it_->first are contained_in inter_val
+ // For all intervals within loop: (*it_).first are contained_in inter_val
while(it_ != last_)
- if(it_->second == co_val)
+ if((*it_).second == co_val)
this->_map.erase(it_++);
else it_++;
//erase_rear:
- if(it_->second == co_val)
+ if((*it_).second == co_val)
{
- interval_type right_resid = left_subtract(it_->first, inter_val);
+ interval_type right_resid = left_subtract((*it_).first, inter_val);
if(icl::is_empty(right_resid))
this->_map.erase(it_);
else
- const_cast<interval_type&>(it_->first) = right_resid;
+ const_cast<interval_type&>((*it_).first) = right_resid;
}
}
@@ -1206,19 +1206,19 @@
{ // [----inter_val----)
// .....first_==last_.....
// only for the last there can be a right_resid: a part of *it_ right of minuend
- interval_type right_resid = left_subtract(first_->first, inter_val);
+ interval_type right_resid = left_subtract((*first_).first, inter_val);
- if(first_->second == co_val)
+ if((*first_).second == co_val)
{
- interval_type left_resid = right_subtract(first_->first, inter_val);
+ interval_type left_resid = right_subtract((*first_).first, inter_val);
if(!icl::is_empty(left_resid)) // [----inter_val----)
{ // [left_resid)..first_==last_......
- const_cast<interval_type&>(first_->first) = left_resid;
+ const_cast<interval_type&>((*first_).first) = left_resid;
if(!icl::is_empty(right_resid))
this->_map.insert(first_, value_type(right_resid, co_val));
}
else if(!icl::is_empty(right_resid))
- const_cast<interval_type&>(first_->first) = right_resid;
+ const_cast<interval_type&>((*first_).first) = right_resid;
else
this->_map.erase(first_);
}
@@ -1226,13 +1226,13 @@
else
{
// first AND NOT last
- if(first_->second == co_val)
+ if((*first_).second == co_val)
{
- interval_type left_resid = right_subtract(first_->first, inter_val);
+ interval_type left_resid = right_subtract((*first_).first, inter_val);
if(icl::is_empty(left_resid))
this->_map.erase(first_);
else
- const_cast<interval_type&>(first_->first) = left_resid;
+ const_cast<interval_type&>((*first_).first) = left_resid;
}
erase_rest(inter_val, co_val, second_, last_);
@@ -1259,18 +1259,18 @@
end_ = exterior.second,
last_ = prior(end_);
- interval_type left_resid = right_subtract(first_->first, minuend);
+ interval_type left_resid = right_subtract((*first_).first, minuend);
interval_type right_resid = left_subtract(last_ ->first, minuend);
if(first_ == last_ )
if(!icl::is_empty(left_resid))
{
- const_cast<interval_type&>(first_->first) = left_resid;
+ const_cast<interval_type&>((*first_).first) = left_resid;
if(!icl::is_empty(right_resid))
- this->_map.insert(first_, value_type(right_resid, first_->second));
+ this->_map.insert(first_, value_type(right_resid, (*first_).second));
}
else if(!icl::is_empty(right_resid))
- const_cast<interval_type&>(first_->first) = left_subtract(first_->first, minuend);
+ const_cast<interval_type&>((*first_).first) = left_subtract((*first_).first, minuend);
else
this->_map.erase(first_);
else
@@ -1283,7 +1283,7 @@
this->_map.erase(start_, stop_); //erase [start_, stop_)
if(!icl::is_empty(left_resid))
- const_cast<interval_type&>(first_->first) = left_resid;
+ const_cast<interval_type&>((*first_).first) = left_resid;
if(!icl::is_empty(right_resid))
const_cast<interval_type&>(last_ ->first) = right_resid;
Modified: branches/release/boost/icl/interval_map.hpp
==============================================================================
--- branches/release/boost/icl/interval_map.hpp (original)
+++ branches/release/boost/icl/interval_map.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -132,7 +132,7 @@
template<class Combiner>
void handle_left_combined(iterator it_)
{
- if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable((*it_).second))
this->_map.erase(it_);
else
segmental::join_left(*this, it_);
@@ -141,7 +141,7 @@
template<class Combiner>
void handle_combined(iterator it_)
{
- if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable((*it_).second))
this->_map.erase(it_);
else
segmental::join_neighbours(*this, it_);
@@ -150,7 +150,7 @@
template<class Combiner>
void handle_preceeded_combined(iterator prior_, iterator& it_)
{
- if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable((*it_).second))
{
this->_map.erase(it_);
it_ = prior_;
@@ -162,7 +162,7 @@
template<class Combiner>
void handle_succeeded_combined(iterator it_, iterator next_)
{
- if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable((*it_).second))
{
this->_map.erase(it_);
segmental::join_right(*this, next_);
@@ -186,7 +186,7 @@
void gap_insert_at(iterator& it_, iterator prior_,
const interval_type& end_gap, const codomain_type& co_val)
{
- if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable((*it_).second))
{
this->_map.erase(it_);
it_ = this->template gap_insert<Combiner>(prior_, end_gap, co_val);
Modified: branches/release/boost/icl/map.hpp
==============================================================================
--- branches/release/boost/icl/map.hpp (original)
+++ branches/release/boost/icl/map.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -431,7 +431,7 @@
{ // !codomain_is_set, !absorbs_identities
static void subtract(Type&, typename Type::iterator it_,
const typename Type::codomain_type& )
- { it_->second = identity_element<typename Type::codomain_type>::value(); }
+ { (*it_).second = identity_element<typename Type::codomain_type>::value(); }
};
template<class Type>
@@ -449,7 +449,7 @@
static void subtract(Type&, typename Type::iterator it_,
const typename Type::codomain_type& co_value)
{
- inverse_codomain_intersect()(it_->second, co_value);
+ inverse_codomain_intersect()((*it_).second, co_value);
}
};
@@ -460,8 +460,8 @@
static void subtract(Type& object, typename Type::iterator it_,
const typename Type::codomain_type& co_value)
{
- inverse_codomain_intersect()(it_->second, co_value);
- if(it_->second == identity_element<codomain_type>::value())
+ inverse_codomain_intersect()((*it_).second, co_value);
+ if((*it_).second == identity_element<codomain_type>::value())
object.erase(it_);
}
};
@@ -489,7 +489,7 @@
{
object.add(operand);
ICL_FORALL(typename Type, it_, object)
- it_->second = identity_element<codomain_type>::value();
+ (*it_).second = identity_element<codomain_type>::value();
}
};
@@ -583,9 +583,9 @@
iterator inserted_
= base_type::insert(prior_,
value_type(addend.first, Combiner::identity_element()));
- Combiner()(inserted_->second, addend.second);
+ Combiner()((*inserted_).second, addend.second);
- if(on_absorbtion_::is_absorbable(inserted_->second))
+ if(on_absorbtion_::is_absorbable((*inserted_).second))
{
erase(inserted_);
return end();
@@ -609,8 +609,8 @@
iterator it_ = find(minuend.first);
if(it_ != end())
{
- Combiner()(it_->second, minuend.second);
- if(on_absorbtion_::is_absorbable(it_->second))
+ Combiner()((*it_).second, minuend.second);
+ if(on_absorbtion_::is_absorbable((*it_).second))
erase(it_);
}
return *this;
Modified: branches/release/boost/icl/split_interval_map.hpp
==============================================================================
--- branches/release/boost/icl/split_interval_map.hpp (original)
+++ branches/release/boost/icl/split_interval_map.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -105,21 +105,21 @@
template<class Combiner>
void handle_left_combined(iterator it_)
{
- if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable((*it_).second))
this->_map.erase(it_);
}
template<class Combiner>
void handle_combined(iterator it_)
{
- if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable((*it_).second))
this->_map.erase(it_);
}
template<class Combiner>
void handle_preceeded_combined(iterator prior_, iterator& it_)
{
- if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable((*it_).second))
{
this->_map.erase(it_);
it_ = prior_;
@@ -129,7 +129,7 @@
template<class Combiner>
void handle_succeeded_combined(iterator it_, iterator)
{
- if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable((*it_).second))
this->_map.erase(it_);
}
@@ -139,7 +139,7 @@
void gap_insert_at(iterator& it_, iterator prior_,
const interval_type& end_gap, const codomain_type& co_val)
{
- if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable(it_->second))
+ if(on_absorbtion<type,Combiner,Traits::absorbs_identities>::is_absorbable((*it_).second))
{
this->_map.erase(it_);
it_ = this->template gap_insert<Combiner>(prior_, end_gap, co_val);
Modified: branches/release/boost/icl/type_traits/difference_type_of.hpp
==============================================================================
--- branches/release/boost/icl/type_traits/difference_type_of.hpp (original)
+++ branches/release/boost/icl/type_traits/difference_type_of.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -10,51 +10,90 @@
#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>
#include <boost/icl/type_traits/no_type.hpp>
#include <boost/icl/type_traits/is_numeric.hpp>
+#include <boost/icl/type_traits/rep_type_of.hpp>
namespace boost{ namespace icl
{
+ namespace detail
+ {
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(difference_type)
+ }
+
+ //--------------------------------------------------------------------------
+ template <class Type>
+ struct has_difference_type
+ : mpl::bool_<detail::has_difference_type<Type>::value>
+ {};
+
+ //--------------------------------------------------------------------------
+ template<class Type> // type_of(T-T)==T
+ struct is_subtraction_closed
+ {
+ typedef is_subtraction_closed type;
+ BOOST_STATIC_CONSTANT(bool,
+ value = (mpl::or_< is_numeric<Type>
+ , mpl::and_< has_rep_type<Type>
+ , mpl::not_<has_difference_type<Type> >
+ >
+ >::value)
+ );
+ };
+
//--------------------------------------------------------------------------
template<class Type>
struct has_difference
{
typedef has_difference type;
BOOST_STATIC_CONSTANT(bool,
- value = (mpl::or_< is_numeric<Type>
- , is_pointer<Type> >::value)
+ value = (mpl::or_< is_subtraction_closed<Type>
+ , is_pointer<Type>
+ , has_difference_type<Type> >::value)
);
};
//--------------------------------------------------------------------------
- template <class Type, bool has_difference>
+ template <class Type, bool has_difference, bool has_diff_type>
struct get_difference_type;
template <class Type>
- struct get_difference_type<Type, false>
+ struct get_difference_type<Type, false, false>
{
typedef no_type type;
};
template <class Type>
- struct get_difference_type<Type*, true>
+ struct get_difference_type<Type*, true, false>
{
typedef std::ptrdiff_t type;
};
template <class Type>
- struct get_difference_type<Type, true>
+ struct get_difference_type<Type, true, false>
{
typedef Type type;
};
+ template <class Type>
+ struct get_difference_type<Type, true, true>
+ {
+ typedef typename Type::difference_type type;
+ };
+
//--------------------------------------------------------------------------
template<class Type>
struct difference_type_of
{
typedef typename
- get_difference_type<Type, has_difference<Type>::value>::type type;
+ get_difference_type< Type
+ , has_difference<Type>::value
+ , has_difference_type<Type>::value
+ >::type type;
};
}} // namespace boost icl
Modified: branches/release/boost/icl/type_traits/infinity.hpp
==============================================================================
--- branches/release/boost/icl/type_traits/infinity.hpp (original)
+++ branches/release/boost/icl/type_traits/infinity.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -1,5 +1,5 @@
/*-----------------------------------------------------------------------------+
-Copyright (c) 2010-2010: Joachim Faulhaber
+Copyright (c) 2010-2011: Joachim Faulhaber
+------------------------------------------------------------------------------+
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENCE.txt or copy at
@@ -10,48 +10,170 @@
#include <string>
#include <boost/static_assert.hpp>
+#include <boost/type_traits/ice.hpp>
#include <boost/icl/type_traits/is_numeric.hpp>
+#include <boost/mpl/and.hpp>
#include <boost/mpl/if.hpp>
namespace boost{ namespace icl
{
-#ifdef BOOST_MSVC
-#pragma warning(push)
-#pragma warning(disable:4127) // conditional expression is constant
-#endif
-
- template <class Type> struct numeric_infinity
- {
- typedef numeric_infinity type;
-
- static Type value()
- {
- BOOST_STATIC_ASSERT((is_numeric<Type>::value));
- if(std::numeric_limits<Type>::has_infinity)
- return std::numeric_limits<Type>::infinity();
- else
- return (std::numeric_limits<Type>::max)();
- }
- };
+template<class Type> struct has_std_infinity
+{
+ typedef has_std_infinity type;
+ BOOST_STATIC_CONSTANT(bool,
+ value = (type_traits::ice_and
+ < is_numeric<Type>::value
+ , std::numeric_limits<Type>::has_infinity
+ >::value)
+ );
+};
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
+template<class Type> struct has_max_infinity
+{
+ typedef has_max_infinity type;
+ BOOST_STATIC_CONSTANT(bool,
+ value = (type_traits::ice_and
+ < is_numeric<Type>::value
+ , type_traits::ice_not<std::numeric_limits<Type>::has_infinity>::value
+ >::value)
+ );
+};
+
+//------------------------------------------------------------------------------
+template <class Type, bool has_std_inf=false, bool has_std_max=false>
+struct get_numeric_infinity;
+template <class Type, bool has_std_max>
+struct get_numeric_infinity<Type, true, has_std_max>
+{
+ typedef get_numeric_infinity type;
+ static Type value()
+ {
+ return (std::numeric_limits<Type>::infinity)();
+ }
+};
- template <class Type> struct infinity
+template <class Type>
+struct get_numeric_infinity<Type, false, true>
+{
+ typedef get_numeric_infinity type;
+ static Type value()
{
- typedef infinity type;
+ return (std::numeric_limits<Type>::max)();
+ }
+};
- static Type value()
- {
- return
- mpl::if_<is_numeric<Type>,
- numeric_infinity<Type>,
- identity_element<Type> >::type::value();
- }
- };
+template <class Type>
+struct get_numeric_infinity<Type, false, false>
+{
+ typedef get_numeric_infinity type;
+ static Type value()
+ {
+ return Type();
+ }
+};
+
+template <class Type>
+struct numeric_infinity
+{
+ typedef numeric_infinity type;
+ static Type value()
+ {
+ return get_numeric_infinity< Type
+ , has_std_infinity<Type>::value
+ , has_max_infinity<Type>::value >::value();
+ }
+};
+
+
+//------------------------------------------------------------------------------
+template<class Type, bool has_numeric_inf, bool has_repr_inf, bool has_size, bool has_diff>
+struct get_infinity;
+
+template<class Type, bool has_repr_inf, bool has_size, bool has_diff>
+struct get_infinity<Type, true, has_repr_inf, has_size, has_diff>
+{
+ typedef get_infinity type;
+
+ static Type value()
+ {
+ return numeric_infinity<Type>::value();
+ }
+};
+
+template<class Type, bool has_size, bool has_diff>
+struct get_infinity<Type, false, true, has_size, has_diff>
+{
+ typedef get_infinity type;
+
+ static Type value()
+ {
+ return Type(numeric_infinity<typename Type::rep>::value());
+ }
+};
+
+template<class Type, bool has_diff>
+struct get_infinity<Type, false, false, true, has_diff>
+{
+ typedef get_infinity type;
+ typedef typename Type::size_type size_type;
+
+ static Type value()
+ {
+ return Type(numeric_infinity<size_type>::value());
+ }
+};
+
+template<class Type>
+struct get_infinity<Type, false, false, false, true>
+{
+ typedef get_infinity type;
+ typedef typename Type::difference_type difference_type;
+
+ static Type value()
+ {
+ return identity_element<difference_type>::value();
+ }
+};
+
+template<class Type>
+struct get_infinity<Type, false, false, false, false>
+{
+ typedef get_infinity type;
+
+ static Type value()
+ {
+ return identity_element<Type>::value();
+ }
+};
+
+template <class Type> struct infinity
+{
+ typedef infinity type;
+
+ static Type value()
+ {
+ return
+ get_infinity< Type
+ , is_numeric<Type>::value
+ , has_rep_type<Type>::value
+ , has_size_type<Type>::value
+ , has_difference_type<Type>::value
+ >::value();
+ }
+};
+
+template <>
+struct infinity<std::string>
+{
+ typedef infinity type;
+
+ static std::string value()
+ {
+ return std::string();
+ }
+};
}} // namespace boost icl
Modified: branches/release/boost/icl/type_traits/is_container.hpp
==============================================================================
--- branches/release/boost/icl/type_traits/is_container.hpp (original)
+++ branches/release/boost/icl/type_traits/is_container.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,6 +15,7 @@
#include <boost/type_traits/is_same.hpp>
#include <boost/icl/type_traits/element_type_of.hpp>
#include <boost/icl/type_traits/segment_type_of.hpp>
+#include <boost/icl/type_traits/size_type_of.hpp>
#include <boost/icl/type_traits/is_map.hpp>
namespace boost{ namespace icl
@@ -22,7 +23,6 @@
namespace detail
{
BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator)
- BOOST_MPL_HAS_XXX_TRAIT_DEF(size_type)
BOOST_MPL_HAS_XXX_TRAIT_DEF(reference)
}
Modified: branches/release/boost/icl/type_traits/is_discrete.hpp
==============================================================================
--- branches/release/boost/icl/type_traits/is_discrete.hpp (original)
+++ branches/release/boost/icl/type_traits/is_discrete.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -26,6 +26,8 @@
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_floating_point.hpp>
+#include <boost/icl/type_traits/rep_type_of.hpp>
+#include <boost/icl/type_traits/is_numeric.hpp>
namespace boost{ namespace icl
{
@@ -33,9 +35,26 @@
{
typedef is_discrete type;
BOOST_STATIC_CONSTANT(bool,
- value = (mpl::and_< boost::detail::is_incrementable<Type>
- , mpl::not_<is_floating_point<Type> >
- >::value)
+ value =
+ (mpl::and_
+ <
+ boost::detail::is_incrementable<Type>
+ , mpl::or_
+ <
+ mpl::and_
+ <
+ mpl::not_<has_rep_type<Type> >
+ , is_non_floating_point<Type>
+ >
+ , mpl::and_
+ <
+ has_rep_type<Type>
+ , is_discrete<typename rep_type_of<Type>::type>
+ //CL , is_non_floating_point<typename rep_type_of<Type>::type>
+ >
+ >
+ >::value
+ )
);
};
Modified: branches/release/boost/icl/type_traits/is_key_container_of.hpp
==============================================================================
--- branches/release/boost/icl/type_traits/is_key_container_of.hpp (original)
+++ branches/release/boost/icl/type_traits/is_key_container_of.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 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: branches/release/boost/icl/type_traits/is_numeric.hpp
==============================================================================
--- branches/release/boost/icl/type_traits/is_numeric.hpp (original)
+++ branches/release/boost/icl/type_traits/is_numeric.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -10,6 +10,9 @@
#include <limits>
#include <complex>
+#include <boost/type_traits/is_floating_point.hpp>
+#include <boost/type_traits/ice.hpp>
+#include <boost/type_traits/is_integral.hpp>
namespace boost{ namespace icl
{
@@ -20,11 +23,27 @@
BOOST_STATIC_CONSTANT(bool, value = (0 < std::numeric_limits<Type>::digits));
};
+template <class Type> struct is_std_numeric
+{
+ typedef is_std_numeric type;
+ BOOST_STATIC_CONSTANT(bool,
+ value = (std::numeric_limits<Type>::is_specialized));
+};
+
+template <class Type> struct is_std_integral
+{
+ typedef is_std_integral type;
+ BOOST_STATIC_CONSTANT(bool,
+ value = (std::numeric_limits<Type>::is_integer));
+};
+
template <class Type> struct is_numeric
{
typedef is_numeric type;
BOOST_STATIC_CONSTANT(bool, value =
- (mpl::or_<is_fixed_numeric<Type>, is_integral<Type> >::value) );
+ (mpl::or_< is_std_numeric<Type>
+ , boost::is_integral<Type>
+ , is_std_integral<Type> >::value) );
};
template <class Type>
@@ -54,6 +73,15 @@
{ return cond || is_less_than(value); }
};
+//--------------------------------------------------------------------------
+template<class Type>
+struct is_non_floating_point
+{
+ typedef is_non_floating_point type;
+ BOOST_STATIC_CONSTANT(bool, value =
+ (mpl::not_< is_floating_point<Type> >::value));
+};
+
}} // namespace boost icl
#endif
Modified: branches/release/boost/icl/type_traits/size_type_of.hpp
==============================================================================
--- branches/release/boost/icl/type_traits/size_type_of.hpp (original)
+++ branches/release/boost/icl/type_traits/size_type_of.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -8,9 +8,63 @@
#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
{
- template <class Type> struct size_type_of{ typedef std::size_t type; };
+
+ namespace detail
+ {
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(size_type)
+ }
+
+ //--------------------------------------------------------------------------
+ template <class Type>
+ struct has_size_type
+ : mpl::bool_<detail::has_size_type<Type>::value>
+ {};
+
+ //--------------------------------------------------------------------------
+ template <class Type, bool has_size, bool has_diff, bool has_rep>
+ struct get_size_type;
+
+ template <class Type>
+ struct get_size_type<Type, false, false, false>
+ {
+ typedef std::size_t type;
+ };
+
+ template <class Type, bool has_diff, bool has_rep>
+ struct get_size_type<Type, true, has_diff, has_rep>
+ {
+ typedef typename Type::size_type type;
+ };
+
+ template <class Type, bool has_rep>
+ struct get_size_type<Type, false, true, has_rep>
+ {
+ typedef typename Type::difference_type type;
+ };
+
+ template <class Type>
+ struct get_size_type<Type, false, false, true>
+ {
+ typedef Type type;
+ };
+
+ //--------------------------------------------------------------------------
+ template<class Type>
+ struct size_type_of
+ {
+ typedef typename
+ get_size_type< Type
+ , has_size_type<Type>::value
+ , has_difference_type<Type>::value
+ , has_rep_type<Type>::value
+ >::type type;
+ };
+
}} // namespace boost icl
#endif
Modified: branches/release/libs/icl/test/Jamfile.v2
==============================================================================
--- branches/release/libs/icl/test/Jamfile.v2 (original)
+++ branches/release/libs/icl/test/Jamfile.v2 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -10,6 +10,7 @@
: requirements
<library>/boost/test//boost_unit_test_framework
<library>/boost/date_time//boost_date_time
+ <library>/boost/chrono//boost_chrono
<link>static
<include>../../..
;
@@ -78,5 +79,79 @@
# Ad hoc -----------------------------------------------------------------
#[ run test_casual_/test_casual.cpp ]
-
+
+
+ # ------------------------------------------------------------------------
+ # Chrono -----------------------------------------------------------------
+ # interval
+ [ run fastest_icl_interval_/fastest_icl_interval.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_icl_interval ]
+
+ # sets
+ [ run fastest_interval_set_/fastest_interval_set.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_interval_set ]
+
+ [ run fastest_interval_set_infix_/fastest_interval_set_infix.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_interval_set_infix ]
+
+ [ run fastest_interval_set_mixed_/fastest_interval_set_mixed.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_interval_set_mixed ]
+
+ # maps
+ [ run fastest_interval_map_/fastest_interval_map.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_interval_map ]
+
+ [ run fastest_interval_map_infix_/fastest_interval_map_infix.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_interval_map_infix ]
+
+ [ run fastest_interval_map_mixed_/fastest_interval_map_mixed.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_interval_map_mixed ]
+
+ [ run fastest_interval_map_mixed2_/fastest_interval_map_mixed2.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_interval_map_mixed2 ]
+
+ [ run fastest_interval_map_infix_mixed_/fastest_interval_map_infix_mixed.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_interval_map_infix_mixed ]
+
+ [ run fastest_icl_map_/fastest_icl_map.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_icl_map ]
+
+
+ # handcoded tests using laws (not LaBatea) -------------------------------
+ # Concept Set
+ [ run fastest_set_interval_set_/fastest_set_interval_set.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_set_interval_set ]
+
+ [ run fastest_set_icl_set_/fastest_set_icl_set.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_set_icl_set ]
+
+ # Concept Map
+ [ run fastest_partial_interval_quantifier_/fastest_partial_interval_quantifier.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_partial_interval_quantifier ]
+
+ [ run fastest_total_interval_quantifier_/fastest_total_interval_quantifier.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_total_interval_quantifier ]
+
+ [ run fastest_partial_icl_quantifier_/fastest_partial_icl_quantifier.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_partial_icl_quantifier ]
+
+ [ run fastest_total_icl_quantifier_/fastest_total_icl_quantifier.cpp
+ : : : <define>BOOST_ICL_TEST_CHRONO
+ : chrono_total_icl_quantifier ]
+
;
Modified: branches/release/libs/icl/test/fast_stat_interval_map_cases.hpp
==============================================================================
--- branches/release/libs/icl/test/fast_stat_interval_map_cases.hpp (original)
+++ branches/release/libs/icl/test/fast_stat_interval_map_cases.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -10,31 +10,31 @@
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_fundamentals_4_ordered_types)
-{ interval_map_fundamentals_4_ordered_types<INTERVAL_MAP, ordered_type_1, int>();}
+{ interval_map_fundamentals_4_ordered_types<INTERVAL_MAP, discrete_type_1, int>();}
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_ctor_4_bicremental_types)
-{ interval_map_ctor_4_bicremental_types<INTERVAL_MAP, bicremental_type_1, int>();}
+{ interval_map_ctor_4_bicremental_types<INTERVAL_MAP, discrete_type_2, int>();}
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_add_sub_4_bicremental_types)
-{ interval_map_add_sub_4_bicremental_types<INTERVAL_MAP, bicremental_type_2, int>();}
+{ interval_map_add_sub_4_bicremental_types<INTERVAL_MAP, discrete_type_3, int>();}
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_contains_4_bicremental_types)
-{ interval_map_contains_4_bicremental_types<INTERVAL_MAP, discrete_type_5, int>();}
+{ interval_map_contains_4_bicremental_types<INTERVAL_MAP, discrete_type_4, int>();}
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_contains_key_objects_4_bicremental_types)
-{ interval_map_contains_key_objects_4_bicremental_types<INTERVAL_MAP, discrete_type_4, int>();}
+{ interval_map_contains_key_objects_4_bicremental_types<INTERVAL_MAP, discrete_type_5, int>();}
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_operators_4_bicremental_types)
-{ interval_map_operators_4_bicremental_types<INTERVAL_MAP, bicremental_type_5, int>();}
+{ interval_map_operators_4_bicremental_types<INTERVAL_MAP, discrete_type_6, int>();}
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_base_intersect_4_bicremental_types)
-{ interval_map_base_intersect_4_bicremental_types<INTERVAL_MAP, bicremental_type_6, int>();}
+{ interval_map_base_intersect_4_bicremental_types<INTERVAL_MAP, discrete_type_1, int>();}
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_base_erase_4_bicremental_types)
@@ -42,11 +42,11 @@
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_base_is_disjoint_4_bicremental_types)
-{ interval_map_base_is_disjoint_4_bicremental_types<INTERVAL_MAP, bicremental_type_8, int>();}
+{ interval_map_base_is_disjoint_4_bicremental_types<INTERVAL_MAP, discrete_type_8, int>();}
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_flip_4_bicremental_types)
-{ interval_map_flip_4_bicremental_types<INTERVAL_MAP, bicremental_type_1, int>();}
+{ interval_map_flip_4_bicremental_types<INTERVAL_MAP, discrete_type_1, int>();}
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_find_4_bicremental_types)
@@ -70,7 +70,7 @@
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_std_copy_via_inserter_4_bicremental_types)
-{ interval_map_std_copy_via_inserter_4_bicremental_types<signed_bicremental_type_1, int, partial_absorber, INTERVAL_MAP>();}
+{ interval_map_std_copy_via_inserter_4_bicremental_types<signed_discrete_type_1, int, partial_absorber, INTERVAL_MAP>();}
BOOST_AUTO_TEST_CASE
(fastest_icl_interval_map_element_iter_4_discrete_types)
Modified: branches/release/libs/icl/test/fastest_icl_map_/fastest_icl_map.cpp
==============================================================================
--- branches/release/libs/icl/test/fastest_icl_map_/fastest_icl_map.cpp (original)
+++ branches/release/libs/icl/test/fastest_icl_map_/fastest_icl_map.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,13 +15,13 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <set>
#include <boost/icl/associative_element_container.hpp>
#include <boost/icl/map.hpp>
#include <boost/icl/interval_map.hpp>
#include <boost/icl/detail/interval_morphism.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/fastest_partial_icl_quantifier_/fastest_partial_icl_quantifier.cpp
==============================================================================
--- branches/release/libs/icl/test/fastest_partial_icl_quantifier_/fastest_partial_icl_quantifier.cpp (original)
+++ branches/release/libs/icl/test/fastest_partial_icl_quantifier_/fastest_partial_icl_quantifier.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,11 +15,11 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/interval_map.hpp>
#include <boost/icl/split_interval_map.hpp>
#include <boost/icl/detail/interval_morphism.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/fastest_partial_interval_quantifier_/fastest_partial_interval_quantifier.cpp
==============================================================================
--- branches/release/libs/icl/test/fastest_partial_interval_quantifier_/fastest_partial_interval_quantifier.cpp (original)
+++ branches/release/libs/icl/test/fastest_partial_interval_quantifier_/fastest_partial_interval_quantifier.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,11 +15,11 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/interval_map.hpp>
#include <boost/icl/split_interval_map.hpp>
#include <boost/icl/detail/interval_morphism.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/fastest_set_icl_set_/fastest_set_icl_set.cpp
==============================================================================
--- branches/release/libs/icl/test/fastest_set_icl_set_/fastest_set_icl_set.cpp (original)
+++ branches/release/libs/icl/test/fastest_set_icl_set_/fastest_set_icl_set.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,7 +15,6 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <set>
#include <boost/icl/associative_element_container.hpp>
@@ -23,6 +22,7 @@
#include <boost/icl/separate_interval_set.hpp>
#include <boost/icl/split_interval_set.hpp>
#include <boost/icl/detail/interval_morphism.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/fastest_set_interval_set_/fastest_set_interval_set.cpp
==============================================================================
--- branches/release/libs/icl/test/fastest_set_interval_set_/fastest_set_interval_set.cpp (original)
+++ branches/release/libs/icl/test/fastest_set_interval_set_/fastest_set_interval_set.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,12 +15,12 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/interval_set.hpp>
#include <boost/icl/separate_interval_set.hpp>
#include <boost/icl/split_interval_set.hpp>
#include <boost/icl/detail/interval_morphism.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/fastest_total_icl_quantifier_/fastest_total_icl_quantifier.cpp
==============================================================================
--- branches/release/libs/icl/test/fastest_total_icl_quantifier_/fastest_total_icl_quantifier.cpp (original)
+++ branches/release/libs/icl/test/fastest_total_icl_quantifier_/fastest_total_icl_quantifier.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,10 +15,10 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/interval_map.hpp>
#include <boost/icl/split_interval_map.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/fastest_total_interval_quantifier_/fastest_total_interval_quantifier.cpp
==============================================================================
--- branches/release/libs/icl/test/fastest_total_interval_quantifier_/fastest_total_interval_quantifier.cpp (original)
+++ branches/release/libs/icl/test/fastest_total_interval_quantifier_/fastest_total_interval_quantifier.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,10 +15,10 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/interval_map.hpp>
#include <boost/icl/split_interval_map.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_casual_/test_casual.cpp
==============================================================================
--- branches/release/libs/icl/test/test_casual_/test_casual.cpp (original)
+++ branches/release/libs/icl/test/test_casual_/test_casual.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -7,6 +7,8 @@
+-----------------------------------------------------------------------------*/
#define BOOST_TEST_MODULE icl::casual unit test
+#define BOOST_ICL_TEST_CHRONO
+
#include <libs/icl/test/disable_test_warnings.hpp>
#include <string>
@@ -20,6 +22,8 @@
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
+#include <boost/rational.hpp>
+
#include <boost/type_traits/is_same.hpp>
#include <boost/icl/gregorian.hpp>
@@ -30,11 +34,154 @@
#include <boost/icl/interval_set.hpp>
#include <boost/icl/interval.hpp>
+
+
using namespace std;
using namespace boost;
using namespace unit_test;
using namespace boost::icl;
+namespace boost{ namespace scalars
+{
+/*
+template<class Origin = constant<0>, class Factor = ratio<1,1>, class Rep>
+class scalar
+{
+public:
+private:
+
+}
+*/
+}} //namespace boost scalars
+
+
+
+class MyInt
+{
+public:
+ MyInt():_rep() { cout << "default constructed\n"; }
+ int value()const { return _rep; }
+private:
+ int _rep;
+};
+
+BOOST_AUTO_TEST_CASE(chrono_duration_ctor)
+{
+ using namespace boost::chrono;
+
+ chrono::duration<int> cd_default0 = chrono::duration<int>();
+ cout << "chrono::duration<int>() = " << cd_default0 << endl;
+
+ chrono::duration<double> cd_default1 = chrono::duration<double>();
+ cout << "chrono::duration<double>() = " << cd_default1 << endl;
+
+ chrono::duration<rational<int> > cd_default2 = chrono::duration<rational<int> >();
+ cout << "chrono::duration<rational<int> >() = " << cd_default2 << endl;
+
+ chrono::duration<complex<float> > cd_default3 = chrono::duration<complex<float> >();
+ cout << "chrono::duration<complex<float> >() = " << cd_default3 << endl;
+
+/*
+ chrono::duration<MyInt> cd_default = chrono::duration<MyInt>();
+ cout << "chrono::duration<MyInt>() = " << cd_default.count().value() << endl;
+ cout << "===============================\n";
+
+ duration<int, ratio<60> > min1(1);
+ duration<int, ratio<1,100> > centi1(1);
+ duration<int, ratio<1,100> > centi2 = min1 + centi1;
+ cout << "centi2 = " << centi2 << " centi2.count() = " << centi2.count() << endl;
+
+ centi2 += centi1;
+ cout << "++centi2=" << centi2 << " centi2.count() = " << centi2.count() << endl;
+*/
+}
+
+
+BOOST_AUTO_TEST_CASE(test_difference_types)
+{
+ BOOST_CHECK(( boost::is_same< int, difference_type_of<int>::type >::value ));
+ BOOST_CHECK(( boost::is_same< double, difference_type_of<double>::type >::value ));
+ BOOST_CHECK(( boost::is_same< std::ptrdiff_t, difference_type_of<int*>::type >::value ));
+
+ BOOST_CHECK(( has_difference_type<std::string>::value ));
+ BOOST_CHECK(( boost::is_same< std::string::difference_type, difference_type_of<std::string>::type >::value ));
+ BOOST_CHECK(( boost::is_same< std::ptrdiff_t, difference_type_of<std::string>::type >::value ));
+
+ BOOST_CHECK(( boost::is_same< chrono::duration<int>
+ , difference_type_of<chrono::duration<int> >::type >::value ));
+ BOOST_CHECK(( boost::is_same< chrono::duration<double>
+ , difference_type_of<chrono::duration<double> >::type >::value ));
+
+ BOOST_CHECK(( boost::is_same< Now::time_point::duration
+ , difference_type_of<Now::time_point>::type >::value ));
+
+ typedef boost::chrono::time_point<Now, boost::chrono::duration<double> > contin_timeT;
+ BOOST_CHECK(( boost::is_same< contin_timeT::duration
+ , difference_type_of<contin_timeT>::type >::value ));
+
+ typedef boost::chrono::time_point<Now, boost::chrono::duration<int> > discr_timeT;
+ BOOST_CHECK(( boost::is_same< chrono::duration<int>
+ , difference_type_of<discr_timeT>::type >::value ));
+}
+
+BOOST_AUTO_TEST_CASE(test_size_types)
+{
+ BOOST_CHECK(( boost::is_same< std::size_t, size_type_of<int>::type >::value ));
+ BOOST_CHECK(( boost::is_same< std::size_t, size_type_of<double>::type >::value ));
+ BOOST_CHECK(( boost::is_same< std::size_t, size_type_of<int*>::type >::value ));
+ BOOST_CHECK(( boost::is_same< std::size_t, size_type_of<std::string>::type >::value ));
+ BOOST_CHECK(( boost::is_same< chrono::duration<int>
+ , size_type_of<chrono::duration<int> >::type >::value ));
+ BOOST_CHECK(( boost::is_same< chrono::duration<double>
+ , size_type_of<chrono::duration<double> >::type >::value ));
+
+ typedef boost::chrono::time_point<Now, boost::chrono::duration<int> > discr_timeT;
+ BOOST_CHECK(( boost::is_same< chrono::duration<int>
+ , size_type_of<discr_timeT>::type >::value ));
+
+ typedef boost::chrono::time_point<Now, boost::chrono::duration<double> > contin_timeT;
+ BOOST_CHECK(( boost::is_same< contin_timeT::duration
+ , size_type_of<contin_timeT>::type >::value ));
+}
+
+BOOST_AUTO_TEST_CASE(test_chrono_identity_elements)
+{
+ chrono::duration<int> idel_i = icl::identity_element<chrono::duration<int> >::value();
+ cout << "dur<int>0 = " << idel_i << endl;
+ chrono::duration<double> idel_d = icl::identity_element<chrono::duration<int> >::value();
+ cout << "dur<dbl>0 = " << idel_d << endl;
+
+ BOOST_CHECK(( boost::is_same< chrono::duration<int>
+ , size_type_of<chrono::duration<int> >::type >::value ));
+}
+
+
+
+BOOST_AUTO_TEST_CASE(test_infinities)
+{
+ BOOST_CHECK(( has_std_infinity<double>::value));
+ BOOST_CHECK((!has_std_infinity<int>::value));
+
+ BOOST_CHECK(( has_max_infinity<int>::value ));
+ BOOST_CHECK((!has_max_infinity<double>::value ));
+
+ //--------------------------------------------------------------------------
+ BOOST_CHECK_EQUAL( numeric_infinity<double>::value(), (std::numeric_limits<double>::infinity)() );
+ BOOST_CHECK_EQUAL( numeric_infinity<int>::value(), (std::numeric_limits<int>::max)() );
+ BOOST_CHECK_EQUAL( numeric_infinity<std::string>::value(), std::string() );
+
+ //--------------------------------------------------------------------------
+ BOOST_CHECK_EQUAL( infinity<double>::value(), (std::numeric_limits<double>::infinity)() );
+ BOOST_CHECK_EQUAL( infinity<int>::value(), (std::numeric_limits<int>::max)() );
+ BOOST_CHECK_EQUAL( infinity<std::string>::value(), identity_element<std::string>::value() );
+
+ //--------------------------------------------------------------------------
+ BOOST_CHECK_EQUAL( infinity<chrono::duration<double> >::value()
+ , chrono::duration<double>((std::numeric_limits<double>::infinity)()) );
+ BOOST_CHECK_EQUAL( infinity<chrono::duration<int> >::value()
+ , chrono::duration<int>((std::numeric_limits<int>::max)()) );
+
+}
BOOST_AUTO_TEST_CASE(casual)
{
@@ -44,25 +191,26 @@
//typedef interval_set<T> IntervalSetT;
//typedef IntervalMapT::interval_type IntervalT;
- /*
- int i;
- int j = int();
- chrono::duration<int> cd1 = chrono::duration<int>();
- chrono::duration<int> cd2(0);
- chrono::duration<int> dur1(0);
- chrono::duration<int> dur2, dur3, dur4;
- dur2 = dur3 = dur4 = dur1;
- int itg1(0);
- int itg2, itg3, itg4;
- itg2 = itg3 = itg4 = itg1;
-
- cout << "uninitialized i = " << i << endl;
- cout << "default constructed j = " << j << endl;
- cout << (cd1==cd2 ? "eq" : "!eq") << endl;
- cout << "chrono::duration cd1() = " << cd1 << endl;
- cout << "chrono::duration cd2(0) = " << cd2 << endl;
- */
+ BOOST_CHECK((has_std_infinity<double>::value));
+
+ BOOST_CHECK((boost::detail::is_incrementable<chrono::duration<int> >::value));
+
+ BOOST_CHECK((has_rep_type<chrono::duration<int> >::value));
+ BOOST_CHECK((represents<int, chrono::duration<int> >::value));
+
+ BOOST_CHECK((!is_discrete<chrono::duration<double> >::value));
+
+ //BOOST_CHECK((!is_discrete<Now_time_rational>::value));
+ BOOST_CHECK(( is_continuous<boost::rational<int> >::value));
+ BOOST_CHECK(( !is_discrete<boost::rational<int> >::value));
+
+ BOOST_CHECK(( has_rep_type<Now_time_rational>::value));
+ BOOST_CHECK(( is_continuous<Now_time_rational>::value));
+ BOOST_CHECK(( !is_discrete<Now_time_rational>::value));
+ BOOST_CHECK(( is_continuous<typename rep_type_of<Now_time_rational>::type>::value));
+
BOOST_CHECK_EQUAL(true, true);
}
+
Modified: branches/release/libs/icl/test/test_changing_interval_defaults_/test_changing_interval_defaults.cpp
==============================================================================
--- branches/release/libs/icl/test/test_changing_interval_defaults_/test_changing_interval_defaults.cpp (original)
+++ branches/release/libs/icl/test/test_changing_interval_defaults_/test_changing_interval_defaults.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -21,7 +21,6 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/type_traits/is_same.hpp>
@@ -34,6 +33,7 @@
#include <boost/icl/detail/interval_morphism.hpp>
#include <boost/icl/interval_map.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_doc_code_/test_doc_code.cpp
==============================================================================
--- branches/release/libs/icl/test/test_doc_code_/test_doc_code.cpp (original)
+++ branches/release/libs/icl/test/test_doc_code_/test_doc_code.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -21,7 +21,6 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/type_traits/is_same.hpp>
@@ -29,6 +28,7 @@
#include <boost/icl/detail/interval_morphism.hpp>
#include <boost/icl/interval_map.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_icl_map.hpp
==============================================================================
--- branches/release/libs/icl/test/test_icl_map.hpp (original)
+++ branches/release/libs/icl/test/test_icl_map.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -32,8 +32,8 @@
MapT map_a;
segmental::atomize(map_a, itv_map_a);
- BOOST_CHECK_EQUAL( contains(map_a, MK_u(3)), true );
- BOOST_CHECK_EQUAL( within(MK_u(3), map_a), true );
+ BOOST_CHECK_EQUAL( contains(map_a, MK_v(3)), true );
+ BOOST_CHECK_EQUAL( within(MK_v(3), map_a), true );
map_element_type key_value_pair(MK_v(6), MK_u(3));
BOOST_CHECK( contains(map_a, key_value_pair) );
Modified: branches/release/libs/icl/test/test_icl_map_/test_icl_map.cpp
==============================================================================
--- branches/release/libs/icl/test/test_icl_map_/test_icl_map.cpp (original)
+++ branches/release/libs/icl/test/test_icl_map_/test_icl_map.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,11 +15,11 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/map.hpp>
#include <boost/icl/interval_map.hpp>
#include <boost/icl/detail/interval_morphism.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_interval_map_shared.hpp
==============================================================================
--- branches/release/libs/icl/test/test_interval_map_shared.hpp (original)
+++ branches/release/libs/icl/test/test_interval_map_shared.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -1183,11 +1183,12 @@
>
void interval_map_find_4_numeric_continuous_types()
{
+#ifndef BOOST_ICL_TEST_CHRONO
typedef IntervalMap<T,U> IntervalMapT;
typedef typename IntervalMapT::interval_type IntervalT;
typedef typename IntervalMapT::const_iterator c_iterator;
- T q_1_2 = MK_v(1) / MK_v(2);
+ T q_1_2 = MK_v(1) / MK_v(2);//JODO Doesn't work with chrono
T q_3_2 = MK_v(3) / MK_v(2);
T q_1_3 = MK_v(1) / MK_v(3);
T q_2_3 = MK_v(2) / MK_v(3);
@@ -1232,7 +1233,7 @@
BOOST_CHECK( !icl::contains(map_a, MK_v(1)) );
BOOST_CHECK( icl::contains(map_a, q_3_2) );
BOOST_CHECK( !icl::contains(map_a, MK_v(2)) );
-
+#endif
}
Modified: branches/release/libs/icl/test/test_misc_/test_misc.cpp
==============================================================================
--- branches/release/libs/icl/test/test_misc_/test_misc.cpp (original)
+++ branches/release/libs/icl/test/test_misc_/test_misc.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -16,7 +16,6 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/type_traits/is_same.hpp>
#include <boost/icl/rational.hpp>
@@ -24,6 +23,7 @@
#include <boost/icl/detail/interval_morphism.hpp>
#include <boost/icl/interval_map.hpp>
#include <boost/icl/split_interval_set.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_partial_icl_quantifier_/test_partial_icl_quantifier.cpp
==============================================================================
--- branches/release/libs/icl/test/test_partial_icl_quantifier_/test_partial_icl_quantifier.cpp (original)
+++ branches/release/libs/icl/test/test_partial_icl_quantifier_/test_partial_icl_quantifier.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,10 +15,10 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/interval_map.hpp>
#include <boost/icl/split_interval_map.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_partial_interval_quantifier_/test_partial_interval_quantifier.cpp
==============================================================================
--- branches/release/libs/icl/test/test_partial_interval_quantifier_/test_partial_interval_quantifier.cpp (original)
+++ branches/release/libs/icl/test/test_partial_interval_quantifier_/test_partial_interval_quantifier.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,10 +15,10 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/interval_map.hpp>
#include <boost/icl/split_interval_map.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_set_icl_set_/test_set_icl_set.cpp
==============================================================================
--- branches/release/libs/icl/test/test_set_icl_set_/test_set_icl_set.cpp (original)
+++ branches/release/libs/icl/test/test_set_icl_set_/test_set_icl_set.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,7 +15,6 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <set>
#include <boost/interprocess/containers/set.hpp>
@@ -25,6 +24,7 @@
#include <boost/icl/separate_interval_set.hpp>
#include <boost/icl/split_interval_set.hpp>
#include <boost/icl/detail/interval_morphism.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_set_interval_set_/test_set_interval_set.cpp
==============================================================================
--- branches/release/libs/icl/test/test_set_interval_set_/test_set_interval_set.cpp (original)
+++ branches/release/libs/icl/test/test_set_interval_set_/test_set_interval_set.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,12 +15,12 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/interval_set.hpp>
#include <boost/icl/separate_interval_set.hpp>
#include <boost/icl/split_interval_set.hpp>
#include <boost/icl/detail/interval_morphism.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_total_icl_quantifier_/test_total_icl_quantifier.cpp
==============================================================================
--- branches/release/libs/icl/test/test_total_icl_quantifier_/test_total_icl_quantifier.cpp (original)
+++ branches/release/libs/icl/test/test_total_icl_quantifier_/test_total_icl_quantifier.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,10 +15,10 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/interval_map.hpp>
#include <boost/icl/split_interval_map.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_total_interval_quantifier_/test_total_interval_quantifier.cpp
==============================================================================
--- branches/release/libs/icl/test/test_total_interval_quantifier_/test_total_interval_quantifier.cpp (original)
+++ branches/release/libs/icl/test/test_total_interval_quantifier_/test_total_interval_quantifier.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -15,10 +15,10 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/icl/interval_map.hpp>
#include <boost/icl/split_interval_map.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
Modified: branches/release/libs/icl/test/test_type_lists.hpp
==============================================================================
--- branches/release/libs/icl/test/test_type_lists.hpp (original)
+++ branches/release/libs/icl/test/test_type_lists.hpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -18,27 +18,29 @@
#include <boost/icl/ptime.hpp>
#ifdef BOOST_ICL_TEST_XINT
-#include <boost/icl/xint.hpp>
+# include <boost/icl/xint.hpp>
#endif
#ifdef BOOST_ICL_TEST_CHRONO
-//JODO not working: #define BOOST_CHRONO_INLINED
-#include <boost/icl/chrono.hpp>
+# define BOOST_CHRONO_EXTENSIONS
+# include <libs/icl/test/chrono/utility.hpp>
+
+ namespace boch = boost::chrono;
#endif
#include <boost/icl/rational.hpp>
#if(_MSC_VER < 1500 && defined(_DEBUG) ) // 1500 = MSVC-9.0
-typedef int boost_posix_time_ptime;
-typedef int boost_posix_time_duration;
-typedef int boost_gregorian_date;
-typedef int boost_gregorian_date_duration;
-#else
-typedef boost::posix_time::ptime boost_posix_time_ptime;
-typedef boost::posix_time::time_duration boost_posix_time_duration;
-typedef boost::gregorian::date boost_gregorian_date;
-typedef boost::gregorian::date_duration boost_gregorian_date_duration;
+ typedef int boost_posix_time_ptime;
+ typedef int boost_posix_time_duration;
+ typedef int boost_gregorian_date;
+ typedef int boost_gregorian_date_duration;
+#else
+ typedef boost::posix_time::ptime boost_posix_time_ptime;
+ typedef boost::posix_time::time_duration boost_posix_time_duration;
+ typedef boost::gregorian::date boost_gregorian_date;
+ typedef boost::gregorian::date_duration boost_gregorian_date_duration;
#endif
typedef ::boost::mpl::list<
@@ -51,8 +53,10 @@
,boost::rational<boost::xint::integer>
#endif
#ifdef BOOST_ICL_TEST_CHRONO
- ,boost::chrono::duration<int>
- ,boost::chrono::duration<double>
+ ,boch::duration<int>
+ ,boch::duration<double>
+ ,Now::time_point
+ ,boch::time_point<Now, boch::duration<double> >
#endif
,boost_posix_time_ptime
,boost_posix_time_duration
@@ -61,15 +65,33 @@
,int*
> bicremental_types;
-typedef unsigned int bicremental_type_1;
-typedef int bicremental_type_2;
-typedef double bicremental_type_3;
-typedef boost::rational<int> bicremental_type_4;
-typedef boost_posix_time_ptime bicremental_type_5;
-typedef short bicremental_type_6;
-typedef float bicremental_type_7;
-typedef int* bicremental_type_8;
-
+#ifdef BOOST_ICL_TEST_CHRONO
+ typedef boch::duration<long long, boost::ratio<1,113> > duration_long2_113s;
+ typedef boch::duration<int, boost::ratio<11,113> > duration_int_11_113s;
+ typedef boch::duration<boost::rational<int>, boost::ratio<101,997> > duration_rational_101_997s;
+ typedef boch::time_point<Now, duration_int_11_113s > Now_time_int_11_113s;
+ typedef boch::time_point<Now, boch::duration<double> > Now_time_double;
+ typedef boch::time_point<Now, boch::duration<boost::rational<int> > > Now_time_rational;
+ typedef boch::time_point<Now, duration_rational_101_997s > Now_time_rational_101_997s;
+
+ typedef boch::duration<int> bicremental_type_1;
+ typedef boch::duration<double> bicremental_type_2;
+ typedef Now::time_point bicremental_type_3;
+ typedef Now_time_double bicremental_type_4;
+ typedef Now_time_rational bicremental_type_5;
+ typedef duration_long2_113s bicremental_type_6;
+ typedef duration_rational_101_997s bicremental_type_7;
+ typedef Now_time_rational_101_997s bicremental_type_8;
+#else
+ typedef unsigned int bicremental_type_1;
+ typedef int bicremental_type_2;
+ typedef double bicremental_type_3;
+ typedef boost::rational<int> bicremental_type_4;
+ typedef boost_posix_time_ptime bicremental_type_5;
+ typedef short bicremental_type_6;
+ typedef float bicremental_type_7;
+ typedef int* bicremental_type_8;
+#endif //BOOST_ICL_TEST_CHRONO
typedef ::boost::mpl::list<
short, int, long, long long
@@ -80,16 +102,25 @@
,boost::rational<boost::xint::integer>
#endif
#ifdef BOOST_ICL_TEST_CHRONO
- ,boost::chrono::duration<int>
- ,boost::chrono::duration<float>
+ ,boch::duration<int>
+ ,boch::duration<float>
+ ,Now::time_point
#endif
> signed_bicremental_types;
-typedef int signed_bicremental_type_1;
-typedef double signed_bicremental_type_2;
-typedef boost::rational<int> signed_bicremental_type_3;
-typedef short signed_bicremental_type_4;
-typedef float signed_bicremental_type_5;
+#ifdef BOOST_ICL_TEST_CHRONO
+ typedef boch::duration<int> signed_bicremental_type_1;
+ typedef boch::duration<double> signed_bicremental_type_2;
+ typedef Now::time_point signed_bicremental_type_3;
+ typedef Now_time_double signed_bicremental_type_4;
+ typedef Now_time_rational signed_bicremental_type_5;
+#else
+ typedef int signed_bicremental_type_1;
+ typedef double signed_bicremental_type_2;
+ typedef boost::rational<int> signed_bicremental_type_3;
+ typedef short signed_bicremental_type_4;
+ typedef float signed_bicremental_type_5;
+#endif //BOOST_ICL_TEST_CHRONO
//DBG short list for debugging
typedef ::boost::mpl::list<
@@ -103,13 +134,21 @@
,boost::rational<boost::xint::integer>
#endif
#ifdef BOOST_ICL_TEST_CHRONO
- ,boost::chrono::duration<double>
+ ,boch::duration<double>
+ ,boch::time_point<Now, boch::duration<double> >
#endif
> bicremental_continuous_types;
-typedef float bicremental_continuous_type_1;
-typedef double bicremental_continuous_type_2;
-typedef boost::rational<int> bicremental_continuous_type_3;
+
+#ifdef BOOST_ICL_TEST_CHRONO
+ typedef boch::duration<double> bicremental_continuous_type_1;
+ typedef Now_time_double bicremental_continuous_type_2;
+ typedef Now_time_rational bicremental_continuous_type_3;
+#else
+ typedef float bicremental_continuous_type_1;
+ typedef double bicremental_continuous_type_2;
+ typedef boost::rational<int> bicremental_continuous_type_3;
+#endif // BOOST_ICL_TEST_CHRONO
typedef ::boost::mpl::list<
@@ -134,29 +173,50 @@
,boost::xint::integer
#endif
#ifdef BOOST_ICL_TEST_CHRONO
- ,boost::chrono::duration<unsigned short>
+ ,boch::duration<unsigned short>
+ ,Now::time_point
#endif
,boost_posix_time_ptime
- ,boost_posix_time_ptime
,boost_posix_time_duration
,boost_gregorian_date
,boost_gregorian_date_duration
,int*
> discrete_types;
-typedef int discrete_type_1;
-typedef boost_posix_time_ptime discrete_type_2;
-typedef unsigned int discrete_type_3;
-typedef short discrete_type_4;
-typedef unsigned int discrete_type_5;
+
+#ifdef BOOST_ICL_TEST_CHRONO
+ typedef boch::duration<int> discrete_type_1;
+ typedef duration_int_11_113s discrete_type_2;
+ typedef Now::time_point discrete_type_3;
+ typedef duration_long2_113s discrete_type_4;
+ typedef Now_time_int_11_113s discrete_type_5;
+ typedef short discrete_type_6;
+ typedef int* discrete_type_7;
+ typedef boost_posix_time_duration discrete_type_8;
+#else
+ typedef int discrete_type_1;
+ typedef boost_posix_time_ptime discrete_type_2;
+ typedef unsigned int discrete_type_3;
+ typedef short discrete_type_4;
+ typedef int* discrete_type_5;
+ typedef boost_posix_time_duration discrete_type_6;
+ typedef boost_gregorian_date discrete_type_7;
+ typedef boost_gregorian_date_duration discrete_type_8;
+#endif //BOOST_ICL_TEST_CHRONO
typedef ::boost::mpl::list<
short, int, long
> signed_discrete_types;
-typedef int signed_discrete_type_1;
-typedef short signed_discrete_type_2;
-typedef long signed_discrete_type_3;
+#ifdef BOOST_ICL_TEST_CHRONO
+ typedef Now::time_point signed_discrete_type_1;
+ typedef duration_long2_113s signed_discrete_type_2;
+ typedef Now_time_int_11_113s signed_discrete_type_3;
+#else
+ typedef int signed_discrete_type_1;
+ typedef short signed_discrete_type_2;
+ typedef long signed_discrete_type_3;
+#endif //BOOST_ICL_TEST_CHRONO
typedef ::boost::mpl::list<
float, double, long double
@@ -164,15 +224,26 @@
#ifdef BOOST_ICL_TEST_XINT
,boost::rational<boost::xint::integer>
#endif
-#ifdef BOOST_ICL_TEST_CHRONO
- ,boost::chrono::duration<long double>
-#endif
+//JODO
+//test_interval_map_shared.hpp(1190) : error C2440: 'initializing' : cannot convert from 'long double' to 'boost::chrono::duration<Rep>'
+//#ifdef BOOST_ICL_TEST_CHRONO
+// ,boost::chrono::duration<long double>
+//#endif
> numeric_continuous_types;
-typedef double numeric_continuous_type_1;
-typedef float numeric_continuous_type_2;
-typedef boost::rational<int> numeric_continuous_type_3;
-typedef long double numeric_continuous_type_4;
+
+#ifdef BOOST_ICL_TEST_CHRONO
+ typedef boch::duration<double> numeric_continuous_type_1;
+ typedef Now_time_double numeric_continuous_type_2;
+ typedef Now_time_rational numeric_continuous_type_3;
+ typedef duration_rational_101_997s numeric_continuous_type_4;
+#else
+ typedef double numeric_continuous_type_1;
+ typedef float numeric_continuous_type_2;
+ typedef boost::rational<int> numeric_continuous_type_3;
+ typedef long double numeric_continuous_type_4;
+#endif //BOOST_ICL_TEST_CHRONO
+
typedef ::boost::mpl::list<
float, double, long double
@@ -181,28 +252,43 @@
,boost::rational<boost::xint::integer>
#endif
#ifdef BOOST_ICL_TEST_CHRONO
- ,boost::chrono::duration<double>
+ ,boch::duration<double>
+ ,boch::time_point<Now, boch::duration<double> >
#endif
,std::string
> continuous_types;
-typedef double continuous_type_1;
-typedef float continuous_type_2;
-typedef boost::rational<int> continuous_type_3;
-typedef std::string continuous_type_4;
+#ifdef BOOST_ICL_TEST_CHRONO
+ typedef boch::duration<double> continuous_type_1;
+ typedef Now_time_double continuous_type_2;
+ typedef Now_time_rational continuous_type_3;
+ typedef std::string continuous_type_4;
+#else
+ typedef double continuous_type_1;
+ typedef float continuous_type_2;
+ typedef boost::rational<int> continuous_type_3;
+ typedef std::string continuous_type_4;
+#endif //BOOST_ICL_TEST_CHRONO
typedef ::boost::mpl::list<
- unsigned short, unsigned int
- ,unsigned long, unsigned long long
- ,short, int, long, long long
- ,float, double, long double
+ unsigned short
+ ,unsigned long
+ ,unsigned long long
+ ,short
+ ,int
+ ,long
+ ,long long
+ ,float
+ ,double
+ ,long double
,boost::rational<int>
#ifdef BOOST_ICL_TEST_XINT
,boost::xint::integer
#endif
#ifdef BOOST_ICL_TEST_CHRONO
- ,boost::chrono::duration<short>
- ,boost::chrono::duration<long double>
+ ,boch::duration<short>
+ ,boch::duration<long double>
+ ,Now::time_point
#endif
,boost_posix_time_ptime
,boost_posix_time_duration
@@ -212,11 +298,19 @@
,std::string
> ordered_types;
-typedef int ordered_type_1;
-typedef std::string ordered_type_2;
-typedef boost_posix_time_ptime ordered_type_3;
-typedef boost::rational<int> ordered_type_4;
-typedef double ordered_type_5;
+#ifdef BOOST_ICL_TEST_CHRONO
+ typedef boch::duration<int> ordered_type_1;
+ typedef boch::duration<double> ordered_type_2;
+ typedef Now::time_point ordered_type_3;
+ typedef Now_time_double ordered_type_4;
+ typedef Now_time_rational ordered_type_5;
+#else
+ typedef int ordered_type_1;
+ typedef std::string ordered_type_2;
+ typedef boost_posix_time_ptime ordered_type_3;
+ typedef boost::rational<int> ordered_type_4;
+ typedef double ordered_type_5;
+#endif //BOOST_ICL_TEST_CHRONO
#endif
Modified: branches/release/libs/icl/test/test_type_traits_/test_type_traits.cpp
==============================================================================
--- branches/release/libs/icl/test/test_type_traits_/test_type_traits.cpp (original)
+++ branches/release/libs/icl/test/test_type_traits_/test_type_traits.cpp 2011-03-31 12:34:01 EDT (Thu, 31 Mar 2011)
@@ -20,13 +20,13 @@
// interval instance types
#include "../test_type_lists.hpp"
#include "../test_value_maker.hpp"
-#include "../test_laws.hpp"
#include <boost/type_traits/is_same.hpp>
#include <boost/icl/rational.hpp>
#include <boost/icl/interval_map.hpp>
#include <boost/icl/map.hpp>
+#include "../test_laws.hpp"
using namespace std;
using namespace boost;
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