TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ is_number()

template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer, class BinaryType = std::vector<std::uint8_t>>
constexpr bool nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::is_number ( ) const
inlineconstexprnoexcept

return whether value is a number

This function returns true if and only if the JSON value is a number. This includes both integer (signed and unsigned) and floating-point values.

Returns
true if type is number (regardless whether integer, unsigned integer or floating-type), false otherwise.

@complexity Constant.

@exceptionsafety No-throw guarantee: this member function never throws exceptions.

@liveexample{The following code exemplifies is_number() for all JSON types.,is_number}

See also
see is_number_integer() – check if value is an integer or unsigned integer number
see is_number_unsigned() – check if value is an unsigned integer number
see is_number_float() – check if value is a floating-point number
Since
version 1.0.0

Definition at line 20303 of file json.hpp.

20304 {
20305 return is_number_integer() || is_number_float();
20306 }
constexpr bool is_number_float() const noexcept
return whether value is a floating-point number
Definition: json.hpp:20388
constexpr bool is_number_integer() const noexcept
return whether value is an integer number
Definition: json.hpp:20332