Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation on Alpine Linux micro-distro #32

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading