Skip to content

Commit

Permalink
Improve Json::get() slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
lethosor committed Nov 27, 2015
1 parent 55c4c8f commit 8055644
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion depends/jsoncpp/jsoncpp-ex.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Json {
template<> inline bool is<type> (const Json::Value &val) { return val.is_func(); } \
template<> inline type as<type> (const Json::Value &val) { return val.as_func(); } \
template<> inline type get<type> (const Json::Value &val, const std::string &key, const type &default_) \
{ Json::Value x = val[key]; return is<type>(x) ? as<type>(x) : default_; }
{ const Json::Value &x = val[key]; return is<type>(x) ? as<type>(x) : default_; }
define_helpers(bool, isBool, asBool);
define_helpers(Json::Int, isInt, asInt);
define_helpers(Json::UInt, isUInt, asUInt);
Expand Down

0 comments on commit 8055644

Please sign in to comment.