123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- #ifndef DATE_DURATION_OPERATORS_HPP___
- #define DATE_DURATION_OPERATORS_HPP___
- #include "boost/date_time/gregorian/greg_duration_types.hpp"
- #include "boost/date_time/posix_time/ptime.hpp"
- namespace boost {
- namespace posix_time {
-
-
-
-
- inline BOOST_CXX14_CONSTEXPR
- ptime
- operator+(const ptime& t, const boost::gregorian::months& m)
- {
- return t + m.get_offset(t.date());
- }
-
-
- inline BOOST_CXX14_CONSTEXPR
- ptime
- operator+=(ptime& t, const boost::gregorian::months& m)
- {
-
- return t += m.get_offset(t.date());
- }
-
- inline BOOST_CXX14_CONSTEXPR
- ptime
- operator-(const ptime& t, const boost::gregorian::months& m)
- {
-
- return t + m.get_neg_offset(t.date());
- }
-
-
- inline BOOST_CXX14_CONSTEXPR
- ptime
- operator-=(ptime& t, const boost::gregorian::months& m)
- {
- return t += m.get_neg_offset(t.date());
- }
-
-
-
- inline BOOST_CXX14_CONSTEXPR
- ptime
- operator+(const ptime& t, const boost::gregorian::years& y)
- {
- return t + y.get_offset(t.date());
- }
-
- inline BOOST_CXX14_CONSTEXPR
- ptime
- operator+=(ptime& t, const boost::gregorian::years& y)
- {
- return t += y.get_offset(t.date());
- }
-
- inline BOOST_CXX14_CONSTEXPR
- ptime
- operator-(const ptime& t, const boost::gregorian::years& y)
- {
-
- return t + y.get_neg_offset(t.date());
- }
-
- inline BOOST_CXX14_CONSTEXPR
- ptime
- operator-=(ptime& t, const boost::gregorian::years& y)
- {
-
- return t += y.get_neg_offset(t.date());
- }
- }}
- #endif
|