| 3505 | !std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value, |
| 3506 | int > = 0 > |
| 3507 | void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val) |
| 3508 | { |
| 3509 | switch (static_cast<value_t>(j)) |
| 3510 | { |
| 3511 | case value_t::number_unsigned: |
| 3512 | { |
| 3513 | val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t*>()); |
| 3514 | break; |
| 3515 | } |
| 3516 | case value_t::number_integer: |
| 3517 | { |
| 3518 | val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t*>()); |
| 3519 | break; |
| 3520 | } |
| 3521 | case value_t::number_float: |
| 3522 | { |
| 3523 | val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t*>()); |
| 3524 | break; |
| 3525 | } |
| 3526 | |
| 3527 | default: |
| 3528 | JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()))); |
| 3529 | } |
| 3530 | } |
| 3531 | |
| 3532 | template<typename BasicJsonType> |
| 3533 | void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) |