[#nlohmann-basic_json-0c] = xref:nlohmann.adoc[nlohmann]::basic_json :relfileprefix: ../ :mrdocs: a class to store JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< template< typename U, typename V, typename... Args> typename ObjectType = map, template< typename U, typename... Args> typename ArrayType = vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = int64_t, class NumberUnsignedType = uint64_t, class NumberFloatType = double, template<typename U> typename AllocatorType = allocator, template< typename T, typename SFINAE = void> typename JSONSerializer = adl_serializer, class BinaryType = std::vector<uint8_t>, class CustomBaseClass = void> class basic_json : public /* implementation-defined */::json_base_class<CustomBaseClass> ---- == Description a class to store JSON values == Base Classes [cols="1,4"] |=== | Name| Description | `/* implementation-defined */::json_base_class<CustomBaseClass>` | |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:nlohmann/basic_json-0c/allocator_type.adoc[`allocator_type`] | the allocator type | xref:nlohmann/basic_json-0c/array_t.adoc[`array_t`] | a type for an array | xref:nlohmann/basic_json-0c/binary_t.adoc[`binary_t`] | a type for a packed binary type | xref:nlohmann/basic_json-0c/bjdata_version_t.adoc[`bjdata_version_t`] | how to encode BJData | xref:nlohmann/basic_json-0c/boolean_t.adoc[`boolean_t`] | a type for a boolean | xref:nlohmann/basic_json-0c/cbor_tag_handler_t.adoc[`cbor_tag_handler_t`] | how to treat CBOR tags | xref:nlohmann/basic_json-0c/const_iterator.adoc[`const_iterator`] | a const iterator for a basic_json container | xref:nlohmann/basic_json-0c/const_pointer.adoc[`const_pointer`] | the type of an element const pointer | xref:nlohmann/basic_json-0c/const_reference.adoc[`const_reference`] | the type of an element const reference | xref:nlohmann/basic_json-0c/const_reverse_iterator.adoc[`const_reverse_iterator`] | a const reverse iterator for a basic_json container | xref:nlohmann/basic_json-0c/default_object_comparator_t.adoc[`default_object_comparator_t`] | default object key comparator type The actual object key comparator type (xref:nlohmann/basic_json-0c/object_comparator_t.adoc[`object_comparator_t`]) may be different. | xref:nlohmann/basic_json-0c/difference_type.adoc[`difference_type`] | a type to represent differences between iterators | xref:nlohmann/basic_json-0c/error_handler_t.adoc[`error_handler_t`] | how to treat decoding errors | xref:nlohmann/basic_json-0c/exception.adoc[`exception`] | exception base class, see `nlohmann::detail::exception` | xref:nlohmann/basic_json-0c/initializer_list_t.adoc[`initializer_list_t`] | helper type for initializer lists of basic_json values | xref:nlohmann/basic_json-0c/input_format_t.adoc[`input_format_t`] | the supported input formats for the xref:nlohmann/basic_json-0c/sax_parse-07.adoc[`sax_parse`] function | xref:nlohmann/basic_json-0c/invalid_iterator.adoc[`invalid_iterator`] | exception indicating errors with iterators | xref:nlohmann/basic_json-0c/iterator.adoc[`iterator`] | an iterator for a basic_json container | xref:nlohmann/basic_json-0c/json_pointer.adoc[`json_pointer`] | JSON Pointer, see xref:nlohmann/json_pointer.adoc[`nlohmann::json_pointer`] | xref:nlohmann/basic_json-0c/json_sax_t.adoc[`json_sax_t`] | SAX interface type, see `nlohmann::json_sax` | xref:nlohmann/basic_json-0c/json_serializer.adoc[`json_serializer`] | the type used to serialize/deserialize values of type _T,_ see xref:nlohmann/adl_serializer.adoc[`nlohmann::adl_serializer`] | xref:nlohmann/basic_json-0c/number_float_t.adoc[`number_float_t`] | a type for a number (floating‐point) | xref:nlohmann/basic_json-0c/number_integer_t.adoc[`number_integer_t`] | a type for a number (integer) | xref:nlohmann/basic_json-0c/number_unsigned_t.adoc[`number_unsigned_t`] | a type for a number (unsigned) | xref:nlohmann/basic_json-0c/object_comparator_t.adoc[`object_comparator_t`] | object key comparator type | xref:nlohmann/basic_json-0c/object_t.adoc[`object_t`] | a type for an object | xref:nlohmann/basic_json-0c/other_error.adoc[`other_error`] | exception indicating other library errors | xref:nlohmann/basic_json-0c/out_of_range.adoc[`out_of_range`] | exception indicating access out of the defined range | xref:nlohmann/basic_json-0c/parse_error.adoc[`parse_error`] | exception indicating a parse error | xref:nlohmann/basic_json-0c/parse_event_t.adoc[`parse_event_t`] | parser event types | xref:nlohmann/basic_json-0c/parser_callback_t.adoc[`parser_callback_t`] | per‐element parser callback type | xref:nlohmann/basic_json-0c/pointer.adoc[`pointer`] | the type of an element pointer | xref:nlohmann/basic_json-0c/reference.adoc[`reference`] | the type of an element reference | xref:nlohmann/basic_json-0c/reverse_iterator.adoc[`reverse_iterator`] | a reverse iterator for a basic_json container | xref:nlohmann/basic_json-0c/size_type.adoc[`size_type`] | a type to represent container sizes | xref:nlohmann/basic_json-0c/string_t.adoc[`string_t`] | a type for a string | xref:nlohmann/basic_json-0c/type_error.adoc[`type_error`] | exception indicating executing a member function with a wrong type | xref:nlohmann/basic_json-0c/value_t.adoc[`value_t`] | the type of an element's value, see `nlohmann::detail::value_t` | xref:nlohmann/basic_json-0c/value_type.adoc[`value_type`] | the type of elements in a basic_json container |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:nlohmann/basic_json-0c/2constructor-0c0.adoc[`basic_json`] [.small]#[constructor]# | copy constructor | xref:nlohmann/basic_json-0c/2constructor-0c7.adoc[`basic_json`] [.small]#[constructor]# | move constructor | xref:nlohmann/basic_json-0c/2constructor-09.adoc[`basic_json`] [.small]#[constructor]# | create a null object | xref:nlohmann/basic_json-0c/2constructor-067.adoc[`basic_json`] [.small]#[constructor]# | create an empty value with a given type | xref:nlohmann/basic_json-0c/2constructor-0cc.adoc[`basic_json`] [.small]#[constructor]# | create a JSON value from an existing one | xref:nlohmann/basic_json-0c/2constructor-02.adoc[`basic_json`] [.small]#[constructor]# | create a JSON value from a json_ref wrapper | xref:nlohmann/basic_json-0c/2constructor-06d.adoc[`basic_json`] [.small]#[constructor]# | create a JSON value from compatible types | xref:nlohmann/basic_json-0c/2constructor-0e0.adoc[`basic_json`] [.small]#[constructor]# | construct an array with count copies of given value | xref:nlohmann/basic_json-0c/2constructor-0e9.adoc[`basic_json`] [.small]#[constructor]# | construct a JSON container given an iterator range | xref:nlohmann/basic_json-0c/2constructor-0e8.adoc[`basic_json`] [.small]#[constructor]# | create a container (array or object) from an initializer list | xref:nlohmann/basic_json-0c/2destructor.adoc[`~basic_json`] [.small]#[destructor]# | destructor | xref:nlohmann/basic_json-0c/operator_assign.adoc[`operator=`] | copy assignment | xref:nlohmann/basic_json-0c/at-03.adoc[`at`] | access specified array element with bounds checking | xref:nlohmann/basic_json-0c/at-07.adoc[`at`] | access specified array element with bounds checking | xref:nlohmann/basic_json-0c/at-0d.adoc[`at`] | access specified element via JSON Pointer, with bounds checking | xref:nlohmann/basic_json-0c/at-069.adoc[`at`] | access specified element via JSON Pointer, with bounds checking | xref:nlohmann/basic_json-0c/at-063.adoc[`at`] | access specified object element with bounds checking | xref:nlohmann/basic_json-0c/at-00.adoc[`at`] | access specified object element with bounds checking | xref:nlohmann/basic_json-0c/at-02.adoc[`at`] [.small]#[deprecated]# | access specified element via JSON Pointer, with bounds checking | xref:nlohmann/basic_json-0c/at-09.adoc[`at`] [.small]#[deprecated]# | access specified element via JSON Pointer, with bounds checking | xref:nlohmann/basic_json-0c/at-06a.adoc[`at`] | access specified object element with bounds checking | xref:nlohmann/basic_json-0c/at-04.adoc[`at`] | access specified object element with bounds checking | xref:nlohmann/basic_json-0c/back-0d.adoc[`back`] | access the last element | xref:nlohmann/basic_json-0c/back-03.adoc[`back`] | access the last element | xref:nlohmann/basic_json-0c/begin-05.adoc[`begin`] | returns an iterator to the first element | xref:nlohmann/basic_json-0c/begin-0f.adoc[`begin`] | returns an iterator to the first element | xref:nlohmann/basic_json-0c/cbegin.adoc[`cbegin`] | returns a const iterator to the first element | xref:nlohmann/basic_json-0c/cend.adoc[`cend`] | returns an iterator to one past the last element | xref:nlohmann/basic_json-0c/clear.adoc[`clear`] | clears the contents | xref:nlohmann/basic_json-0c/contains-07.adoc[`contains`] | check the existence of an element in a JSON object given a JSON pointer | xref:nlohmann/basic_json-0c/contains-0c.adoc[`contains`] | check the existence of an element in a JSON object | xref:nlohmann/basic_json-0c/contains-0e.adoc[`contains`] [.small]#[deprecated]# | check the existence of an element in a JSON object given a JSON pointer | xref:nlohmann/basic_json-0c/contains-03.adoc[`contains`] | check the existence of an element in a JSON object | xref:nlohmann/basic_json-0c/count-07.adoc[`count`] | returns the number of occurrences of a key in a JSON object | xref:nlohmann/basic_json-0c/count-09.adoc[`count`] | returns the number of occurrences of a key in a JSON object | xref:nlohmann/basic_json-0c/crbegin.adoc[`crbegin`] | returns a const reverse iterator to the last element | xref:nlohmann/basic_json-0c/crend.adoc[`crend`] | returns a const reverse iterator to one before the first | xref:nlohmann/basic_json-0c/dump.adoc[`dump`] | serialization | xref:nlohmann/basic_json-0c/emplace.adoc[`emplace`] | add an object to an object if key does not exist | xref:nlohmann/basic_json-0c/emplace_back.adoc[`emplace_back`] | add an object to an array | xref:nlohmann/basic_json-0c/empty.adoc[`empty`] | checks whether the container is empty. | xref:nlohmann/basic_json-0c/end-09.adoc[`end`] | returns an iterator to one past the last element | xref:nlohmann/basic_json-0c/end-04.adoc[`end`] | returns an iterator to one past the last element | xref:nlohmann/basic_json-0c/erase-06.adoc[`erase`] | remove element from a JSON array given an index | xref:nlohmann/basic_json-0c/erase-092.adoc[`erase`] | remove element from a JSON object given a key | xref:nlohmann/basic_json-0c/erase-0a.adoc[`erase`] | remove element given an iterator | xref:nlohmann/basic_json-0c/erase-091.adoc[`erase`] | remove element from a JSON object given a key | xref:nlohmann/basic_json-0c/erase-02.adoc[`erase`] | remove elements given an iterator range | xref:nlohmann/basic_json-0c/find-06c.adoc[`find`] | find an element in a JSON object | xref:nlohmann/basic_json-0c/find-09.adoc[`find`] | find an element in a JSON object | xref:nlohmann/basic_json-0c/find-06b.adoc[`find`] | find an element in a JSON object | xref:nlohmann/basic_json-0c/find-00.adoc[`find`] | find an element in a JSON object | xref:nlohmann/basic_json-0c/flatten.adoc[`flatten`] | return flattened JSON value | xref:nlohmann/basic_json-0c/front-04.adoc[`front`] | access the first element | xref:nlohmann/basic_json-0c/front-02.adoc[`front`] | access the first element | xref:nlohmann/basic_json-0c/get-09.adoc[`get`] | get a pointer value (explicit) | xref:nlohmann/basic_json-0c/get-03.adoc[`get`] | get a (pointer) value (explicit) | xref:nlohmann/basic_json-0c/get_binary-0b.adoc[`get_binary`] | get a binary value | xref:nlohmann/basic_json-0c/get_binary-03.adoc[`get_binary`] | get a binary value | xref:nlohmann/basic_json-0c/get_ptr-0e.adoc[`get_ptr`] | get a pointer value (implicit) | xref:nlohmann/basic_json-0c/get_ptr-0d.adoc[`get_ptr`] | get a pointer value (implicit) | xref:nlohmann/basic_json-0c/get_ref-0a.adoc[`get_ref`] | get a reference value (implicit) | xref:nlohmann/basic_json-0c/get_ref-0c.adoc[`get_ref`] | get a reference value (implicit) | xref:nlohmann/basic_json-0c/get_to-0e.adoc[`get_to`] | get a value (explicit) | xref:nlohmann/basic_json-0c/get_to-0f.adoc[`get_to`] | get a value (explicit) | xref:nlohmann/basic_json-0c/get_to-09.adoc[`get_to`] | get a value (explicit) | xref:nlohmann/basic_json-0c/insert-07.adoc[`insert`] | inserts range of elements into object | xref:nlohmann/basic_json-0c/insert-09.adoc[`insert`] | inserts elements from initializer list into array | xref:nlohmann/basic_json-0c/insert-02.adoc[`insert`] | inserts element into array | xref:nlohmann/basic_json-0c/insert-00.adoc[`insert`] | inserts element into array | xref:nlohmann/basic_json-0c/insert-06.adoc[`insert`] | inserts range of elements into array | xref:nlohmann/basic_json-0c/insert-0f.adoc[`insert`] | inserts copies of element into array | xref:nlohmann/basic_json-0c/insert_iterator.adoc[`insert_iterator`] | helper for insertion of an iterator | xref:nlohmann/basic_json-0c/is_array.adoc[`is_array`] | return whether value is an array | xref:nlohmann/basic_json-0c/is_binary.adoc[`is_binary`] | return whether value is a binary array | xref:nlohmann/basic_json-0c/is_boolean.adoc[`is_boolean`] | return whether value is a boolean | xref:nlohmann/basic_json-0c/is_discarded.adoc[`is_discarded`] | return whether value is discarded | xref:nlohmann/basic_json-0c/is_null.adoc[`is_null`] | return whether value is null | xref:nlohmann/basic_json-0c/is_number.adoc[`is_number`] | return whether value is a number | xref:nlohmann/basic_json-0c/is_number_float.adoc[`is_number_float`] | return whether value is a floating‐point number | xref:nlohmann/basic_json-0c/is_number_integer.adoc[`is_number_integer`] | return whether value is an integer number | xref:nlohmann/basic_json-0c/is_number_unsigned.adoc[`is_number_unsigned`] | return whether value is an unsigned integer number | xref:nlohmann/basic_json-0c/is_object.adoc[`is_object`] | return whether value is an object | xref:nlohmann/basic_json-0c/is_primitive.adoc[`is_primitive`] | return whether type is primitive | xref:nlohmann/basic_json-0c/is_string.adoc[`is_string`] | return whether value is a string | xref:nlohmann/basic_json-0c/is_structured.adoc[`is_structured`] | return whether type is structured | xref:nlohmann/basic_json-0c/items-0c.adoc[`items`] | helper to access iterator member functions in range‐based for | xref:nlohmann/basic_json-0c/items-08.adoc[`items`] | helper to access iterator member functions in range‐based for | xref:nlohmann/basic_json-0c/max_size.adoc[`max_size`] | returns the maximum possible number of elements | xref:nlohmann/basic_json-0c/merge_patch.adoc[`merge_patch`] | applies a JSON Merge Patch | xref:nlohmann/basic_json-0c/operator_plus_eq-0c.adoc[`operator+=`] | add an object to an object | xref:nlohmann/basic_json-0c/operator_plus_eq-00.adoc[`operator+=`] | add an object to an array | xref:nlohmann/basic_json-0c/operator_plus_eq-05.adoc[`operator+=`] | add an object to an object | xref:nlohmann/basic_json-0c/operator_plus_eq-0d.adoc[`operator+=`] | add an object to an array | xref:nlohmann/basic_json-0c/operator_subs-02.adoc[`operator[]`] | access specified object element | xref:nlohmann/basic_json-0c/operator_subs-08e.adoc[`operator[]`] | access specified array element | xref:nlohmann/basic_json-0c/operator_subs-07.adoc[`operator[]`] | access specified array element | xref:nlohmann/basic_json-0c/operator_subs-0ed.adoc[`operator[]`] | access specified element via JSON Pointer | xref:nlohmann/basic_json-0c/operator_subs-0e6.adoc[`operator[]`] | access specified element via JSON Pointer | xref:nlohmann/basic_json-0c/operator_subs-0cd.adoc[`operator[]`] | access specified object element | xref:nlohmann/basic_json-0c/operator_subs-0a6.adoc[`operator[]`] [.small]#[deprecated]# | access specified element via JSON Pointer | xref:nlohmann/basic_json-0c/operator_subs-0e5.adoc[`operator[]`] [.small]#[deprecated]# | access specified element via JSON Pointer | xref:nlohmann/basic_json-0c/operator_subs-08d.adoc[`operator[]`] | access specified object element | xref:nlohmann/basic_json-0c/operator_subs-0c0.adoc[`operator[]`] | access specified object element | xref:nlohmann/basic_json-0c/operator_subs-01.adoc[`operator[]`] | access specified object element | xref:nlohmann/basic_json-0c/operator_subs-0a7.adoc[`operator[]`] | access specified object element | xref:nlohmann/basic_json-0c/patch.adoc[`patch`] | applies a JSON patch to a copy of the current object | xref:nlohmann/basic_json-0c/patch_inplace.adoc[`patch_inplace`] | applies a JSON patch in‐place without copying the object | xref:nlohmann/basic_json-0c/push_back-0d.adoc[`push_back`] | add an object to an object | xref:nlohmann/basic_json-0c/push_back-04.adoc[`push_back`] | add an object to an array | xref:nlohmann/basic_json-0c/push_back-07.adoc[`push_back`] | add an object to an object | xref:nlohmann/basic_json-0c/push_back-09.adoc[`push_back`] | add an object to an array | xref:nlohmann/basic_json-0c/rbegin-06.adoc[`rbegin`] | returns an iterator to the reverse‐beginning | xref:nlohmann/basic_json-0c/rbegin-0f.adoc[`rbegin`] | returns an iterator to the reverse‐beginning | xref:nlohmann/basic_json-0c/rend-0d.adoc[`rend`] | returns an iterator to the reverse‐end | xref:nlohmann/basic_json-0c/rend-09.adoc[`rend`] | returns an iterator to the reverse‐end | xref:nlohmann/basic_json-0c/size.adoc[`size`] | returns the number of elements | xref:nlohmann/basic_json-0c/swap-020.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-0c/swap-08.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-0c/swap-024.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-0c/swap-0b.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-0c/swap-0a.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-0c/swap-01.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-0c/type.adoc[`type`] | return the type of the JSON value (explicit) | xref:nlohmann/basic_json-0c/type_name.adoc[`type_name`] | return the type as string | xref:nlohmann/basic_json-0c/unflatten.adoc[`unflatten`] | unflatten a previously flattened JSON value | xref:nlohmann/basic_json-0c/update-04.adoc[`update`] | updates a JSON object from another object, overwriting existing keys | xref:nlohmann/basic_json-0c/update-01.adoc[`update`] | updates a JSON object from another object, overwriting existing keys | xref:nlohmann/basic_json-0c/value-0f.adoc[`value`] | access specified object element via JSON Pointer with default value | xref:nlohmann/basic_json-0c/value-031.adoc[`value`] | access specified object element with default value | xref:nlohmann/basic_json-0c/value-074a0.adoc[`value`] | access specified object element via JSON Pointer with default value | xref:nlohmann/basic_json-0c/value-0b.adoc[`value`] | access specified object element with default value | xref:nlohmann/basic_json-0c/value-0c.adoc[`value`] [.small]#[deprecated]# | access specified object element via JSON Pointer with default value | xref:nlohmann/basic_json-0c/value-038.adoc[`value`] | access specified object element with default value | xref:nlohmann/basic_json-0c/value-04.adoc[`value`] [.small]#[deprecated]# | access specified object element via JSON Pointer with default value | xref:nlohmann/basic_json-0c/value-074ab.adoc[`value`] | access specified object element with default value | xref:nlohmann/basic_json-0c/2conversion-06.adoc[`operator ValueType`] | get a value (implicit) | xref:nlohmann/basic_json-0c/2conversion-05.adoc[`operator value_t`] | return the type of the JSON value (implicit) | xref:nlohmann/basic_json-0c/operator_eq-06.adoc[`operator==`] | comparison: equal | xref:nlohmann/basic_json-0c/operator_eq-00.adoc[`operator==`] | comparison: equal | xref:nlohmann/basic_json-0c/operator_3way-02.adoc[`operator<=>`] | comparison: 3‐way | xref:nlohmann/basic_json-0c/operator_3way-0b.adoc[`operator<=>`] | comparison: 3‐way |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:nlohmann/basic_json-0c/accept-07.adoc[`accept`] [.small]#[deprecated]# | check if the input is valid JSON | xref:nlohmann/basic_json-0c/accept-05.adoc[`accept`] | check if the input is valid JSON | xref:nlohmann/basic_json-0c/accept-02.adoc[`accept`] | check if the input is valid JSON (iterator pair, or iterator+sentinel pair for C++20 ranges support) | xref:nlohmann/basic_json-0c/array.adoc[`array`] | explicitly create an array from an initializer list | xref:nlohmann/basic_json-0c/binary-02.adoc[`binary`] | explicitly create a binary array (without subtype) | xref:nlohmann/basic_json-0c/binary-0f.adoc[`binary`] | explicitly create a binary array | xref:nlohmann/basic_json-0c/binary-08.adoc[`binary`] | explicitly create a binary array (with subtype) | xref:nlohmann/basic_json-0c/binary-0a.adoc[`binary`] | explicitly create a binary array (with subtype) | xref:nlohmann/basic_json-0c/diff.adoc[`diff`] | creates a diff as a JSON patch | xref:nlohmann/basic_json-0c/from_bjdata-0f.adoc[`from_bjdata`] | create a JSON value from an input in BJData format | xref:nlohmann/basic_json-0c/from_bjdata-04.adoc[`from_bjdata`] | create a JSON value from an input in BJData format (iterator pair, or iterator+sentinel pair for C++20 ranges support) | xref:nlohmann/basic_json-0c/from_bson-0b.adoc[`from_bson`] [.small]#[deprecated]# | create a JSON value from an input in BSON format | xref:nlohmann/basic_json-0c/from_bson-09.adoc[`from_bson`] | create a JSON value from an input in BSON format | xref:nlohmann/basic_json-0c/from_bson-04.adoc[`from_bson`] [.small]#[deprecated]# | create a JSON value from an input in BSON format | xref:nlohmann/basic_json-0c/from_bson-0a.adoc[`from_bson`] | create a JSON value from an input in BSON format (iterator pair, or iterator+sentinel pair for C++20 ranges support) | xref:nlohmann/basic_json-0c/from_cbor-07.adoc[`from_cbor`] [.small]#[deprecated]# | create a JSON value from an input in CBOR format | xref:nlohmann/basic_json-0c/from_cbor-09.adoc[`from_cbor`] | create a JSON value from an input in CBOR format | xref:nlohmann/basic_json-0c/from_cbor-0e.adoc[`from_cbor`] [.small]#[deprecated]# | create a JSON value from an input in CBOR format | xref:nlohmann/basic_json-0c/from_cbor-04.adoc[`from_cbor`] | create a JSON value from an input in CBOR format (iterator pair, or iterator+sentinel pair for C++20 ranges support) | xref:nlohmann/basic_json-0c/from_msgpack-0c.adoc[`from_msgpack`] [.small]#[deprecated]# | create a JSON value from an input in MessagePack format | xref:nlohmann/basic_json-0c/from_msgpack-08.adoc[`from_msgpack`] | create a JSON value from an input in MessagePack format | xref:nlohmann/basic_json-0c/from_msgpack-00.adoc[`from_msgpack`] [.small]#[deprecated]# | create a JSON value from an input in MessagePack format | xref:nlohmann/basic_json-0c/from_msgpack-05.adoc[`from_msgpack`] | create a JSON value from an input in MessagePack format (iterator pair, or iterator+sentinel pair for C++20 ranges support) | xref:nlohmann/basic_json-0c/from_ubjson-06.adoc[`from_ubjson`] [.small]#[deprecated]# | create a JSON value from an input in UBJSON format | xref:nlohmann/basic_json-0c/from_ubjson-0c.adoc[`from_ubjson`] | create a JSON value from an input in UBJSON format | xref:nlohmann/basic_json-0c/from_ubjson-04.adoc[`from_ubjson`] [.small]#[deprecated]# | create a JSON value from an input in UBJSON format | xref:nlohmann/basic_json-0c/from_ubjson-0b.adoc[`from_ubjson`] | create a JSON value from an input in UBJSON format (iterator pair, or iterator+sentinel pair for C++20 ranges support) | xref:nlohmann/basic_json-0c/get_allocator.adoc[`get_allocator`] | returns the allocator associated with the container | xref:nlohmann/basic_json-0c/iterator_wrapper-0b.adoc[`iterator_wrapper`] [.small]#[deprecated]# | wrapper to access iterator member functions in range‐based for | xref:nlohmann/basic_json-0c/iterator_wrapper-0e.adoc[`iterator_wrapper`] [.small]#[deprecated]# | wrapper to access iterator member functions in range‐based for | xref:nlohmann/basic_json-0c/meta.adoc[`meta`] | returns version information on the library | xref:nlohmann/basic_json-0c/object.adoc[`object`] | explicitly create an object from an initializer list | xref:nlohmann/basic_json-0c/parse-08.adoc[`parse`] [.small]#[deprecated]# | deserialize from a compatible input | xref:nlohmann/basic_json-0c/parse-0e.adoc[`parse`] | deserialize from a compatible input | xref:nlohmann/basic_json-0c/parse-0f.adoc[`parse`] | deserialize from a pair of character iterators (or an iterator+sentinel pair, C++20 ranges support) | xref:nlohmann/basic_json-0c/sax_parse-07.adoc[`sax_parse`] [.small]#[deprecated]# | generate SAX events | xref:nlohmann/basic_json-0c/sax_parse-08.adoc[`sax_parse`] | generate SAX events | xref:nlohmann/basic_json-0c/sax_parse-0e.adoc[`sax_parse`] | generate SAX events (iterator pair, or iterator+sentinel pair for C++20 ranges support) | xref:nlohmann/basic_json-0c/to_bjdata-07.adoc[`to_bjdata`] | create a BJData serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_bjdata-09.adoc[`to_bjdata`] | create a BJData serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_bjdata-04.adoc[`to_bjdata`] | create a BJData serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_bson-07.adoc[`to_bson`] | create a BSON serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_bson-08.adoc[`to_bson`] | create a BSON serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_bson-0d.adoc[`to_bson`] | create a BSON serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_cbor-09.adoc[`to_cbor`] | create a CBOR serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_cbor-05.adoc[`to_cbor`] | create a CBOR serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_cbor-03.adoc[`to_cbor`] | create a CBOR serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_msgpack-03.adoc[`to_msgpack`] | create a MessagePack serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_msgpack-04.adoc[`to_msgpack`] | create a MessagePack serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_msgpack-0a.adoc[`to_msgpack`] | create a MessagePack serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_ubjson-0b0.adoc[`to_ubjson`] | create a UBJSON serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_ubjson-08.adoc[`to_ubjson`] | create a UBJSON serialization of a given JSON value | xref:nlohmann/basic_json-0c/to_ubjson-0b3.adoc[`to_ubjson`] | create a UBJSON serialization of a given JSON value |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:nlohmann/operator_rshift-0d.adoc[nlohmann::operator>>]` | deserialize from stream | `xref:nlohmann/operator_lshift-01.adoc[nlohmann::operator<<]` | deserialize from stream | `xref:nlohmann/operator_rshift-05.adoc[nlohmann::operator>>]` | serialize to stream | `xref:nlohmann/operator_lshift-0e.adoc[nlohmann::operator<<]` | serialize to stream | `xref:nlohmann/swap-09.adoc[nlohmann::swap]` | exchanges the values | `nlohmann::detail::exception` | general exception of the `basic_json` class | `nlohmann::detail::serializer` | | `xref:nlohmann/json_pointer.adoc[nlohmann::json_pointer]` | JSON Pointer defines a string syntax for identifying a specific value within a JSON document |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:nlohmann/format_as.adoc[`format_as`] | user‐defined format_as function for JSON values (fmt <= 11.0.x support) | xref:nlohmann/operator_lshift-020.adoc[`operator<<`] | deserialize from stream | xref:nlohmann/operator_rshift-02.adoc[`operator>>`] | serialize to stream | xref:nlohmann/to_string.adoc[`to_string`] | user‐defined to_string function for JSON values |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#