TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ get_arithmetic_value()

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

Definition at line 3912 of file json.hpp.

3913{
3914 switch (static_cast<value_t>(j))
3915 {
3916 case value_t::number_unsigned:
3917 {
3918 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_unsigned_t *>());
3919 break;
3920 }
3921
3922 case value_t::number_integer:
3923 {
3924 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_integer_t *>());
3925 break;
3926 }
3927
3928 case value_t::number_float:
3929 {
3930 val = static_cast<ArithmeticType>(*j.template get_ptr<const typename BasicJsonType::number_float_t *>());
3931 break;
3932 }
3933
3934 case value_t::null:
3935 case value_t::object:
3936 case value_t::array:
3937 case value_t::string:
3938 case value_t::boolean:
3939 case value_t::binary:
3940 case value_t::discarded:
3941 default:
3942 JSON_THROW(type_error::create(302, "type must be number, but is " + std::string(j.type_name()), j));
3943 }
3944}
value_t
the JSON type enumeration
Definition: json.hpp:121