| 2910 | not std::is_same<ArithmeticType, typename BasicJsonType::boolean_t>::value, |
| 2911 | int> = 0> |
| 2912 | void 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 | |
| 2937 | template<typename BasicJsonType> |
| 2938 | void from_json(const BasicJsonType& j, typename BasicJsonType::boolean_t& b) |