Added a static method which create an empty json value crow::json::wvalue (outputs "{}" instead of a "null" string) (#602)

This commit is contained in:
Gabriel Schlozer 2023-03-30 14:09:36 +02:00 committed by GitHub
parent eef1abe415
commit 215834f8f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1299,6 +1299,9 @@ namespace crow
type t() const { return t_; }
/// Create an empty json value (outputs "{}" instead of a "null" string)
static crow::json::wvalue empty_object() { return crow::json::wvalue(std::move(crow::json::wvalue::object())); }
private:
type t_{type::Null}; ///< The type of the value.
num_type nt{num_type::Null}; ///< The specific type of the number if \ref t_ is a number.