diff options
Diffstat (limited to 'boost/date_time/time_system_split.hpp')
-rw-r--r-- | boost/date_time/time_system_split.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/boost/date_time/time_system_split.hpp b/boost/date_time/time_system_split.hpp index cf5931a4f2..8e1efbe4ca 100644 --- a/boost/date_time/time_system_split.hpp +++ b/boost/date_time/time_system_split.hpp @@ -11,6 +11,7 @@ #include <string> +#include <boost/config.hpp> #include "boost/date_time/compiler_config.hpp" #include "boost/date_time/special_defs.hpp" @@ -193,10 +194,15 @@ namespace date_time { const time_rep_type& rhs) { date_duration_type dd = lhs.day - rhs.day; - time_duration_type td(dd.days()*24,0,0); //days * 24 hours - time_duration_type td2 = lhs.time_of_day - rhs.time_of_day; - return td+td2; - // return time_rep_type(base.day-dd, base.time_of_day); + if (BOOST_LIKELY(!dd.is_special())) { + time_duration_type td(dd.days()*24,0,0); // days * 24 hours + time_duration_type td2 = lhs.time_of_day - rhs.time_of_day; + return td+td2; + } else { + time_duration_type td(dd.as_special()); + time_duration_type td2 = lhs.time_of_day - rhs.time_of_day; + return td+td2; + } } }; |