Skip to content

Commit 215834f

Browse files
authored
Added a static method which create an empty json value crow::json::wvalue (outputs "{}" instead of a "null" string) (#602)
1 parent eef1abe commit 215834f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/crow/json.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,9 @@ namespace crow
12991299

13001300
type t() const { return t_; }
13011301

1302+
/// Create an empty json value (outputs "{}" instead of a "null" string)
1303+
static crow::json::wvalue empty_object() { return crow::json::wvalue(std::move(crow::json::wvalue::object())); }
1304+
13021305
private:
13031306
type t_{type::Null}; ///< The type of the value.
13041307
num_type nt{num_type::Null}; ///< The specific type of the number if \ref t_ is a number.

0 commit comments

Comments
 (0)