Lines 1-37
Link Here
|
1 |
--- ext/json11/json11.cpp.orig 2017-01-18 18:06:37 UTC |
|
|
2 |
+++ ext/json11/json11.cpp |
3 |
@@ -37,11 +37,21 @@ 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 |
+ |
12 |
+struct NullStruct { |
13 |
+ bool operator==(NullStruct) const { return true; } |
14 |
+ bool operator<(NullStruct) const { return false; } |
15 |
+}; |
16 |
+ |
17 |
/* * * * * * * * * * * * * * * * * * * * |
18 |
* Serialization |
19 |
*/ |
20 |
|
21 |
-static void dump(std::nullptr_t, string &out) { |
22 |
+static void dump(NullStruct, string &out) { |
23 |
out += "null"; |
24 |
} |
25 |
|
26 |
@@ -204,9 +214,9 @@ public: |
27 |
explicit JsonObject(Json::object &&value) : Value(move(value)) {} |
28 |
}; |
29 |
|
30 |
-class JsonNull final : public Value<Json::NUL, std::nullptr_t> { |
31 |
+class JsonNull final : public Value<Json::NUL, NullStruct> { |
32 |
public: |
33 |
- JsonNull() : Value(nullptr) {} |
34 |
+ JsonNull() : Value({}) {} |
35 |
}; |
36 |
|
37 |
/* * * * * * * * * * * * * * * * * * * * |