|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67338 - in trunk: boost/icl libs/icl/test
From: afojgo_at_[hidden]
Date: 2010-12-19 10:21:39
Author: jofaber
Date: 2010-12-19 10:21:32 EST (Sun, 19 Dec 2010)
New Revision: 67338
URL: http://svn.boost.org/trac/boost/changeset/67338
Log:
Some adjustments of difference_type and size_type on duration types for the adapter code of boost date_time.
Text files modified:
trunk/boost/icl/gregorian.hpp | 19 +++++++++++++++++++
trunk/boost/icl/interval_base_map.hpp | 9 +++++++++
trunk/boost/icl/ptime.hpp | 19 +++++++++++++++++++
trunk/libs/icl/test/test_type_lists.hpp | 23 +++++++++++++++++++----
trunk/libs/icl/test/test_value_maker.hpp | 2 +-
5 files changed, 67 insertions(+), 5 deletions(-)
Modified: trunk/boost/icl/gregorian.hpp
==============================================================================
--- trunk/boost/icl/gregorian.hpp (original)
+++ trunk/boost/icl/gregorian.hpp 2010-12-19 10:21:32 EST (Sun, 19 Dec 2010)
@@ -88,6 +88,25 @@
}
// ------------------------------------------------------------------------
+ template<> struct is_discrete<boost::gregorian::date_duration>
+ {
+ typedef is_discrete type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<>
+ struct has_difference<boost::gregorian::date_duration>
+ {
+ typedef has_difference type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<>
+ struct size_type_of<boost::gregorian::date_duration>
+ {
+ typedef boost::gregorian::date_duration type;
+ };
+
boost::gregorian::date_duration operator ++(boost::gregorian::date_duration& x)
{
return x += boost::gregorian::date::duration_type::unit();
Modified: trunk/boost/icl/interval_base_map.hpp
==============================================================================
--- trunk/boost/icl/interval_base_map.hpp (original)
+++ trunk/boost/icl/interval_base_map.hpp 2010-12-19 10:21:32 EST (Sun, 19 Dec 2010)
@@ -677,6 +677,11 @@
{ icl::clear(object); }
};
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127) // conditional expression is constant
+#endif
+
template<class Type>
struct on_total_absorbable<Type, true, false>
{
@@ -694,6 +699,10 @@
}
};
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
template<class Type, bool absorbs_identities>
struct on_total_absorbable<Type, false, absorbs_identities>
{
Modified: trunk/boost/icl/ptime.hpp
==============================================================================
--- trunk/boost/icl/ptime.hpp (original)
+++ trunk/boost/icl/ptime.hpp 2010-12-19 10:21:32 EST (Sun, 19 Dec 2010)
@@ -87,6 +87,25 @@
}
// ------------------------------------------------------------------------
+ template<> struct is_discrete<boost::posix_time::time_duration>
+ {
+ typedef is_discrete type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<>
+ struct has_difference<boost::posix_time::time_duration>
+ {
+ typedef has_difference type;
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<>
+ struct size_type_of<boost::posix_time::time_duration>
+ {
+ typedef boost::posix_time::time_duration type;
+ };
+
boost::posix_time::time_duration operator ++(boost::posix_time::time_duration& x)
{
return x += boost::posix_time::ptime::time_duration_type::unit();
Modified: trunk/libs/icl/test/test_type_lists.hpp
==============================================================================
--- trunk/libs/icl/test/test_type_lists.hpp (original)
+++ trunk/libs/icl/test/test_type_lists.hpp 2010-12-19 10:21:32 EST (Sun, 19 Dec 2010)
@@ -17,8 +17,14 @@
#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::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<
@@ -27,7 +33,9 @@
,float, double, long double
,boost::rational<int>
,boost_posix_time_ptime
-// ,boost::gregorian::date
+ ,boost_posix_time_duration
+ ,boost_gregorian_date
+ ,boost_gregorian_date_duration
,int*
> bicremental_types;
@@ -84,7 +92,11 @@
,unsigned long, unsigned long long
,short, int, long
,boost_posix_time_ptime
-// ,boost::gregorian::date
+ ,boost_posix_time_ptime
+ ,boost_posix_time_duration
+ ,boost_gregorian_date
+ ,boost_gregorian_date_duration
+ ,int*
> discrete_types;
typedef int discrete_type_1;
@@ -130,7 +142,10 @@
,boost::rational<int>
,std::string
,boost_posix_time_ptime
-// ,boost::gregorian::date
+ ,boost_posix_time_duration
+ ,boost_gregorian_date
+ ,boost_gregorian_date_duration
+ ,int*
> ordered_types;
typedef int ordered_type_1;
Modified: trunk/libs/icl/test/test_value_maker.hpp
==============================================================================
--- trunk/libs/icl/test/test_value_maker.hpp (original)
+++ trunk/libs/icl/test/test_value_maker.hpp 2010-12-19 10:21:32 EST (Sun, 19 Dec 2010)
@@ -75,7 +75,7 @@
{
static const int offset = size/2;
for(int idx = 0; idx < size; idx++)
- values[idx] = test_value<Type>::make(idx - offset);
+ values[idx] = test_value<Type>::make(idx - offset);
return true;
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk