forked from bblanchon/ArduinoJson
Added support for nullptr
(closes #998)
This commit is contained in:
@ -12,8 +12,10 @@
|
||||
|
||||
#if __cplusplus >= 201103L
|
||||
#define ARDUINOJSON_HAS_LONG_LONG 1
|
||||
#define ARDUINOJSON_HAS_NULLPTR 1
|
||||
#else
|
||||
#define ARDUINOJSON_HAS_LONG_LONG 0
|
||||
#define ARDUINOJSON_HAS_NULLPTR 0
|
||||
#endif
|
||||
|
||||
// Small or big machine?
|
||||
|
@ -88,6 +88,27 @@ struct Comparer<bool, void> {
|
||||
void visitNull() {}
|
||||
};
|
||||
|
||||
#if ARDUINOJSON_HAS_NULLPTR
|
||||
template <>
|
||||
struct Comparer<decltype(nullptr), void> {
|
||||
int result;
|
||||
|
||||
explicit Comparer(decltype(nullptr)) : result(1) {}
|
||||
|
||||
void visitArray(const CollectionData &) {}
|
||||
void visitObject(const CollectionData &) {}
|
||||
void visitFloat(Float) {}
|
||||
void visitString(const char *) {}
|
||||
void visitRawJson(const char *, size_t) {}
|
||||
void visitNegativeInteger(UInt) {}
|
||||
void visitPositiveInteger(UInt) {}
|
||||
void visitBoolean(bool) {}
|
||||
void visitNull() {
|
||||
result = 0;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename TVariant>
|
||||
class VariantComparisons {
|
||||
private:
|
||||
|
Reference in New Issue
Block a user