Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards


Document Model

In this library the following types implement containers used to represent JSON data in memory:

Table 1.1. Container Types




A sequence container of JSON values supporting dynamic size and fast, random access. The interface and performance characteristics are similar to std::vector.


An associative container of key-value pairs with unique keys, where the key is a string and the mapped type is a JSON value. Search, insertion, and removal have average contant-time complexity. In addition, elements are stored contiguously in memory allowing cache-friendly iteration.


A contiguous range of characters. The library assumes that the contents of the string holds only valid UTF-8.


A special variant which can hold one of any of the six standard JSON data types.

These containers are explored in-depth in the sections that follow.

[Note] Note

Sample code and identifiers used throughout are written as if the following declarations are in effect:

#include <boost/json.hpp>
using namespace boost::json;