Commit 91aee105 by 易思龙

support enum

construct enum type to basic_json (proxy by int type) ``` enum { t = 0 }; json j = json::array(); j.push_back(t); j.push_back(json::object({ {"game_type", t} })); ```
parent 9f9d293b
...@@ -417,6 +417,11 @@ class basic_json ...@@ -417,6 +417,11 @@ class basic_json
inline basic_json(const number_integer_t& value) inline basic_json(const number_integer_t& value)
: m_type(value_t::number_integer), m_value(value) : m_type(value_t::number_integer), m_value(value)
{} {}
/// create an int number to support enum type (implicit)
inline basic_json(int int_enum)
: m_type(value_t::number_integer), m_value((NumberIntegerType)int_enum)
{}
/// create an integer number (implicit) /// create an integer number (implicit)
template<typename T, typename template<typename T, typename
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment