From 2ac5d968524e5c7b55e579a100d74bc01b23b616 Mon Sep 17 00:00:00 2001 From: Richard Clamp Date: Wed, 26 Nov 2014 13:50:51 +0000 Subject: [PATCH] Fix compatibility with boost 1.56+ In boost 1.56 the optional library is no longer happy with the implicit conversion from boost::optional to bool, so we get the following errors: valijson/include/valijson/schema.hpp:177:16: error: no viable conversion from 'const boost::optional' to 'bool' return id; ^~ valijson/include/valijson/schema.hpp:188:16: error: no viable conversion from 'const boost::optional' to 'bool' return title; ^~~~~ 2 errors generated. Here we explicitly test against boost::none instead. --- include/valijson/schema.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/valijson/schema.hpp b/include/valijson/schema.hpp index fc4a7b9..47a13c8 100644 --- a/include/valijson/schema.hpp +++ b/include/valijson/schema.hpp @@ -174,7 +174,7 @@ public: */ bool hasId() const { - return id; + return id != boost::none; } /** @@ -185,7 +185,7 @@ public: */ bool hasTitle() const { - return title; + return title != boost::none; } std::string resolveUri(const std::string &relative) const