Skip to content

Commit

Permalink
Provide a helper for creating JSON arrays with {}.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurik committed Jul 24, 2023
1 parent 7dbfe42 commit 266c894
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions p2p/source/notation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ inline Any One(const Array &value) {
return value[0];
}

template <typename Type_>
Array Arr(const std::vector<Type_> &values) {
Array array;
for (const auto &value : values)
array.emplace_back(value);
return array;
}

}

#endif//ORCHID_NOTATION_HPP

0 comments on commit 266c894

Please sign in to comment.