Commit b39a7094 authored by Matthias Wittgen's avatar Matthias Wittgen
Browse files

Merge branch 'dantrim' into 'master'

Change is_bool method to is_boolean to match nlohmann::json

See merge request !2
parents 749e5b58 bc1a3925
......@@ -429,7 +429,7 @@ namespace msgpack {
if(v.is_object()) writeObject(*std::get<typename V::ObjPtr>(v.value));
else if(v.is_array()) writeArray(*std::get<typename V::ArrayPtr>(v.value));
else if(v.is_string()) writeStr(*std::get<typename V::StrPtr>(v.value));
else if(v.is_bool()) writeBool(v);
else if(v.is_boolean()) writeBool(v);
else if(v.is_null()) writeNull();
else switch(v.index()) {
case V::Type::uint64:
......
......@@ -500,7 +500,7 @@ template<typename T,
if (index() == Type::uint32) return std::get<uint32_t>(value);
if (index() == Type::uint16) return std::get<uint16_t>(value);
if (index() == Type::uint8) return std::get<uint8_t>(value);
if (is_bool()) return U64(std::get<bool>(value));
if (is_boolean()) return U64(std::get<bool>(value));
throw;
}
......@@ -511,7 +511,7 @@ template<typename T,
if (index() == Type::int32) return std::get<int32_t>(value);
if (index() == Type::int16) return std::get<int16_t>(value);
if (index() == Type::int8) return std::get<int8_t>(value);
if (is_bool()) return I64(std::get<bool>(value));
if (is_boolean()) return I64(std::get<bool>(value));
throw;
}
......@@ -521,7 +521,7 @@ template<typename T,
if (index() == Type::float32) return std::get<float>(value);
if (is_unsigned()) return getUint();
if (is_signed()) return getInt();
if (is_bool()) return DBL(std::get<bool>(value));
if (is_boolean()) return DBL(std::get<bool>(value));
throw;
}
......@@ -536,7 +536,7 @@ template<typename T,
bool is_unsigned() const { return index() >= Type::uint64 && index() <= Type::uint8; }
bool is_bool() const { return index() == Type::boolean; }
bool is_boolean() const { return index() == Type::boolean; }
bool is_array() const { return index() == Type::array; }
......@@ -581,7 +581,7 @@ template<typename T,
bool result = false;
using DT=typename std::decay<T>::type;
if constexpr (std::is_same<DT, bool>::value) {
if (is_bool()) {
if (is_boolean()) {
bool lhs = std::get<bool>(value);
result = (lhs == rhs);
}
......@@ -609,7 +609,7 @@ template<typename T,
bool result = false;
using DT=typename std::decay<T>::type;
if constexpr (std::is_same<DT, bool>::value) {
if (is_bool()) {
if (is_boolean()) {
bool lhs = std::get<bool>(value);
result = (lhs != rhs);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment