TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ from_json() [3/19]

template<typename BasicJsonType , typename ArithmeticType , enable_if_t< std::is_arithmetic< ArithmeticType >::value &&!std::is_same< ArithmeticType, typename BasicJsonType::number_unsigned_t >::value &&!std::is_same< ArithmeticType, typename BasicJsonType::number_integer_t >::value &&!std::is_same< ArithmeticType, typename BasicJsonType::number_float_t >::value &&!std::is_same< ArithmeticType, typename BasicJsonType::boolean_t >::value, int > = 0>
void nlohmann::detail::from_json ( const BasicJsonType &  j,
ArithmeticType &  val 
)

Definition at line 4203 of file json.hpp.

4204{
4205 switch (static_cast<value_t>(j))
4206 {
4207 case value_t::number_unsigned:
4208 {
4209 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t *>());
4210 break;
4211 }
4212
4213 case value_t::number_integer:
4214 {
4215 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t *>());
4216 break;
4217 }
4218
4219 case value_t::number_float:
4220 {
4221 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t *>());
4222 break;
4223 }
4224
4225 case value_t::boolean:
4226 {
4227 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::boolean_t *>());
4228 break;
4229 }
4230
4231 case value_t::null:
4232 case value_t::object:
4233 case value_t::array:
4234 case value_t::string:
4235 case value_t::binary:
4236 case value_t::discarded:
4237 default:
4238 JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()), j));
4239 }
4240}
value_t
the JSON type enumeration
Definition: json.hpp:121