MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / get_arithmetic_value

Function get_arithmetic_value

native/thirdpart/json/json.hpp:2912–2935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2910 not std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value,
2911 int> = 0>
2912void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
2913{
2914 switch (static_cast<value_t>(j))
2915 {
2916 case value_t::number_unsigned:
2917 {
2918 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>());
2919 break;
2920 }
2921 case value_t::number_integer:
2922 {
2923 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>());
2924 break;
2925 }
2926 case value_t::number_float:
2927 {
2928 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
2929 break;
2930 }
2931
2932 default:
2933 JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name())));
2934 }
2935}
2936
2937template<typename BasicJsonType>
2938void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b)

Callers 1

from_jsonFunction · 0.85

Calls 1

createFunction · 0.85

Tested by

no test coverage detected