Subject: [Boost-bugs] [Boost C++ Libraries] #10154: Compilation error in gregorian_calendar.ipp: is_leap_year
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-06-26 15:53:54
#10154: Compilation error in gregorian_calendar.ipp: is_leap_year
------------------------------+------------------------
Reporter: anonymous | Owner: az_sw_dude
Type: Bugs | Status: new
Milestone: To Be Determined | Component: date_time
Version: Boost 1.55.0 | Severity: Problem
Keywords: |
------------------------------+------------------------
Using visual studio 2013, I get the following compilation error:
1>C:\Libs\CLibs\boost_1.55.0\include\boost/date_time/gregorian_calendar.ipp(167):
error C2675: unary '!' : 'boost::type' does not define this operator or a
conversion to a type acceptable to the predefined operator
1>
C:\Libs\CLibs\boost_1.55.0\include\boost/date_time/gregorian_calendar.ipp(165)
: while compiling class template member function 'bool
boost::date_time::gregorian_calendar_base<boost::gregorian::greg_year_month_day,unsigned
int>::is_leap_year(boost::gregorian::greg_year)'
1>
C:\Libs\CLibs\boost_1.55.0\include\boost/date_time/gregorian_calendar.ipp(51)
: see reference to function template instantiation 'bool
boost::date_time::gregorian_calendar_base<boost::gregorian::greg_year_month_day,unsigned
int>::is_leap_year(boost::gregorian::greg_year)' being compiled
1>
C:\Libs\CLibs\boost_1.55.0\include\boost/date_time/gregorian_calendar.ipp(22)
: while compiling class template member function 'unsigned short
boost::date_time::gregorian_calendar_base<boost::gregorian::greg_year_month_day,unsigned
int>::day_of_week(const
boost::date_time::year_month_day_base<boost::gregorian::greg_year,boost::gregorian::greg_month,boost::gregorian::greg_day>
&)'
1>
C:\Libs\CLibs\boost_1.55.0\include\boost/date_time/date.hpp(95) : see
reference to function template instantiation 'unsigned short
boost::date_time::gregorian_calendar_base<boost::gregorian::greg_year_month_day,unsigned
int>::day_of_week(const
boost::date_time::year_month_day_base<boost::gregorian::greg_year,boost::gregorian::greg_month,boost::gregorian::greg_day>
&)' being compiled
1>
C:\Libs\CLibs\boost_1.55.0\include\boost/date_time/gregorian/greg_calendar.hpp(27)
: see reference to class template instantiation
'boost::date_time::gregorian_calendar_base<boost::gregorian::greg_year_month_day,unsigned
int>' being compiled
---
Include tree:
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/thread.hpp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/thread/thread.hpp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/thread/thread_only.hpp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/thread/win32/thread_data.hpp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/thread/thread_time.hpp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/date_time/posix_time/posix_tim
e_types.hpp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/date_time/posix_time/ptime.hpp
"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/date_time/posix_time/posix_tim
e_system.hpp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/date_time/posix_time/posix_ti
me_config.hpp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/date_time/gregorian/gregorian
_types.hpp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/date_time/gregorian/greg_cale
ndar.hpp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/date_time/gregorian_calendar.h
pp"
"C:\\Libs\\CLibs\\boost_1.55.0\\include\\boost/date_time/gregorian_calendar.i
pp"
---
Changing the line 167 to:
return (!((unsigned short)year % 4)) && (((unsigned short)year % 100)
|| (!((unsigned short)year % 400)));
... fixes the problem.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10154> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC