Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
veelion committed Aug 18, 2022
1 parent 3576cb4 commit c3a17b1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions runtime/core/utils/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ class JSON {
Class Type = Class::Null;
};

JSON Array() { return std::move(JSON::Make(JSON::Class::Array)); }
// fix: https://github.com/nbsdx/SimpleJSON/issues/4 (veelion)
inline JSON Array() { return std::move(JSON::Make(JSON::Class::Array)); }

template <typename... T>
JSON Array(T... args) {
Expand All @@ -497,9 +498,9 @@ JSON Array(T... args) {
return std::move(arr);
}

JSON Object() { return std::move(JSON::Make(JSON::Class::Object)); }
inline JSON Object() { return std::move(JSON::Make(JSON::Class::Object)); }

std::ostream& operator<<(std::ostream& os, const JSON& json) {
inline std::ostream& operator<<(std::ostream& os, const JSON& json) {
os << json.dump();
return os;
}
Expand Down Expand Up @@ -744,7 +745,7 @@ JSON parse_next(const string& str, size_t& offset) { // NOLINT
}
} // namespace

JSON JSON::Load(const string& str) {
inline JSON JSON::Load(const string& str) {
size_t offset = 0;
return std::move(parse_next(str, offset));
}
Expand Down

0 comments on commit c3a17b1

Please sign in to comment.