From 12019cec8155dda9d5957b0713415d3a54672b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Krys?= Date: Mon, 4 Dec 2023 11:03:58 +0100 Subject: [PATCH] Fix compilation on Alpine Linux micro-distro Replace nullptr_t with std::nullptr_t --- src/JSON.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/JSON.hh b/src/JSON.hh index 927f06f..0039cb4 100644 --- a/src/JSON.hh +++ b/src/JSON.hh @@ -23,7 +23,7 @@ private: template inline static constexpr bool is_non_null_trivial_primitive_v = std::is_integral_v || std::is_floating_point_v || std::is_same_v; template - inline static constexpr bool is_primitive_v = std::is_same_v || std::is_integral_v || std::is_floating_point_v || std::is_same_v || std::is_same_v; + inline static constexpr bool is_primitive_v = std::is_same_v || std::is_integral_v || std::is_floating_point_v || std::is_same_v || std::is_same_v; template inline static constexpr bool is_non_null_primitive_v = std::is_integral_v || std::is_floating_point_v || std::is_same_v || std::is_same_v; @@ -83,7 +83,7 @@ public: // Primitive type constructors JSON(); // null - JSON(nullptr_t); + JSON(std::nullptr_t); JSON(bool x); JSON(const char* x); JSON(const char* x, size_t size); @@ -159,7 +159,7 @@ public: // Comparison operators std::partial_ordering operator<=>(const JSON& other) const; - std::partial_ordering operator<=>(nullptr_t) const; // Same as is_null() + std::partial_ordering operator<=>(std::nullptr_t) const; // Same as is_null() std::partial_ordering operator<=>(bool v) const; std::partial_ordering operator<=>(const char* v) const; std::partial_ordering operator<=>(const std::string& v) const; @@ -364,7 +364,7 @@ public: // Type inspectors inline bool is_null() const { - return holds_alternative(this->value); + return holds_alternative(this->value); } inline bool is_bool() const { return holds_alternative(this->value); @@ -454,7 +454,7 @@ private: JSON(dict_type&& x); std::variant< - nullptr_t, // We use this type for JSON null + std::nullptr_t, // We use this type for JSON null bool, int64_t, // This is convertible to double implicitly in as_float() double, // This is convertible to int implicitly in as_int()