Skip to content

Commit

Permalink
Fix compilation on Alpine Linux micro-distro
Browse files Browse the repository at this point in the history
Replace nullptr_t with std::nullptr_t
  • Loading branch information
eleriaqueen authored and fuzziqersoftware committed Dec 4, 2023
1 parent 9bbec3b commit 8b90286
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/JSON.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private:
template <typename T>
inline static constexpr bool is_non_null_trivial_primitive_v = std::is_integral_v<T> || std::is_floating_point_v<T> || std::is_same_v<T, bool>;
template <typename T>
inline static constexpr bool is_primitive_v = std::is_same_v<T, nullptr_t> || std::is_integral_v<T> || std::is_floating_point_v<T> || std::is_same_v<T, bool> || std::is_same_v<T, std::string>;
inline static constexpr bool is_primitive_v = std::is_same_v<T, std::nullptr_t> || std::is_integral_v<T> || std::is_floating_point_v<T> || std::is_same_v<T, bool> || std::is_same_v<T, std::string>;
template <typename T>
inline static constexpr bool is_non_null_primitive_v = std::is_integral_v<T> || std::is_floating_point_v<T> || std::is_same_v<T, bool> || std::is_same_v<T, std::string>;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -364,7 +364,7 @@ public:

// Type inspectors
inline bool is_null() const {
return holds_alternative<nullptr_t>(this->value);
return holds_alternative<std::nullptr_t>(this->value);
}
inline bool is_bool() const {
return holds_alternative<bool>(this->value);
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 8b90286

Please sign in to comment.