From a78e7358ecda264175e7bc00bb5e87b9348600a8 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 17 May 2015 17:50:45 -0500 Subject: Revert "boost::none_t no longer convertible from literal 0 in 1.58" This reverts commit 48aec0f093ff6494a3e4f7cd5166cb4a27c16814. --- src/account.h | 6 +++++- src/item.h | 6 +++++- src/parser.h | 2 +- src/post.h | 6 +++++- src/times.h | 6 +++++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/account.h b/src/account.h index 8d0fb1db..7fae93e1 100644 --- a/src/account.h +++ b/src/account.h @@ -261,7 +261,11 @@ public: mutable optional xdata_; bool has_xdata() const { - return xdata_ != boost::none; +#if BOOST_VERSION >= 105600 + return xdata_ != NULL; +#else + return xdata_; +#endif } void clear_xdata(); xdata_t& xdata() { diff --git a/src/item.h b/src/item.h index 2c349bdc..ba812175 100644 --- a/src/item.h +++ b/src/item.h @@ -174,7 +174,11 @@ public: static bool use_aux_date; virtual bool has_date() const { - return _date != boost::none; +#if BOOST_VERSION >= 105600 + return _date != NULL; +#else + return _date; +#endif } virtual date_t date() const { diff --git a/src/parser.h b/src/parser.h index 25c4a7e3..e46fc719 100644 --- a/src/parser.h +++ b/src/parser.h @@ -118,7 +118,7 @@ public: ptr_op_t parse(std::istream& in, const parse_flags_t& flags = PARSE_DEFAULT, - const optional& original_string = boost::none); + const optional& original_string = NULL); }; } // namespace ledger diff --git a/src/post.h b/src/post.h index 3fa67e56..0fb45e90 100644 --- a/src/post.h +++ b/src/post.h @@ -205,7 +205,11 @@ public: mutable optional xdata_; bool has_xdata() const { - return xdata_ != boost::none; +#if BOOST_VERSION >= 105600 + return xdata_ != NULL; +#else + return xdata_; +#endif } void clear_xdata() { xdata_ = none; diff --git a/src/times.h b/src/times.h index cc980858..421d1462 100644 --- a/src/times.h +++ b/src/times.h @@ -500,7 +500,11 @@ public: void stabilize(const optional& date = none); bool is_valid() const { - return start != boost::none; +#if BOOST_VERSION >= 105600 + return start != NULL; +#else + return start; +#endif } /** Find the current or next period containing date. Returns false if -- cgit v1.2.3