
#include <boost/date_time/local_time/local_time.hpp> class bar{public:bar() { tz_db_.load_from_file("/home/date_time_zonespec.csv"); }private: boost::local_time::tz_database tz_db_;};int main(){ return 0;} 使用-std = c 0x我收到以下错误.
In file included from /usr/local/include/boost/date_time/local_time/local_time_types.hpp:18:0,from /usr/local/include/boost/date_time/local_time/local_time.hpp:13,from test.h:4,from test.cpp:1: /usr/local/include/boost/date_time/local_time/custom_time_zone.hpp: In instantiation of ‘bool boost::local_time::custom_time_zone_base<CharT>::has_dst() const [with CharT = char]’: test.cpp:11:1: required from here /usr/local/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
如果我不使用c 0x选项,一切都很好.
谁能告诉我这里发生了什么?
virtual bool has_dst() const{ return (dst_calc_rules_); //if calc_rule is set the tz has dst} 其中dst_calc_rules_是shared_ptr.
直到Boost的某个人开始修复它,你可以做两件事:
>破解该函数返回bool(dst_calc_rules_);>定义BOOST_NO_CXX11_EXPliCIT_CONVERSION_OPERATORS以允许隐式转换.
总结以上是内存溢出为你收集整理的使用-std = c 0x增加1.53本地日期时间编译器错误全部内容,希望文章能够帮你解决使用-std = c 0x增加1.53本地日期时间编译器错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)