File indexing completed on 2025-01-18 09:38:21
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_ICL_GREGORIAN_DATE_HPP_JOFA_080416
0009 #define BOOST_ICL_GREGORIAN_DATE_HPP_JOFA_080416
0010
0011 #include <boost/icl/detail/boost_config.hpp>
0012 #include <boost/detail/workaround.hpp>
0013
0014 #ifdef BOOST_MSVC
0015 #pragma warning(push)
0016 #pragma warning(disable:4100)
0017 #pragma warning(disable:4127)
0018 #pragma warning(disable:4244)
0019 #pragma warning(disable:4702)
0020 #pragma warning(disable:4996)
0021 #endif
0022
0023 #include <stdio.h>
0024 #include <string>
0025 #include <sstream>
0026 #include <iostream>
0027 #include <boost/date_time/gregorian/gregorian.hpp>
0028
0029 #ifdef BOOST_MSVC
0030 #pragma warning(pop)
0031 #endif
0032
0033 #include <boost/icl/type_traits/identity_element.hpp>
0034 #include <boost/icl/type_traits/is_discrete.hpp>
0035 #include <boost/icl/type_traits/difference_type_of.hpp>
0036 #include <boost/icl/type_traits/size_type_of.hpp>
0037
0038 namespace boost{namespace icl
0039 {
0040 template<> struct is_discrete<boost::gregorian::date>
0041 {
0042 typedef is_discrete type;
0043 BOOST_STATIC_CONSTANT(bool, value = true);
0044 };
0045
0046 template<>
0047 inline boost::gregorian::date identity_element<boost::gregorian::date>::value()
0048 {
0049 return boost::gregorian::date(boost::gregorian::min_date_time);
0050 }
0051
0052 template<>
0053 struct identity_element<boost::gregorian::date_duration>
0054 {
0055 static boost::gregorian::date_duration value()
0056 {
0057 return boost::gregorian::date(boost::gregorian::min_date_time)
0058 - boost::gregorian::date(boost::gregorian::min_date_time);
0059 }
0060 };
0061
0062 template<>
0063 struct has_difference<boost::gregorian::date>
0064 {
0065 typedef has_difference type;
0066 BOOST_STATIC_CONSTANT(bool, value = true);
0067 };
0068
0069 template<>
0070 struct difference_type_of<boost::gregorian::date>
0071 { typedef boost::gregorian::date_duration type; };
0072
0073 template<>
0074 struct size_type_of<boost::gregorian::date>
0075 { typedef boost::gregorian::date_duration type; };
0076
0077
0078
0079
0080 inline boost::gregorian::date operator ++(boost::gregorian::date& x)
0081 {
0082 return x += boost::gregorian::date::duration_type::unit();
0083 }
0084
0085 inline boost::gregorian::date operator --(boost::gregorian::date& x)
0086 {
0087 return x -= boost::gregorian::date::duration_type::unit();
0088 }
0089
0090
0091 template<> struct is_discrete<boost::gregorian::date_duration>
0092 {
0093 typedef is_discrete type;
0094 BOOST_STATIC_CONSTANT(bool, value = true);
0095 };
0096
0097 template<>
0098 struct has_difference<boost::gregorian::date_duration>
0099 {
0100 typedef has_difference type;
0101 BOOST_STATIC_CONSTANT(bool, value = true);
0102 };
0103
0104 template<>
0105 struct size_type_of<boost::gregorian::date_duration>
0106 {
0107 typedef boost::gregorian::date_duration type;
0108 };
0109
0110 inline boost::gregorian::date_duration operator ++(boost::gregorian::date_duration& x)
0111 {
0112 return x += boost::gregorian::date::duration_type::unit();
0113 }
0114
0115 inline boost::gregorian::date_duration operator --(boost::gregorian::date_duration& x)
0116 {
0117 return x -= boost::gregorian::date::duration_type::unit();
0118 }
0119
0120
0121
0122
0123 }}
0124
0125 #endif
0126
0127