Line 0
Link Here
|
|
|
1 |
--- ext/json11/json11.cpp.orig 2017-01-18 02:13:48 UTC |
2 |
+++ ext/json11/json11.cpp |
3 |
@@ -37,11 +37,20 @@ using std::make_shared; |
4 |
using std::initializer_list; |
5 |
using std::move; |
6 |
|
7 |
+/* Helper for representing null - just a do-nothing struct, plus comparison |
8 |
+ * operators so the helpers in JsonValue work. We can't use nullptr_t because |
9 |
+ * it may not be orderable. |
10 |
+*/ |
11 |
+struct NullStruct { |
12 |
+ bool operator==(NullStruct) const { return true; } |
13 |
+ bool operator<(NullStruct) const { return false; } |
14 |
+}; |
15 |
+ |
16 |
/* * * * * * * * * * * * * * * * * * * * |
17 |
* Serialization |
18 |
*/ |
19 |
|
20 |
-static void dump(std::nullptr_t, string &out) { |
21 |
+static void dump(NullStruct, string &out) { |
22 |
out += "null"; |
23 |
} |
24 |
|
25 |
@@ -204,9 +213,9 @@ public: |
26 |
explicit JsonObject(Json::object &&value) : Value(move(value)) {} |
27 |
}; |
28 |
|
29 |
-class JsonNull final : public Value<Json::NUL, std::nullptr_t> { |
30 |
+class JsonNull final : public Value<Json::NUL, NullStruct> { |
31 |
public: |
32 |
- JsonNull() : Value(nullptr) {} |
33 |
+ JsonNull() : Value({}) {} |
34 |
}; |
35 |
|
36 |
/* * * * * * * * * * * * * * * * * * * * |