JSON for Modern C++ 2.1.1
|
◆ number_integer_t
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>
RFC 7159 describes numbers as follows:
This description includes both integer and floating-point numbers. However, C++ allows more precise storage if it is known whether the number is a signed integer, an unsigned integer or a floating-point number. Therefore, three different types, number_integer_t, number_unsigned_t and number_float_t are used. To store integer numbers in C++, a type is defined by the template parameter NumberIntegerType which chooses the type to use. Default typeWith the default values for NumberIntegerType ( static basic_json array(std::initializer_list< basic_json > init=std::initializer_list< basic_json >()) explicitly create an array from an initializer list Definition json.hpp:2165 Default behavior
LimitsRFC 7159 specifies:
When the default type is used, the maximal integer number that can be stored is RFC 7159 further states:
As this range is a subrange of the exactly supported range [INT64_MIN, INT64_MAX], this class's integer type is interoperable. StorageInteger number values are stored directly inside a basic_json type.
|