This repository was archived by the owner on Mar 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -37,11 +37,20 @@ using std::make_shared;
37
37
using std::initializer_list;
38
38
using std::move;
39
39
40
+ /* Helper for representing null - just a do-nothing struct, plus comparison
41
+ * operators so the helpers in JsonValue work. We can't use nullptr_t because
42
+ * it may not be orderable.
43
+ */
44
+ struct NullStruct {
45
+ bool operator ==(NullStruct) const { return true ; }
46
+ bool operator <(NullStruct) const { return false ; }
47
+ };
48
+
40
49
/* * * * * * * * * * * * * * * * * * * *
41
50
* Serialization
42
51
*/
43
52
44
- static void dump (std:: nullptr_t , string &out) {
53
+ static void dump (NullStruct , string &out) {
45
54
out += " null" ;
46
55
}
47
56
@@ -208,9 +217,9 @@ class JsonObject final : public Value<Json::OBJECT, Json::object> {
208
217
explicit JsonObject (Json::object &&value) : Value(move(value)) {}
209
218
};
210
219
211
- class JsonNull final : public Value<Json::NUL, std:: nullptr_t > {
220
+ class JsonNull final : public Value<Json::NUL, NullStruct > {
212
221
public:
213
- JsonNull () : Value(nullptr ) {}
222
+ JsonNull () : Value({} ) {}
214
223
};
215
224
216
225
/* * * * * * * * * * * * * * * * * * * *
You can’t perform that action at this time.
0 commit comments