replace boost optional with mapbox optional

This commit is contained in:
Konstantin Käfer
2014-10-22 16:29:10 +02:00
parent 2422e938ac
commit 7d6feffd56
5 changed files with 85 additions and 35 deletions

View File

@@ -3,8 +3,7 @@
#include <mbgl/platform/log.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <boost/optional.hpp>
#include <mbgl/util/optional.hpp>
#include <vector>
#include <cstdarg>
@@ -17,11 +16,11 @@ public:
inline LogMessage(EventSeverity severity, Event event, int64_t code, const std::string &msg)
: severity(severity), event(event), code(code), msg(msg) {}
inline LogMessage(EventSeverity severity, Event event, int64_t code)
: severity(severity), event(event), code(code) {}
: severity(severity), event(event), code(code), msg() {}
inline LogMessage(EventSeverity severity, Event event, const std::string &msg)
: severity(severity), event(event), msg(msg) {}
: severity(severity), event(event), code(), msg(msg) {}
inline LogMessage(EventSeverity severity, Event event)
: severity(severity), event(event) {}
: severity(severity), event(event), code(), msg() {}
inline bool operator==(const LogMessage &rhs) const {
return (!severity || !rhs.severity || severity.get() == rhs.severity.get()) &&
@@ -30,10 +29,10 @@ public:
(!msg || !rhs.msg || msg.get() == rhs.msg.get());
}
const boost::optional<EventSeverity> severity;
const boost::optional<Event> event;
const boost::optional<int64_t> code;
const boost::optional<std::string> msg;
const mapbox::util::optional<EventSeverity> severity;
const mapbox::util::optional<Event> event;
const mapbox::util::optional<int64_t> code;
const mapbox::util::optional<std::string> msg;
mutable bool checked = false;
};

View File

@@ -4,13 +4,6 @@
#include <mbgl/style/value.hpp>
#include <mbgl/style/value_comparison.hpp>
#pragma GCC diagnostic push
#ifndef __clang__
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#endif
#include <boost/lexical_cast.hpp>
#pragma GCC diagnostic pop
using namespace mbgl;
TEST(Variant, toString) {