|
JSON for Modern C++
1.0.0-rc1
|
|
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 = int64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator>
RFC 7159 describes JSON objects as follows:
To store objects in C++, a type is defined by the template parameters ObjectType which chooses the container (e.g., Default typeWith the default values for ObjectType ( std::map<
std::string, // key_type
basic_json, // value_type
std::less<std::string>, // key_compare
std::allocator<std::pair<const std::string, basic_json>> // allocator_type
>
BehaviorThe choice of object_t influences the behavior of the JSON class. With the default type, objects have the following behavior:
LimitsRFC 7159 specifies:
In this class, the object's limit of nesting is not constraint explicitly. However, a maximum depth of nesting may be introduced by the compiler or runtime environment. A theoretical limit can be queried by calling the max_size function of a JSON object. StorageObjects are stored as pointers in a basic_json type. That is, for any access to object values, a pointer of type
|
1.8.10