Opened 9 years ago

Closed 9 years ago

#8739 closed Bugs (fixed)

Compile error in bool boost::local_time::custom_time_zone_base<CharT>::has_dst() const with C++11 mode enabled

Reported by: gawain.bolton@… Owned by: Marshall Clow
Milestone: Boost 1.55.0 Component: date_time
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc: gawain.bolton@…

Description

With C++11 mode enabled (the "-std=c++0x" compiler option) using GCC v4.6.2 and boost v1.53 there is a compile error due to the fact that boost::shared_ptr<>'s bool conversion operator is now "explicit".

/export/usr/local/domdev/gbolton/local_repo/wiz/local/boost/1.53.0/include/boost/date_time/local_time/custom_time_zone.hpp: In member function 'bool boost::local_time::custom_time_zone_base<CharT>::has_dst() const [with CharT = char]': ../src/DateTime.cpp:636:1: instantiated from here /export/usr/local/domdev/gbolton/local_repo/wiz/local/boost/1.53.0/include/boost/date_time/local_time/custom_time_zone.hpp:67:30: error: cannot convert 'const boost::shared_ptr<boost::date_time::dst_day_calc_rule<boost::gregorian::date> >' to 'bool' in return

The fix is trivial and so I won't insult anyone's intelligence by providing it here!

Thanks for providing such useful and good quality libraries,

Gawain Bolton

Change History (5)

comment:1 by anonymous, 9 years ago

Summary: Compiler error in bool boost::local_time::custom_time_zone_base<CharT>::has_dst() const with C++11 mode enabledCompile error in bool boost::local_time::custom_time_zone_base<CharT>::has_dst() const with C++11 mode enabled

comment:2 by Marshall Clow, 9 years ago

Owner: changed from az_sw_dude to Marshall Clow
Version: Boost 1.53.0Boost 1.55.0

This was fixed on trunk in [84626], but apparently not merged to the release branch.

comment:3 by Marshall Clow, 9 years ago

Milestone: To Be DeterminedBoost 1.55.0
Status: newassigned
Version: Boost 1.55.0Boost 1.53.0

in reply to:  3 comment:4 by anonymous, 9 years ago

Replying to marshall: Yes I did look at the boost v1.54 release candidate to see if this problem was fixed as well as search for tickets but I did not check was what on trunk.

Given the trivial nature of the fix, and given that it is a blocking problem for anyone wishing to use a C++11 compatible compiler, I would have hoped this fix could be put in boost v1.54...

comment:5 by Marshall Clow, 9 years ago

Resolution: fixed
Status: assignedclosed

Merged to release in [85045]

Note: See TracTickets for help on using tickets.