MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / get_arithmetic_value

Function get_arithmetic_value

include/nlohmann/json.hpp:4857–4887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4855 !std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value,
4856 int > = 0 >
4857void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
4858{
4859 switch (static_cast<value_t>(j))
4860 {
4861 case value_t::number_unsigned:
4862 {
4863 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>());
4864 break;
4865 }
4866 case value_t::number_integer:
4867 {
4868 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>());
4869 break;
4870 }
4871 case value_t::number_float:
4872 {
4873 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>());
4874 break;
4875 }
4876
4877 case value_t::null:
4878 case value_t::object:
4879 case value_t::array:
4880 case value_t::string:
4881 case value_t::boolean:
4882 case value_t::binary:
4883 case value_t::discarded:
4884 default:
4885 JSON_THROW(type_error::create(302, concat("type must be number, but is ", j.type_name()), &j));
4886 }
4887}
4888
4889template<typename BasicJsonType>
4890inline void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b)

Callers 1

from_jsonFunction · 0.85

Calls 2

createFunction · 0.85
concatFunction · 0.70

Tested by

no test coverage detected