= Reference :mrdocs: == Namespaces [cols=2] |=== | Name | Description | link:#nlohmann[`nlohmann`] | namespace for Niels Lohmann |=== == Using Declarations [cols=1] |=== | Name | link:#_10using-02[`Unnamed using`] | link:#_10using-00[`Unnamed using`] |=== == link:#nlohmann[nlohmann] namespace namespace for Niels Lohmann === Types [cols=2] |=== | Name | Description | link:#nlohmann-adl_serializer[`adl_serializer`] | default JSONSerializer template argument | link:#nlohmann-basic_json-0e[`basic_json<>`] | | link:#nlohmann-basic_json-00[`basic_json`] | a class to store JSON values | link:#nlohmann-byte_container_with_subtype-04[`byte_container_with_subtype`] | an internal type for a backed binary type | link:#nlohmann-byte_container_with_subtype-09[`byte_container_with_subtype<vector<unsigned char>>`] | | link:#nlohmann-json_pointer-0b[`json_pointer`] | | link:#nlohmann-json_pointer-0a[`json_pointer`] | JSON Pointer defines a string syntax for identifying a specific value within a JSON document | link:#nlohmann-ordered_map[`ordered_map`] | a minimal map‐like container that preserves insertion order | link:#nlohmann-json[`json`] | default specialization | link:#nlohmann-ordered_json[`ordered_json`] | specialization that maintains the insertion order of object keys |=== === Functions [cols=2] |=== | Name | Description | link:#nlohmann-2function-05[`Unnamed overloads`] | | link:#nlohmann-operator_rshift-0a[`operator>>`] | Right shift operators | link:#nlohmann-swap-0e[`swap`] | exchanges the values | link:#nlohmann-to_string[`to_string`] | user‐defined to_string function for JSON values | link:#nlohmann-operator_lshift-05e[`operator<<`] | Left shift operators |=== == See Also https://github.com/nlohmann namespace for Niels Lohmann == Types [cols=2] |=== | Name | Description | link:#nlohmann-adl_serializer[`adl_serializer`] | default JSONSerializer template argument | link:#nlohmann-basic_json-0e[`basic_json<>`] | | link:#nlohmann-basic_json-00[`basic_json`] | a class to store JSON values | link:#nlohmann-byte_container_with_subtype-04[`byte_container_with_subtype`] | an internal type for a backed binary type | link:#nlohmann-byte_container_with_subtype-09[`byte_container_with_subtype<vector<unsigned char>>`] | | link:#nlohmann-json_pointer-0b[`json_pointer`] | | link:#nlohmann-json_pointer-0a[`json_pointer`] | JSON Pointer defines a string syntax for identifying a specific value within a JSON document | link:#nlohmann-ordered_map[`ordered_map`] | a minimal map‐like container that preserves insertion order | link:#nlohmann-json[`json`] | default specialization | link:#nlohmann-ordered_json[`ordered_json`] | specialization that maintains the insertion order of object keys |=== == Functions [cols=2] |=== | Name | Description | link:#nlohmann-2function-05[`Unnamed overloads`] | | link:#nlohmann-operator_rshift-0a[`operator>>`] | Right shift operators | link:#nlohmann-swap-0e[`swap`] | exchanges the values | link:#nlohmann-to_string[`to_string`] | user‐defined to_string function for JSON values | link:#nlohmann-operator_lshift-05e[`operator<<`] | Left shift operators |=== == See Also https://github.com/nlohmann default specialization == Synopsis Declared in `<nlohmann/json_fwd.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using json = link:#nlohmann-basic_json-00[basic_json]; ---- specialization that maintains the insertion order of object keys == Synopsis Declared in `<nlohmann/json_fwd.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using ordered_json = link:#nlohmann-basic_json-00[basic_json<ordered_map>]; ---- default JSONSerializer template argument == Synopsis Declared in `<nlohmann/adl_serializer.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T = void, typename SFINAE = void> struct adl_serializer; ---- == Static Member Functions [cols=2] |=== | Name | Description | link:#nlohmann-adl_serializer-from_json-0a3[`from_json`] | convert a JSON value to any value type | link:#nlohmann-adl_serializer-to_json[`to_json`] | convert any value type to a JSON value |=== == Description This serializer ignores the template arguments and uses ADL([argument‐dependent lookup](https://en.cppreference.com/w/cpp/language/adl))for serialization. convert a JSON value to any value type == Synopses Declared in `<nlohmann/adl_serializer.hpp>` convert a JSON value to any value type [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename BasicJsonType, typename TargetType = ValueType> static decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {})) link:#nlohmann-adl_serializer-from_json-0a7[from_json](BasicJsonType&& j) noexcept(noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType>{}))); ---- [.small]#link:#nlohmann-adl_serializer-from_json-0a7[_» more..._]# convert a JSON value to any value type [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename BasicJsonType, typename TargetType = ValueType> static decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void()) link:#nlohmann-adl_serializer-from_json-07[from_json]( BasicJsonType&& j, TargetType& val) noexcept(noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val))); ---- [.small]#link:#nlohmann-adl_serializer-from_json-07[_» more..._]# convert a JSON value to any value type == Synopsis Declared in `<nlohmann/adl_serializer.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename BasicJsonType, typename TargetType = ValueType> static decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {})) from_json(BasicJsonType&& j) noexcept(noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType>{}))); ---- convert a JSON value to any value type == Synopsis Declared in `<nlohmann/adl_serializer.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename BasicJsonType, typename TargetType = ValueType> static decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void()) from_json( BasicJsonType&& j, TargetType& val) noexcept(noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val))); ---- convert any value type to a JSON value == Synopsis Declared in `<nlohmann/adl_serializer.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename BasicJsonType, typename TargetType = ValueType> static decltype(::nlohmann::to_json(j, std::forward<TargetType>(val)), void()) to_json( BasicJsonType& j, TargetType&& val) noexcept(noexcept(::nlohmann::to_json(j, std::forward<TargetType>(val)))); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> class link:#nlohmann-basic_json-00[basic_json]<> : public nlohmann::detail::json_base_class<void> ---- == Base Classes [cols=2] |=== | Name | Description | `nlohmann::detail::json_base_class<void>` | |=== == Types [cols=2] |=== | Name | Description | link:#nlohmann-basic_json-0e-allocator_type[`allocator_type`] | the allocator type | link:#nlohmann-basic_json-0e-array_t[`array_t`] | a type for an array | link:#nlohmann-basic_json-0e-binary_t[`binary_t`] | a type for a packed binary type | link:#nlohmann-basic_json-0e-bjdata_version_t[`bjdata_version_t`] | how to encode BJData | link:#nlohmann-basic_json-0e-boolean_t[`boolean_t`] | a type for a boolean | link:#nlohmann-basic_json-0e-cbor_tag_handler_t[`cbor_tag_handler_t`] | how to treat CBOR tags | link:#nlohmann-basic_json-0e-const_iterator[`const_iterator`] | a const iterator for a basic_json container | link:#nlohmann-basic_json-0e-const_pointer[`const_pointer`] | the type of an element const pointer | link:#nlohmann-basic_json-0e-const_reference[`const_reference`] | the type of an element const reference | link:#nlohmann-basic_json-0e-const_reverse_iterator[`const_reverse_iterator`] | a const reverse iterator for a basic_json container | link:#nlohmann-basic_json-0e-default_object_comparator_t[`default_object_comparator_t`] | | link:#nlohmann-basic_json-0e-difference_type[`difference_type`] | a type to represent differences between iterators | link:#nlohmann-basic_json-0e-error_handler_t[`error_handler_t`] | how to treat decoding errors | link:#nlohmann-basic_json-0e-exception[`exception`] | Classes to implement user‐defined exceptions. @{ | link:#nlohmann-basic_json-0e-initializer_list_t[`initializer_list_t`] | helper type for initializer lists of basic_json values | link:#nlohmann-basic_json-0e-input_format_t[`input_format_t`] | | link:#nlohmann-basic_json-0e-invalid_iterator[`invalid_iterator`] | | link:#nlohmann-basic_json-0e-iterator[`iterator`] | an iterator for a basic_json container | link:#nlohmann-basic_json-0e-json_pointer[`json_pointer`] | JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] | link:#nlohmann-basic_json-0e-json_sax_t[`json_sax_t`] | SAX interface type, see `nlohmann::json_sax` | link:#nlohmann-basic_json-0e-json_serializer[`json_serializer`] | | link:#nlohmann-basic_json-0e-number_float_t[`number_float_t`] | a type for a number (floating‐point) | link:#nlohmann-basic_json-0e-number_integer_t[`number_integer_t`] | a type for a number (integer) | link:#nlohmann-basic_json-0e-number_unsigned_t[`number_unsigned_t`] | a type for a number (unsigned) | link:#nlohmann-basic_json-0e-object_comparator_t[`object_comparator_t`] | object key comparator type | link:#nlohmann-basic_json-0e-object_t[`object_t`] | a type for an object | link:#nlohmann-basic_json-0e-other_error[`other_error`] | | link:#nlohmann-basic_json-0e-out_of_range[`out_of_range`] | | link:#nlohmann-basic_json-0e-parse_error[`parse_error`] | | link:#nlohmann-basic_json-0e-parse_event_t[`parse_event_t`] | parser event types | link:#nlohmann-basic_json-0e-parser_callback_t[`parser_callback_t`] | per‐element parser callback type | link:#nlohmann-basic_json-0e-pointer[`pointer`] | the type of an element pointer | link:#nlohmann-basic_json-0e-reference[`reference`] | the type of an element reference | link:#nlohmann-basic_json-0e-reverse_iterator[`reverse_iterator`] | a reverse iterator for a basic_json container | link:#nlohmann-basic_json-0e-size_type[`size_type`] | a type to represent container sizes | link:#nlohmann-basic_json-0e-string_t[`string_t`] | a type for a string | link:#nlohmann-basic_json-0e-type_error[`type_error`] | | link:#nlohmann-basic_json-0e-value_t[`value_t`] | | link:#nlohmann-basic_json-0e-value_type[`value_type`] | the type of elements in a basic_json container |=== == Member Functions [cols=2] |=== | Name | Description | link:#nlohmann-basic_json-0e-2constructor-0ab[`basic_json`] [.small]#[constructor]# | Construct from `nullptr_t` | link:#nlohmann-basic_json-0e-2constructor-05b[`basic_json`] [.small]#[constructor]# | Construct from `value_t` | link:#nlohmann-basic_json-0e-2constructor-01[`basic_json`] [.small]#[constructor]# | Construct from `basic_json` | link:#nlohmann-basic_json-0e-2constructor-0c91[`basic_json`] [.small]#[constructor]# | Construct from `basic_json` | link:#nlohmann-basic_json-0e-2constructor-03[`basic_json`] [.small]#[constructor]# | create a JSON value from an existing one | link:#nlohmann-basic_json-0e-2constructor-06[`basic_json`] [.small]#[constructor]# | //////////////////////////////////// | link:#nlohmann-basic_json-0e-2constructor-0ca[`basic_json`] [.small]#[constructor]# | create a JSON value from compatible types | link:#nlohmann-basic_json-0e-2constructor-0a8[`basic_json`] [.small]#[constructor]# | Constructor | link:#nlohmann-basic_json-0e-2constructor-05d[`basic_json`] [.small]#[constructor]# | construct a JSON container given an iterator range | link:#nlohmann-basic_json-0e-2constructor-0c93[`basic_json`] [.small]#[constructor]# | | link:#nlohmann-basic_json-0e-2destructor[`~basic_json`] [.small]#[destructor]# | Destructor | link:#nlohmann-basic_json-0e-operator_assign[`operator=`] | Assignment operator | link:#nlohmann-basic_json-0e-at-05d[`at`] | | link:#nlohmann-basic_json-0e-at-03e[`at`] | | link:#nlohmann-basic_json-0e-at-0e[`at`] | | link:#nlohmann-basic_json-0e-at-07[`at`] | | link:#nlohmann-basic_json-0e-at-08[`at`] | | link:#nlohmann-basic_json-0e-at-035[`at`] | | link:#nlohmann-basic_json-0e-at-058[`at`] | | link:#nlohmann-basic_json-0e-at-025[`at`] | | link:#nlohmann-basic_json-0e-at-050[`at`] | access specified object element with bounds checking | link:#nlohmann-basic_json-0e-at-02e[`at`] | access specified object element with bounds checking | link:#nlohmann-basic_json-0e-back-0f[`back`] | | link:#nlohmann-basic_json-0e-back-09[`back`] | | link:#nlohmann-basic_json-0e-begin-0a[`begin`] | | link:#nlohmann-basic_json-0e-begin-0e[`begin`] | | link:#nlohmann-basic_json-0e-cbegin[`cbegin`] | | link:#nlohmann-basic_json-0e-cend[`cend`] | | link:#nlohmann-basic_json-0e-clear[`clear`] | | link:#nlohmann-basic_json-0e-contains-03[`contains`] | | link:#nlohmann-basic_json-0e-contains-05[`contains`] | | link:#nlohmann-basic_json-0e-contains-00[`contains`] | | link:#nlohmann-basic_json-0e-contains-01[`contains`] | check the existence of an element in a JSON object | link:#nlohmann-basic_json-0e-count-0e[`count`] | | link:#nlohmann-basic_json-0e-count-06[`count`] | returns the number of occurrences of a key in a JSON object | link:#nlohmann-basic_json-0e-crbegin[`crbegin`] | | link:#nlohmann-basic_json-0e-crend[`crend`] | | link:#nlohmann-basic_json-0e-dump[`dump`] | | link:#nlohmann-basic_json-0e-emplace[`emplace`] | add an object to an object if key does not exist | link:#nlohmann-basic_json-0e-emplace_back[`emplace_back`] | add an object to an array | link:#nlohmann-basic_json-0e-empty[`empty`] | | link:#nlohmann-basic_json-0e-end-06[`end`] | | link:#nlohmann-basic_json-0e-end-0d[`end`] | | link:#nlohmann-basic_json-0e-erase-09[`erase`] | | link:#nlohmann-basic_json-0e-erase-01[`erase`] | | link:#nlohmann-basic_json-0e-erase-00[`erase`] | remove element given an iterator | link:#nlohmann-basic_json-0e-erase-0f[`erase`] | remove element from a JSON object given a key | link:#nlohmann-basic_json-0e-erase-08[`erase`] | remove elements given an iterator range | link:#nlohmann-basic_json-0e-find-0cc[`find`] | | link:#nlohmann-basic_json-0e-find-0e[`find`] | | link:#nlohmann-basic_json-0e-find-0c0[`find`] | find an element in a JSON object | link:#nlohmann-basic_json-0e-find-05[`find`] | find an element in a JSON object | link:#nlohmann-basic_json-0e-flatten[`flatten`] | | link:#nlohmann-basic_json-0e-front-00[`front`] | | link:#nlohmann-basic_json-0e-front-05[`front`] | | link:#nlohmann-basic_json-0e-get-0e[`get`] | get a pointer value (explicit) | link:#nlohmann-basic_json-0e-get-01[`get`] | get a (pointer) value (explicit) | link:#nlohmann-basic_json-0e-get_binary-0f[`get_binary`] | | link:#nlohmann-basic_json-0e-get_binary-02[`get_binary`] | | link:#nlohmann-basic_json-0e-get_ptr-08[`get_ptr`] | get a pointer value (implicit) | link:#nlohmann-basic_json-0e-get_ptr-09[`get_ptr`] | get a pointer value (implicit) | link:#nlohmann-basic_json-0e-get_ref-0c[`get_ref`] | get a reference value (implicit) | link:#nlohmann-basic_json-0e-get_ref-06[`get_ref`] | get a reference value (implicit) | link:#nlohmann-basic_json-0e-get_to-07[`get_to`] | get a value (explicit) | link:#nlohmann-basic_json-0e-get_to-09[`get_to`] | | link:#nlohmann-basic_json-0e-get_to-00[`get_to`] | | link:#nlohmann-basic_json-0e-insert-0d2[`insert`] | | link:#nlohmann-basic_json-0e-insert-0d9[`insert`] | | link:#nlohmann-basic_json-0e-insert-06[`insert`] | | link:#nlohmann-basic_json-0e-insert-01[`insert`] | | link:#nlohmann-basic_json-0e-insert-0c[`insert`] | | link:#nlohmann-basic_json-0e-insert-05[`insert`] | | link:#nlohmann-basic_json-0e-insert_iterator[`insert_iterator`] | Helper for insertion of an iterator | link:#nlohmann-basic_json-0e-is_array[`is_array`] | | link:#nlohmann-basic_json-0e-is_binary[`is_binary`] | | link:#nlohmann-basic_json-0e-is_boolean[`is_boolean`] | | link:#nlohmann-basic_json-0e-is_discarded[`is_discarded`] | | link:#nlohmann-basic_json-0e-is_null[`is_null`] | | link:#nlohmann-basic_json-0e-is_number[`is_number`] | | link:#nlohmann-basic_json-0e-is_number_float[`is_number_float`] | | link:#nlohmann-basic_json-0e-is_number_integer[`is_number_integer`] | | link:#nlohmann-basic_json-0e-is_number_unsigned[`is_number_unsigned`] | | link:#nlohmann-basic_json-0e-is_object[`is_object`] | | link:#nlohmann-basic_json-0e-is_primitive[`is_primitive`] | | link:#nlohmann-basic_json-0e-is_string[`is_string`] | | link:#nlohmann-basic_json-0e-is_structured[`is_structured`] | | link:#nlohmann-basic_json-0e-items-0a[`items`] | | link:#nlohmann-basic_json-0e-items-0d[`items`] | | link:#nlohmann-basic_json-0e-max_size[`max_size`] | | link:#nlohmann-basic_json-0e-merge_patch[`merge_patch`] | | link:#nlohmann-basic_json-0e-operator_plus_eq-0fb[`operator+=`] | Addition assignment operator | link:#nlohmann-basic_json-0e-operator_plus_eq-0f8b[`operator+=`] | Addition assignment operator | link:#nlohmann-basic_json-0e-operator_plus_eq-0f87[`operator+=`] | Addition assignment operator | link:#nlohmann-basic_json-0e-operator_plus_eq-05[`operator+=`] | Addition assignment operator | link:#nlohmann-basic_json-0e-operator_subs-010[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-0e-operator_subs-02[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-0e-operator_subs-0f[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-0e-operator_subs-04d[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-0e-operator_subs-0b[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-0e-operator_subs-03[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-0e-operator_subs-053[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-0e-operator_subs-07[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-0e-operator_subs-042[`operator[]`] | access specified object element | link:#nlohmann-basic_json-0e-operator_subs-014[`operator[]`] | access specified object element | link:#nlohmann-basic_json-0e-operator_subs-05c[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-0e-operator_subs-08[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-0e-patch[`patch`] | | link:#nlohmann-basic_json-0e-patch_inplace[`patch_inplace`] | | link:#nlohmann-basic_json-0e-push_back-0e[`push_back`] | | link:#nlohmann-basic_json-0e-push_back-09[`push_back`] | | link:#nlohmann-basic_json-0e-push_back-0c[`push_back`] | | link:#nlohmann-basic_json-0e-push_back-0a[`push_back`] | | link:#nlohmann-basic_json-0e-rbegin-03[`rbegin`] | | link:#nlohmann-basic_json-0e-rbegin-0a[`rbegin`] | | link:#nlohmann-basic_json-0e-rend-04[`rend`] | | link:#nlohmann-basic_json-0e-rend-05[`rend`] | | link:#nlohmann-basic_json-0e-size[`size`] | | link:#nlohmann-basic_json-0e-swap-0c[`swap`] | | link:#nlohmann-basic_json-0e-swap-010[`swap`] | | link:#nlohmann-basic_json-0e-swap-011[`swap`] | | link:#nlohmann-basic_json-0e-swap-06[`swap`] | | link:#nlohmann-basic_json-0e-swap-07[`swap`] | | link:#nlohmann-basic_json-0e-swap-09[`swap`] | | link:#nlohmann-basic_json-0e-type[`type`] | | link:#nlohmann-basic_json-0e-type_name[`type_name`] | | link:#nlohmann-basic_json-0e-unflatten[`unflatten`] | | link:#nlohmann-basic_json-0e-update-07[`update`] | | link:#nlohmann-basic_json-0e-update-0e[`update`] | | link:#nlohmann-basic_json-0e-value-0f[`value`] | access specified object element via JSON Pointer with default value | link:#nlohmann-basic_json-0e-value-019[`value`] | access specified object element with default value | link:#nlohmann-basic_json-0e-value-0a[`value`] | access specified object element via JSON Pointer with default value | link:#nlohmann-basic_json-0e-value-08[`value`] | access specified object element with default value | link:#nlohmann-basic_json-0e-value-04[`value`] | | link:#nlohmann-basic_json-0e-value-06[`value`] | access specified object element with default value | link:#nlohmann-basic_json-0e-value-012[`value`] | | link:#nlohmann-basic_json-0e-value-02[`value`] | access specified object element via JSON Pointer with default value | link:#nlohmann-basic_json-0e-2conversion-03[`operator ValueType`] | get a value (implicit) | link:#nlohmann-basic_json-0e-2conversion-0f[`operator value_t`] | Conversion to `value_t` | link:#nlohmann-basic_json-0e-operator_eq-0a[`operator==`] | comparison: equal | link:#nlohmann-basic_json-0e-operator_eq-0b[`operator==`] | Equality operator | link:#nlohmann-basic_json-0e-operator_not_eq[`operator!=`] | Inequality operator | link:#nlohmann-basic_json-0e-operator_3way-06[`operator<=>`] | comparison: 3‐way | link:#nlohmann-basic_json-0e-operator_3way-0b[`operator<=>`] | Three‐way comparison operator |=== == Static Member Functions [cols=2] |=== | Name | Description | link:#nlohmann-basic_json-0e-accept-0b[`accept`] | | link:#nlohmann-basic_json-0e-accept-09[`accept`] | check if the input is valid JSON | link:#nlohmann-basic_json-0e-accept-02[`accept`] | check if the input is valid JSON | link:#nlohmann-basic_json-0e-array[`array`] | | link:#nlohmann-basic_json-0e-binary-09[`binary`] | | link:#nlohmann-basic_json-0e-binary-08[`binary`] | | link:#nlohmann-basic_json-0e-binary-07[`binary`] | | link:#nlohmann-basic_json-0e-binary-05[`binary`] | | link:#nlohmann-basic_json-0e-diff[`diff`] | | link:#nlohmann-basic_json-0e-from_bjdata-0c[`from_bjdata`] | create a JSON value from an input in BJData format | link:#nlohmann-basic_json-0e-from_bjdata-0f[`from_bjdata`] | create a JSON value from an input in BJData format | link:#nlohmann-basic_json-0e-from_bson-01[`from_bson`] | | link:#nlohmann-basic_json-0e-from_bson-06[`from_bson`] | create a JSON value from an input in BSON format | link:#nlohmann-basic_json-0e-from_bson-08[`from_bson`] | create a JSON value from an input in BSON format | link:#nlohmann-basic_json-0e-from_bson-0d[`from_bson`] | | link:#nlohmann-basic_json-0e-from_cbor-0c[`from_cbor`] | | link:#nlohmann-basic_json-0e-from_cbor-05[`from_cbor`] | create a JSON value from an input in CBOR format | link:#nlohmann-basic_json-0e-from_cbor-0f[`from_cbor`] | create a JSON value from an input in CBOR format | link:#nlohmann-basic_json-0e-from_cbor-0d[`from_cbor`] | | link:#nlohmann-basic_json-0e-from_msgpack-08[`from_msgpack`] | | link:#nlohmann-basic_json-0e-from_msgpack-0c[`from_msgpack`] | create a JSON value from an input in MessagePack format | link:#nlohmann-basic_json-0e-from_msgpack-05[`from_msgpack`] | create a JSON value from an input in MessagePack format | link:#nlohmann-basic_json-0e-from_msgpack-04[`from_msgpack`] | | link:#nlohmann-basic_json-0e-from_ubjson-0b[`from_ubjson`] | | link:#nlohmann-basic_json-0e-from_ubjson-09[`from_ubjson`] | create a JSON value from an input in UBJSON format | link:#nlohmann-basic_json-0e-from_ubjson-0c[`from_ubjson`] | create a JSON value from an input in UBJSON format | link:#nlohmann-basic_json-0e-from_ubjson-0d[`from_ubjson`] | | link:#nlohmann-basic_json-0e-get_allocator[`get_allocator`] | | link:#nlohmann-basic_json-0e-iterator_wrapper-06[`iterator_wrapper`] | | link:#nlohmann-basic_json-0e-iterator_wrapper-0f[`iterator_wrapper`] | | link:#nlohmann-basic_json-0e-meta[`meta`] | | link:#nlohmann-basic_json-0e-object[`object`] | | link:#nlohmann-basic_json-0e-parse-08[`parse`] | | link:#nlohmann-basic_json-0e-parse-09[`parse`] | deserialize from a compatible input | link:#nlohmann-basic_json-0e-parse-01[`parse`] | deserialize from a pair of character iterators | link:#nlohmann-basic_json-0e-sax_parse-00[`sax_parse`] | generate SAX events | link:#nlohmann-basic_json-0e-sax_parse-08[`sax_parse`] | generate SAX events | link:#nlohmann-basic_json-0e-sax_parse-0b[`sax_parse`] | generate SAX events | link:#nlohmann-basic_json-0e-to_bjdata-0d[`to_bjdata`] | | link:#nlohmann-basic_json-0e-to_bjdata-02[`to_bjdata`] | | link:#nlohmann-basic_json-0e-to_bjdata-04[`to_bjdata`] | | link:#nlohmann-basic_json-0e-to_bson-07[`to_bson`] | | link:#nlohmann-basic_json-0e-to_bson-00[`to_bson`] | | link:#nlohmann-basic_json-0e-to_bson-0b[`to_bson`] | | link:#nlohmann-basic_json-0e-to_cbor-0b[`to_cbor`] | | link:#nlohmann-basic_json-0e-to_cbor-020b[`to_cbor`] | | link:#nlohmann-basic_json-0e-to_cbor-0204[`to_cbor`] | | link:#nlohmann-basic_json-0e-to_msgpack-0d[`to_msgpack`] | | link:#nlohmann-basic_json-0e-to_msgpack-00[`to_msgpack`] | | link:#nlohmann-basic_json-0e-to_msgpack-05[`to_msgpack`] | | link:#nlohmann-basic_json-0e-to_ubjson-0a[`to_ubjson`] | | link:#nlohmann-basic_json-0e-to_ubjson-0f[`to_ubjson`] | | link:#nlohmann-basic_json-0e-to_ubjson-0b[`to_ubjson`] | |=== == Friends [cols=2] |=== | Name | Description | `link:#nlohmann-operator_rshift-02[nlohmann::operator>>]` | deserialize from stream | `link:#nlohmann-operator_lshift-053[nlohmann::operator<<]` | deserialize from stream | `link:#nlohmann-operator_rshift-08[nlohmann::operator>>]` | serialize to stream | `link:#nlohmann-operator_lshift-01[nlohmann::operator<<]` | serialize to stream | `link:#nlohmann-swap-05[nlohmann::swap]` | exchanges the values | `nlohmann::detail::exception` | general exception of the `basic_json` class | `nlohmann::detail::serializer` | | `link:#nlohmann-json_pointer-0a[nlohmann::json_pointer]` | JSON Pointer defines a string syntax for identifying a specific value within a JSON document |=== the allocator type == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using allocator_type = allocator<basic_json>; ---- a type for an array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using array_t = vector<basic_json, allocator<basic_json>>; ---- a type for a packed binary type == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using binary_t = link:#nlohmann-byte_container_with_subtype-04[nlohmann::byte_container_with_subtype<vector<unsigned char>>]; ---- how to encode BJData == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using bjdata_version_t = detail::bjdata_version_t; ---- a type for a boolean == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using boolean_t = bool; ---- how to treat CBOR tags == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using cbor_tag_handler_t = detail::cbor_tag_handler_t; ---- a const iterator for a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using const_iterator = link:#nlohmann-basic_json-0e[iter_impl<basic_json const>]; ---- the type of an element const pointer == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using const_pointer = std::allocator_traits<allocator_type>::const_pointer; ---- the type of an element const reference == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using const_reference = link:#nlohmann-basic_json-0e-value_type[value_type] const&; ---- a const reverse iterator for a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using const_reverse_iterator = link:#nlohmann-basic_json-0e[json_reverse_iterator<basic_json::const_iterator>]; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using default_object_comparator_t = std::less; ---- a type to represent differences between iterators == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- how to treat decoding errors == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using error_handler_t = detail::error_handler_t; ---- Classes to implement user‐defined exceptions. @{ == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using exception = detail::exception; ---- helper type for initializer lists of basic_json values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using initializer_list_t = std::initializer_list<detail::json_ref<basic_json>>; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using input_format_t = detail::input_format_t; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using invalid_iterator = detail::invalid_iterator; ---- an iterator for a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using iterator = link:#nlohmann-basic_json-0e[iter_impl<basic_json>]; ---- JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using json_pointer = link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<basic_string<char>>]; ---- SAX interface type, see `nlohmann::json_sax` == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using json_sax_t = json_sax<basic_json>; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, typename SFINAE> using json_serializer = link:#nlohmann-adl_serializer[adl_serializer<T, SFINAE>]; ---- a type for a number (floating‐point) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using number_float_t = double; ---- a type for a number (integer) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using number_integer_t = long long; ---- a type for a number (unsigned) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using number_unsigned_t = unsigned long long; ---- object key comparator type == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using object_comparator_t = detail::actual_object_comparator_t<basic_json>; ---- a type for an object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using object_t = map<basic_string<char>, basic_json, default_object_comparator_t, allocator<std::pair<basic_string<char> const, basic_json>>>; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using other_error = detail::other_error; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using out_of_range = detail::out_of_range; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using parse_error = detail::parse_error; ---- parser event types == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using parse_event_t = detail::parse_event_t; ---- per‐element parser callback type == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using parser_callback_t = detail::parser_callback_t<basic_json>; ---- the type of an element pointer == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using pointer = std::allocator_traits<allocator_type>::pointer; ---- the type of an element reference == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using reference = link:#nlohmann-basic_json-0e-value_type[value_type]&; ---- a reverse iterator for a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using reverse_iterator = link:#nlohmann-basic_json-0e[json_reverse_iterator<basic_json::iterator>]; ---- a type to represent container sizes == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using size_type = std::size_t; ---- a type for a string == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using string_t = basic_string<char>; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using type_error = detail::type_error; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using value_t = detail::value_t; ---- the type of elements in a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using value_type = link:#nlohmann-basic_json-00[basic_json]; ---- Construct from `nullptr_t` == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json(std::nullptr_t value = nullptr) noexcept; ---- == Parameters [cols=2] |=== | Name | Description | *value* | The object to construct from |=== Construct from `value_t` == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json(link:#nlohmann-basic_json-00-value_t[value_t] const v); ---- == Parameters [cols=2] |=== | Name | Description | *v* | The object to construct from |=== Construct from `basic_json` == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json(link:#nlohmann-basic_json-00[basic_json] const& other); ---- == Parameters [cols=2] |=== | Name | Description | *other* | The object to copy construct from |=== Construct from `basic_json` == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json(link:#nlohmann-basic_json-00[basic_json]&& other) noexcept; ---- == Parameters [cols=2] |=== | Name | Description | *other* | The object to move construct from |=== create a JSON value from an existing one == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value&& !std::is_same<basic_json, BasicJsonType>::value basic_json(BasicJsonType const& val); ---- == Parameters [cols=2] |=== | Name | Description | *val* | The object to copy construct from |=== //////////////////////////////////// == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename JsonRef> requires detail::conjunction<detail::is_json_ref<JsonRef>, std::is_same<typename JsonRef::value_type, basic_json>>::value basic_json(JsonRef const& ref); ---- == Parameters [cols=2] |=== | Name | Description | *ref* | The object to copy construct from |=== create a JSON value from compatible types == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename CompatibleType, typename U = detail::uncvref_t<CompatibleType>> requires !detail::is_basic_json<U>::value && detail::is_compatible_type<basic_json_t, U>::value basic_json(CompatibleType&& val) noexcept(noexcept(JSONSerializer<U, void>::to_json(std::declval<basic_json_t &>(), std::forward<CompatibleType>(val)))); ---- == Parameters [cols=2] |=== | Name | Description | *val* | The object to move construct from |=== Constructor == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json( link:#nlohmann-basic_json-00-size_type[size_type] cnt, link:#nlohmann-basic_json-00[basic_json] const& val); ---- == Parameters [cols=2] |=== | Name | Description | *cnt* | The object to construct from | *val* | a class to store JSON values |=== construct a JSON container given an iterator range == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class InputIT> requires std::is_same<InputIT, typename basic_json_t::iterator>::value || std::is_same<InputIT, typename basic_json_t::const_iterator>::value basic_json( InputIT first, InputIT last); ---- == Parameters [cols=2] |=== | Name | Description | *first* | The object to construct from |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json( link:#nlohmann-basic_json-0e-initializer_list_t[initializer_list_t] init, bool type_deduction = true, link:#nlohmann-basic_json-00-value_t[value_t] manual_type = value_t::array); ---- Destructor == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- ~basic_json() noexcept; ---- Assignment operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00[basic_json]& operator=(link:#nlohmann-basic_json-00[basic_json] other) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value && std::is_nothrow_move_assignable<json_base_class_t>::value); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *other* | The object to assign from |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] at(link:#nlohmann-basic_json-00-size_type[size_type] idx); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reference[const_reference] at(link:#nlohmann-basic_json-00-size_type[size_type] idx) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] at(link:#nlohmann-basic_json-0e-json_pointer[json_pointer] const& ptr); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reference[const_reference] at(link:#nlohmann-basic_json-0e-json_pointer[json_pointer] const& ptr) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] at(object_t::key_type const& key); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reference[const_reference] at(object_t::key_type const& key) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value [[__deprecated__]] link:#nlohmann-basic_json-0e-reference[reference] at(link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value [[__deprecated__]] link:#nlohmann-basic_json-0e-const_reference[const_reference] at(link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr) const; ---- access specified object element with bounds checking == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-0e-reference[reference] at(KeyType&& key); ---- == Return Value the type of an element reference access specified object element with bounds checking == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-0e-const_reference[const_reference] at(KeyType&& key) const; ---- == Return Value the type of an element const reference == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] back(); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reference[const_reference] back() const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-iterator[iterator] begin() noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_iterator[const_iterator] begin() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_iterator[const_iterator] cbegin() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_iterator[const_iterator] cend() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void clear() noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool contains(link:#nlohmann-basic_json-0e-json_pointer[json_pointer] const& ptr) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool contains(object_t::key_type const& key) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value [[__deprecated__]] bool contains(link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr) const; ---- check the existence of an element in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value bool contains(KeyType&& key) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-size_type[size_type] count(object_t::key_type const& key) const; ---- returns the number of occurrences of a key in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-0e-size_type[size_type] count(KeyType&& key) const; ---- == Return Value a type to represent container sizes == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reverse_iterator[const_reverse_iterator] crbegin() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reverse_iterator[const_reverse_iterator] crend() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-string_t[string_t] dump( int const indent = ‐1, char const indent_char = ' ', bool const ensure_ascii = false, link:#nlohmann-basic_json-00-error_handler_t[error_handler_t] const error_handler = error_handler_t::strict) const; ---- add an object to an object if key does not exist == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class... Args> std::pair<iterator, bool> emplace(Args...&&... args); ---- add an object to an array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class... Args> link:#nlohmann-basic_json-0e-reference[reference] emplace_back(Args...&&... args); ---- == Return Value the type of an element reference == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool empty() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-iterator[iterator] end() noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_iterator[const_iterator] end() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void erase(link:#nlohmann-basic_json-00-size_type[size_type] const idx); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-size_type[size_type] erase(object_t::key_type const& key); ---- remove element given an iterator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class IteratorType> requires std::is_same<IteratorType, typename basic_json_t::iterator>::value || std::is_same<IteratorType, typename basic_json_t::const_iterator>::value IteratorType erase(IteratorType pos); ---- remove element from a JSON object given a key == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-0e-size_type[size_type] erase(KeyType&& key); ---- == Return Value a type to represent container sizes remove elements given an iterator range == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class IteratorType> requires std::is_same<IteratorType, typename basic_json_t::iterator>::value || std::is_same<IteratorType, typename basic_json_t::const_iterator>::value IteratorType erase( IteratorType first, IteratorType last); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-iterator[iterator] find(object_t::key_type const& key); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_iterator[const_iterator] find(object_t::key_type const& key) const; ---- find an element in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-0e-const_iterator[const_iterator] find(KeyType&& key) const; ---- == Return Value a const iterator for a basic_json container find an element in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-0e-iterator[iterator] find(KeyType&& key); ---- == Return Value an iterator for a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00[basic_json] flatten() const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] front(); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reference[const_reference] front() const; ---- get a pointer value (explicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename PointerType> requires std::is_pointer<PointerType>::value decltype(std::declval<basic_json_t&>().template get_ptr<PointerType>()) get() noexcept; ---- == Description Explicit pointer access to the internally stored JSON value. No copies are made. [WARNING] The pointer becomes invalid if the underlying JSON object changes. Constant. {The example below shows how pointers to internal values of a JSON value can be requested. Note that no type conversions are made and a `nullptr` is returned if the value and the requested pointer type does not match.,get_PointerType} == Return Value pointer to the internally stored JSON value if the requested pointer type _PointerType_ fits to the JSON value; `nullptr` otherwise == Template Parameters [cols=2] |=== | Name | Description | *PointerType* | pointer type; must be a pointer to link:#nlohmann-basic_json-0e-array_t[`array_t`], link:#nlohmann-basic_json-0e-object_t[`object_t`], link:#nlohmann-basic_json-0e-string_t[`string_t`], link:#nlohmann-basic_json-0e-boolean_t[`boolean_t`], link:#nlohmann-basic_json-0e-number_integer_t[`number_integer_t`], link:#nlohmann-basic_json-0e-number_unsigned_t[`number_unsigned_t`], or link:#nlohmann-basic_json-0e-number_float_t[`number_float_t`]. |=== get a (pointer) value (explicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>> constexpr decltype(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {})) get() const noexcept(noexcept(std::declval<const basic_json_t &>().template get_impl<ValueType>(detail::priority_tag<4>{}))); ---- == Description Performs explicit type conversion between the JSON value and a compatible value if required. ‐ If the requested type is a pointer to the internally stored JSON value that pointer is returned. No copies are made. ‐ If the requested type is the current link:#nlohmann-basic_json-0e-2constructor-0ab[`basic_json`], or a different link:#nlohmann-basic_json-0e-2constructor-0ab[`basic_json`] convertible from the current link:#nlohmann-basic_json-0e-2constructor-0ab[`basic_json`]. ‐ Otherwise the value is converted by calling the link:#nlohmann-basic_json-0e-json_serializer[`json_serializer<ValueType>`] `from_json()` method. == Exceptions [cols=2] |=== | Name | Thrown on | `what` | link:#nlohmann-basic_json-0e-json_serializer[`json_serializer<ValueType>`] `from_json()` method throws if conversion is required |=== == Return Value copy of the JSON value, converted to == Template Parameters [cols=2] |=== | Name | Description | *ValueTypeCV* | the provided value type | *ValueType* | the returned value type | *ValueType* | if necessary |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-binary_t[binary_t]& get_binary(); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-binary_t[binary_t] const& get_binary() const; ---- get a pointer value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename PointerType> requires std::is_pointer<PointerType>::value&& std::is_const<typename std::remove_pointer<PointerType>::type>::value constexpr decltype(std::declval<const basic_json_t&>().get_impl_ptr(std::declval<PointerType>())) get_ptr() const noexcept; ---- get a pointer value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename PointerType> requires std::is_pointer<PointerType>::value decltype(std::declval<basic_json_t&>().get_impl_ptr(std::declval<PointerType>())) get_ptr() noexcept; ---- get a reference value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ReferenceType> requires std::is_reference<ReferenceType>::value ReferenceType get_ref(); ---- get a reference value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ReferenceType> requires std::is_reference<ReferenceType>::value&& std::is_const<typename std::remove_reference<ReferenceType>::type>::value ReferenceType get_ref() const; ---- get a value (explicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ValueType> requires !detail::is_basic_json<ValueType>::value&& detail::has_from_json<basic_json_t, ValueType>::value ValueType& get_to(ValueType& v) const noexcept(noexcept(JSONSerializer<ValueType, void>::from_json(std::declval<const basic_json_t &>(), v))); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ValueType> requires detail::is_basic_json<ValueType>::value ValueType& get_to(ValueType& v) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, std::size_t N, typename Array = T(&)[]> requires detail::has_from_json<basic_json_t, Array>::value Array get_to(T(& v)[]) const noexcept(noexcept(JSONSerializer<Array, void>::from_json(std::declval<const basic_json_t &>(), v))); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void insert( link:#nlohmann-basic_json-0e-const_iterator[const_iterator] first, link:#nlohmann-basic_json-0e-const_iterator[const_iterator] last); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-iterator[iterator] insert( link:#nlohmann-basic_json-0e-const_iterator[const_iterator] pos, link:#nlohmann-basic_json-0e-initializer_list_t[initializer_list_t] ilist); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-iterator[iterator] insert( link:#nlohmann-basic_json-0e-const_iterator[const_iterator] pos, link:#nlohmann-basic_json-00[basic_json] const& val); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-iterator[iterator] insert( link:#nlohmann-basic_json-0e-const_iterator[const_iterator] pos, link:#nlohmann-basic_json-00[basic_json]&& val); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-iterator[iterator] insert( link:#nlohmann-basic_json-0e-const_iterator[const_iterator] pos, link:#nlohmann-basic_json-0e-const_iterator[const_iterator] first, link:#nlohmann-basic_json-0e-const_iterator[const_iterator] last); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-iterator[iterator] insert( link:#nlohmann-basic_json-0e-const_iterator[const_iterator] pos, link:#nlohmann-basic_json-00-size_type[size_type] cnt, link:#nlohmann-basic_json-00[basic_json] const& val); ---- Helper for insertion of an iterator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename... Args> link:#nlohmann-basic_json-0e-iterator[iterator] insert_iterator( link:#nlohmann-basic_json-0e-const_iterator[const_iterator] pos, Args...&&... args); ---- == Description [NOTE] : This uses std::distance to support GCC 4.8, see https://github.com/nlohmann/json/pull/1257 == Return Value an iterator for a basic_json container == Parameters [cols=2] |=== | Name | Description | *pos* | a const iterator for a basic_json container |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_array() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_binary() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_boolean() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_discarded() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_null() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_number() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_number_float() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_number_integer() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_number_unsigned() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_object() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_primitive() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_string() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_structured() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e[iteration_proxy<iterator>] items() noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e[iteration_proxy<const_iterator>] items() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-size_type[size_type] max_size() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void merge_patch(link:#nlohmann-basic_json-00[basic_json] const& apply_patch); ---- Addition assignment operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] operator+=(link:#nlohmann-basic_json-0e-initializer_list_t[initializer_list_t] init); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *init* | The right operand |=== Addition assignment operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] operator+=(object_t::value_type const& val); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *val* | The right operand |=== Addition assignment operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] operator+=(link:#nlohmann-basic_json-00[basic_json] const& val); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *val* | The right operand |=== Addition assignment operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] operator+=(link:#nlohmann-basic_json-00[basic_json]&& val); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *val* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] operator[](object_t::key_type key); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] operator[](link:#nlohmann-basic_json-00-size_type[size_type] idx); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *idx* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reference[const_reference] operator[](link:#nlohmann-basic_json-00-size_type[size_type] idx) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *idx* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reference[reference] operator[](link:#nlohmann-basic_json-0e-json_pointer[json_pointer] const& ptr); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *ptr* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reference[const_reference] operator[](link:#nlohmann-basic_json-0e-json_pointer[json_pointer] const& ptr) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *ptr* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reference[const_reference] operator[](object_t::key_type const& key) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value [[__deprecated__]] link:#nlohmann-basic_json-0e-const_reference[const_reference] operator[](link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *ptr* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value [[__deprecated__]] link:#nlohmann-basic_json-0e-reference[reference] operator[](link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *ptr* | The right operand |=== access specified object element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-0e-reference[reference] operator[](KeyType&& key); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== access specified object element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-0e-const_reference[const_reference] operator[](KeyType&& key) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> link:#nlohmann-basic_json-0e-reference[reference] operator[](T* key); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> link:#nlohmann-basic_json-0e-const_reference[const_reference] operator[](T* key) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00[basic_json] patch(link:#nlohmann-basic_json-00[basic_json] const& json_patch) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void patch_inplace(link:#nlohmann-basic_json-00[basic_json] const& json_patch); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void push_back(link:#nlohmann-basic_json-0e-initializer_list_t[initializer_list_t] init); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void push_back(object_t::value_type const& val); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void push_back(link:#nlohmann-basic_json-00[basic_json] const& val); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void push_back(link:#nlohmann-basic_json-00[basic_json]&& val); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reverse_iterator[reverse_iterator] rbegin() noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reverse_iterator[const_reverse_iterator] rbegin() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-reverse_iterator[reverse_iterator] rend() noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-0e-const_reverse_iterator[const_reverse_iterator] rend() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-size_type[size_type] size() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-basic_json-0e-reference[reference] other) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-basic_json-0e-array_t[array_t]& other); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-basic_json-0e-binary_t[binary_t]& other); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-byte_container_with_subtype-09-container_type[binary_t::container_type]& other); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-basic_json-0e-object_t[object_t]& other); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-basic_json-0e-string_t[string_t]& other); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr link:#nlohmann-basic_json-00-value_t[value_t] type() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__returns_nonnull__]] char const* type_name() const noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00[basic_json] unflatten() const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void update( link:#nlohmann-basic_json-0e-const_reference[const_reference] j, bool merge_objects = false); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void update( link:#nlohmann-basic_json-0e-const_iterator[const_iterator] first, link:#nlohmann-basic_json-0e-const_iterator[const_iterator] last, bool merge_objects = false); ---- access specified object element via JSON Pointer with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ValueType> requires detail::is_getable<basic_json_t, ValueType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ValueType value( link:#nlohmann-basic_json-0e-json_pointer[json_pointer] const& ptr, ValueType const& default_value) const; ---- == Parameters [cols=2] |=== | Name | Description | *ptr* | JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] |=== access specified object element with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ValueType> requires !detail::is_transparent<object_comparator_t>::value && detail::is_getable<basic_json_t, ValueType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ValueType value( object_t::key_type const& key, ValueType const& default_value) const; ---- access specified object element via JSON Pointer with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class ReturnType = value_return_type<ValueType>::type> requires detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ReturnType value( link:#nlohmann-basic_json-0e-json_pointer[json_pointer] const& ptr, ValueType&& default_value) const; ---- == Parameters [cols=2] |=== | Name | Description | *ptr* | JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] |=== access specified object element with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class ReturnType = value_return_type<ValueType>::type> requires !detail::is_transparent<object_comparator_t>::value && detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ReturnType value( object_t::key_type const& key, ValueType&& default_value) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value && detail::is_getable<basic_json_t, ValueType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value [[__deprecated__]] ValueType value( link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr, ValueType const& default_value) const; ---- access specified object element with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class KeyType> requires detail::is_transparent<object_comparator_t>::value && !detail::is_json_pointer<KeyType>::value && is_comparable_with_object_key<KeyType>::value && detail::is_getable<basic_json_t, ValueType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ValueType value( KeyType&& key, ValueType const& default_value) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class BasicJsonType, class ReturnType = value_return_type<ValueType>::type> requires detail::is_basic_json<BasicJsonType>::value && detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value [[__deprecated__]] ReturnType value( link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr, ValueType&& default_value) const; ---- access specified object element via JSON Pointer with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class KeyType, class ReturnType = value_return_type<ValueType>::type> requires detail::is_transparent<object_comparator_t>::value && !detail::is_json_pointer<KeyType>::value && is_comparable_with_object_key<KeyType>::value && detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ReturnType value( KeyType&& key, ValueType&& default_value) const; ---- get a value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ValueType> requires detail::conjunction < detail::negation<std::is_pointer<ValueType>>, detail::negation<std::is_same<ValueType, std::nullptr_t>>, detail::negation<std::is_same<ValueType, detail::json_ref<basic_json>>>, detail::negation<std::is_same<ValueType, typename string_t::value_type>>, detail::negation<detail::is_basic_json<ValueType>>, detail::negation<std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>>, #if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1910 && _MSC_VER <= 1914)) detail::negation<std::is_same<ValueType, std::string_view>>, #endif #if defined(JSON_HAS_CPP_17) && JSON_HAS_STATIC_RTTI detail::negation<std::is_same<ValueType, std::any>>, #endif detail::is_detected_lazy<detail::get_template_function, const basic_json_t&, ValueType> >::value operator ValueType() const; ---- == Description Implicit type conversion between the JSON value and a compatible value. The call is realized by calling link:#nlohmann-basic_json-0e-get-01[`get() const`]. Linear in the size of the JSON value. {The example below shows several conversions from JSON values to other types. There a few things to note: (1) Floating‐point numbers can be converted to integers, (2) A JSON array can be converted to a standard `std::vector<short>`, (3) A JSON object can be converted to C++ associative containers such as `std::unordered_map<std::string, json>`.,operator_ValueType} == Exceptions [cols=2] |=== | Name | Thrown on | `type_error.302` | in case passed type _ValueType_ is incompatible to the JSON value type (e.g., the JSON value is of type boolean, but a string is requested); see example below |=== == Return Value copy of the JSON value, converted to type _ValueType_ == Template Parameters [cols=2] |=== | Name | Description | *ValueType* | non‐pointer type compatible to the JSON value, for instance `int` for JSON integer numbers, `bool` for JSON booleans, or `std::vector` types for JSON arrays. The character type of link:#nlohmann-basic_json-0e-string_t[`string_t`] as well as an initializer list of this type is excluded to avoid ambiguities as these types implicitly convert to `std::string`. |=== Conversion to `value_t` == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr operator link:#nlohmann-basic_json-00-value_t[value_t]() const noexcept; ---- == Return Value The object converted to `value_t` comparison: equal == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ScalarType> requires std::is_scalar_v<ScalarType> bool operator==(ScalarType rhs) const noexcept; ---- == Return Value `true` if the objects are equal, `false` otherwise == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== Equality operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool operator==(link:#nlohmann-basic_json-0e-const_reference[const_reference] rhs) const noexcept; ---- == Return Value `true` if the objects are equal, `false` otherwise == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== Inequality operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool operator!=(link:#nlohmann-basic_json-0e-const_reference[const_reference] rhs) const noexcept; ---- == Return Value `true` if the objects are not equal, `false` otherwise == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== comparison: 3‐way == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ScalarType> requires std::is_scalar_v<ScalarType> std::partial_ordering operator<=>(ScalarType rhs) const noexcept; ---- == Return Value The relative order of the objects == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== Three‐way comparison operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::partial_ordering operator<=>(link:#nlohmann-basic_json-0e-const_reference[const_reference] rhs) const noexcept; ---- == Return Value The relative order of the objects == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static bool accept( detail::span_input_adapter&& i, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- check if the input is valid JSON == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> static bool accept( InputType&& i, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- check if the input is valid JSON == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> static bool accept( IteratorType first, IteratorType last, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] array(link:#nlohmann-basic_json-0e-initializer_list_t[initializer_list_t] init = {}); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] binary(link:#nlohmann-byte_container_with_subtype-09-container_type[binary_t::container_type] const& init); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] binary(link:#nlohmann-byte_container_with_subtype-09-container_type[binary_t::container_type]&& init); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] binary( link:#nlohmann-byte_container_with_subtype-09-container_type[binary_t::container_type] const& init, link:#nlohmann-byte_container_with_subtype-09-subtype_type[binary_t::subtype_type] subtype); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] binary( link:#nlohmann-byte_container_with_subtype-09-container_type[binary_t::container_type]&& init, link:#nlohmann-byte_container_with_subtype-09-subtype_type[binary_t::subtype_type] subtype); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] diff( link:#nlohmann-basic_json-00[basic_json] const& source, link:#nlohmann-basic_json-00[basic_json] const& target, link:#nlohmann-basic_json-0e-string_t[string_t] const& path = ""); ---- create a JSON value from an input in BJData format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_bjdata( InputType&& i, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values create a JSON value from an input in BJData format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_bjdata( IteratorType first, IteratorType last, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_bson( detail::span_input_adapter&& i, bool const strict = true, bool const allow_exceptions = true); ---- create a JSON value from an input in BSON format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_bson( InputType&& i, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values create a JSON value from an input in BSON format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_bson( IteratorType first, IteratorType last, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_bson( T const* ptr, std::size_t len, bool const strict = true, bool const allow_exceptions = true); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_cbor( detail::span_input_adapter&& i, bool const strict = true, bool const allow_exceptions = true, link:#nlohmann-basic_json-00-cbor_tag_handler_t[cbor_tag_handler_t] const tag_handler = cbor_tag_handler_t::error); ---- create a JSON value from an input in CBOR format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_cbor( InputType&& i, bool const strict = true, bool const allow_exceptions = true, link:#nlohmann-basic_json-00-cbor_tag_handler_t[cbor_tag_handler_t] const tag_handler = cbor_tag_handler_t::error); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *tag_handler* | how to treat CBOR tags |=== create a JSON value from an input in CBOR format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_cbor( IteratorType first, IteratorType last, bool const strict = true, bool const allow_exceptions = true, link:#nlohmann-basic_json-00-cbor_tag_handler_t[cbor_tag_handler_t] const tag_handler = cbor_tag_handler_t::error); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *tag_handler* | how to treat CBOR tags |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_cbor( T const* ptr, std::size_t len, bool const strict = true, bool const allow_exceptions = true, link:#nlohmann-basic_json-00-cbor_tag_handler_t[cbor_tag_handler_t] const tag_handler = cbor_tag_handler_t::error); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_msgpack( detail::span_input_adapter&& i, bool const strict = true, bool const allow_exceptions = true); ---- create a JSON value from an input in MessagePack format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_msgpack( InputType&& i, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values create a JSON value from an input in MessagePack format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_msgpack( IteratorType first, IteratorType last, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_msgpack( T const* ptr, std::size_t len, bool const strict = true, bool const allow_exceptions = true); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_ubjson( detail::span_input_adapter&& i, bool const strict = true, bool const allow_exceptions = true); ---- create a JSON value from an input in UBJSON format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_ubjson( InputType&& i, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values create a JSON value from an input in UBJSON format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_ubjson( IteratorType first, IteratorType last, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_ubjson( T const* ptr, std::size_t len, bool const strict = true, bool const allow_exceptions = true); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static link:#nlohmann-basic_json-0e-allocator_type[allocator_type] get_allocator(); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] static link:#nlohmann-basic_json-0e[iteration_proxy<const_iterator>] iterator_wrapper(link:#nlohmann-basic_json-0e-const_reference[const_reference] ref) noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] static link:#nlohmann-basic_json-0e[iteration_proxy<iterator>] iterator_wrapper(link:#nlohmann-basic_json-0e-reference[reference] ref) noexcept; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] meta(); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] object(link:#nlohmann-basic_json-0e-initializer_list_t[initializer_list_t] init = {}); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] parse( detail::span_input_adapter&& i, link:#nlohmann-basic_json-0e-parser_callback_t[parser_callback_t] cb = nullptr, bool const allow_exceptions = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- deserialize from a compatible input == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] parse( InputType&& i, link:#nlohmann-basic_json-0e-parser_callback_t[parser_callback_t] cb = nullptr, bool const allow_exceptions = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *cb* | per‐element parser callback type |=== deserialize from a pair of character iterators == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] parse( IteratorType first, IteratorType last, link:#nlohmann-basic_json-0e-parser_callback_t[parser_callback_t] cb = nullptr, bool const allow_exceptions = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *cb* | per‐element parser callback type |=== generate SAX events == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename SAX> [[__deprecated__, __nonnull__]] static bool sax_parse( detail::span_input_adapter&& i, SAX* sax, link:#nlohmann-basic_json-00-input_format_t[input_format_t] format = input_format_t::json, bool const strict = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- generate SAX events == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename InputType, typename SAX> [[__nonnull__]] static bool sax_parse( InputType&& i, SAX* sax, link:#nlohmann-basic_json-00-input_format_t[input_format_t] format = input_format_t::json, bool const strict = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- generate SAX events == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class IteratorType, class SAX> [[__nonnull__]] static bool sax_parse( IteratorType first, IteratorType last, SAX* sax, link:#nlohmann-basic_json-00-input_format_t[input_format_t] format = input_format_t::json, bool const strict = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::vector<uint8_t> to_bjdata( link:#nlohmann-basic_json-00[basic_json] const& j, bool const use_size = false, bool const use_type = false, link:#nlohmann-basic_json-00-bjdata_version_t[bjdata_version_t] const version = bjdata_version_t::draft2); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_bjdata( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<uint8_t> o, bool const use_size = false, bool const use_type = false, link:#nlohmann-basic_json-00-bjdata_version_t[bjdata_version_t] const version = bjdata_version_t::draft2); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_bjdata( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<char> o, bool const use_size = false, bool const use_type = false, link:#nlohmann-basic_json-00-bjdata_version_t[bjdata_version_t] const version = bjdata_version_t::draft2); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::vector<uint8_t> to_bson(link:#nlohmann-basic_json-00[basic_json] const& j); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_bson( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<uint8_t> o); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_bson( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<char> o); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::vector<uint8_t> to_cbor(link:#nlohmann-basic_json-00[basic_json] const& j); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_cbor( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<uint8_t> o); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_cbor( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<char> o); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::vector<uint8_t> to_msgpack(link:#nlohmann-basic_json-00[basic_json] const& j); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_msgpack( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<uint8_t> o); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_msgpack( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<char> o); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::vector<uint8_t> to_ubjson( link:#nlohmann-basic_json-00[basic_json] const& j, bool const use_size = false, bool const use_type = false); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_ubjson( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<uint8_t> o, bool const use_size = false, bool const use_type = false); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_ubjson( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<char> o, bool const use_size = false, bool const use_type = false); ---- 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 nlohmann::detail::json_base_class<CustomBaseClass> ---- == Base Classes [cols=2] |=== | Name | Description | `nlohmann::detail::json_base_class<CustomBaseClass>` | |=== == Types [cols=2] |=== | Name | Description | link:#nlohmann-basic_json-00-allocator_type[`allocator_type`] | the allocator type | link:#nlohmann-basic_json-00-array_t[`array_t`] | a type for an array | link:#nlohmann-basic_json-00-binary_t[`binary_t`] | a type for a packed binary type | link:#nlohmann-basic_json-00-bjdata_version_t[`bjdata_version_t`] | how to encode BJData | link:#nlohmann-basic_json-00-boolean_t[`boolean_t`] | a type for a boolean | link:#nlohmann-basic_json-00-cbor_tag_handler_t[`cbor_tag_handler_t`] | how to treat CBOR tags | link:#nlohmann-basic_json-00-const_iterator[`const_iterator`] | a const iterator for a basic_json container | link:#nlohmann-basic_json-00-const_pointer[`const_pointer`] | the type of an element const pointer | link:#nlohmann-basic_json-00-const_reference[`const_reference`] | the type of an element const reference | link:#nlohmann-basic_json-00-const_reverse_iterator[`const_reverse_iterator`] | a const reverse iterator for a basic_json container | link:#nlohmann-basic_json-00-default_object_comparator_t[`default_object_comparator_t`] | | link:#nlohmann-basic_json-00-difference_type[`difference_type`] | a type to represent differences between iterators | link:#nlohmann-basic_json-00-error_handler_t[`error_handler_t`] | how to treat decoding errors | link:#nlohmann-basic_json-00-exception[`exception`] | Classes to implement user‐defined exceptions. @{ | link:#nlohmann-basic_json-00-initializer_list_t[`initializer_list_t`] | helper type for initializer lists of basic_json values | link:#nlohmann-basic_json-00-input_format_t[`input_format_t`] | | link:#nlohmann-basic_json-00-invalid_iterator[`invalid_iterator`] | | link:#nlohmann-basic_json-00-iterator[`iterator`] | an iterator for a basic_json container | link:#nlohmann-basic_json-00-json_pointer[`json_pointer`] | JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] | link:#nlohmann-basic_json-00-json_sax_t[`json_sax_t`] | SAX interface type, see `nlohmann::json_sax` | link:#nlohmann-basic_json-00-json_serializer[`json_serializer`] | | link:#nlohmann-basic_json-00-number_float_t[`number_float_t`] | a type for a number (floating‐point) | link:#nlohmann-basic_json-00-number_integer_t[`number_integer_t`] | a type for a number (integer) | link:#nlohmann-basic_json-00-number_unsigned_t[`number_unsigned_t`] | a type for a number (unsigned) | link:#nlohmann-basic_json-00-object_comparator_t[`object_comparator_t`] | object key comparator type | link:#nlohmann-basic_json-00-object_t[`object_t`] | a type for an object | link:#nlohmann-basic_json-00-other_error[`other_error`] | | link:#nlohmann-basic_json-00-out_of_range[`out_of_range`] | | link:#nlohmann-basic_json-00-parse_error[`parse_error`] | | link:#nlohmann-basic_json-00-parse_event_t[`parse_event_t`] | parser event types | link:#nlohmann-basic_json-00-parser_callback_t[`parser_callback_t`] | per‐element parser callback type | link:#nlohmann-basic_json-00-pointer[`pointer`] | the type of an element pointer | link:#nlohmann-basic_json-00-reference[`reference`] | the type of an element reference | link:#nlohmann-basic_json-00-reverse_iterator[`reverse_iterator`] | a reverse iterator for a basic_json container | link:#nlohmann-basic_json-00-size_type[`size_type`] | a type to represent container sizes | link:#nlohmann-basic_json-00-string_t[`string_t`] | a type for a string | link:#nlohmann-basic_json-00-type_error[`type_error`] | | link:#nlohmann-basic_json-00-value_t[`value_t`] | | link:#nlohmann-basic_json-00-value_type[`value_type`] | the type of elements in a basic_json container |=== == Member Functions [cols=2] |=== | Name | Description | link:#nlohmann-basic_json-00-2constructor-0f[`basic_json`] [.small]#[constructor]# | copy constructor | link:#nlohmann-basic_json-00-2constructor-08[`basic_json`] [.small]#[constructor]# | move constructor | link:#nlohmann-basic_json-00-2constructor-02[`basic_json`] [.small]#[constructor]# | create a null object | link:#nlohmann-basic_json-00-2constructor-0c2[`basic_json`] [.small]#[constructor]# | create an empty value with a given type | link:#nlohmann-basic_json-00-2constructor-04[`basic_json`] [.small]#[constructor]# | create a JSON value from an existing one | link:#nlohmann-basic_json-00-2constructor-01[`basic_json`] [.small]#[constructor]# | //////////////////////////////////// | link:#nlohmann-basic_json-00-2constructor-00[`basic_json`] [.small]#[constructor]# | create a JSON value from compatible types | link:#nlohmann-basic_json-00-2constructor-0b[`basic_json`] [.small]#[constructor]# | construct an array with count copies of given value | link:#nlohmann-basic_json-00-2constructor-07[`basic_json`] [.small]#[constructor]# | construct a JSON container given an iterator range | link:#nlohmann-basic_json-00-2constructor-0cf[`basic_json`] [.small]#[constructor]# | create a container (array or object) from an initializer list | link:#nlohmann-basic_json-00-2destructor[`~basic_json`] [.small]#[destructor]# | destructor | link:#nlohmann-basic_json-00-operator_assign[`operator=`] | copy assignment | link:#nlohmann-basic_json-00-at-0a4[`at`] | access specified array element with bounds checking | link:#nlohmann-basic_json-00-at-08[`at`] | access specified array element with bounds checking | link:#nlohmann-basic_json-00-at-00[`at`] | access specified element via JSON Pointer | link:#nlohmann-basic_json-00-at-0f[`at`] | access specified element via JSON Pointer | link:#nlohmann-basic_json-00-at-0b[`at`] | access specified object element with bounds checking | link:#nlohmann-basic_json-00-at-03[`at`] | access specified object element with bounds checking | link:#nlohmann-basic_json-00-at-09[`at`] | | link:#nlohmann-basic_json-00-at-06[`at`] | | link:#nlohmann-basic_json-00-at-05[`at`] | access specified object element with bounds checking | link:#nlohmann-basic_json-00-at-0a9[`at`] | access specified object element with bounds checking | link:#nlohmann-basic_json-00-back-08e[`back`] | access the last element | link:#nlohmann-basic_json-00-back-088[`back`] | access the last element | link:#nlohmann-basic_json-00-begin-05[`begin`] | returns an iterator to the first element | link:#nlohmann-basic_json-00-begin-04[`begin`] | returns an iterator to the first element | link:#nlohmann-basic_json-00-cbegin[`cbegin`] | returns a const iterator to the first element | link:#nlohmann-basic_json-00-cend[`cend`] | returns an iterator to one past the last element | link:#nlohmann-basic_json-00-clear[`clear`] | clears the contents | link:#nlohmann-basic_json-00-contains-01[`contains`] | check the existence of an element in a JSON object given a JSON pointer | link:#nlohmann-basic_json-00-contains-06[`contains`] | check the existence of an element in a JSON object | link:#nlohmann-basic_json-00-contains-0a[`contains`] | | link:#nlohmann-basic_json-00-contains-08[`contains`] | check the existence of an element in a JSON object | link:#nlohmann-basic_json-00-count-0d[`count`] | returns the number of occurrences of a key in a JSON object | link:#nlohmann-basic_json-00-count-0c[`count`] | returns the number of occurrences of a key in a JSON object | link:#nlohmann-basic_json-00-crbegin[`crbegin`] | returns a const reverse iterator to the last element | link:#nlohmann-basic_json-00-crend[`crend`] | returns a const reverse iterator to one before the first | link:#nlohmann-basic_json-00-dump[`dump`] | serialization | link:#nlohmann-basic_json-00-emplace[`emplace`] | add an object to an object if key does not exist | link:#nlohmann-basic_json-00-emplace_back[`emplace_back`] | add an object to an array | link:#nlohmann-basic_json-00-empty[`empty`] | checks whether the container is empty. | link:#nlohmann-basic_json-00-end-0a[`end`] | returns an iterator to one past the last element | link:#nlohmann-basic_json-00-end-06[`end`] | returns an iterator to one past the last element | link:#nlohmann-basic_json-00-erase-069[`erase`] | remove element from a JSON array given an index | link:#nlohmann-basic_json-00-erase-067[`erase`] | remove element from a JSON object given a key | link:#nlohmann-basic_json-00-erase-0f[`erase`] | remove element given an iterator | link:#nlohmann-basic_json-00-erase-068[`erase`] | remove element from a JSON object given a key | link:#nlohmann-basic_json-00-erase-02[`erase`] | remove elements given an iterator range | link:#nlohmann-basic_json-00-find-0d[`find`] | find an element in a JSON object | link:#nlohmann-basic_json-00-find-0ad[`find`] | find an element in a JSON object | link:#nlohmann-basic_json-00-find-0a0[`find`] | find an element in a JSON object | link:#nlohmann-basic_json-00-find-0f[`find`] | find an element in a JSON object | link:#nlohmann-basic_json-00-flatten[`flatten`] | return flattened JSON value | link:#nlohmann-basic_json-00-front-08[`front`] | access the first element | link:#nlohmann-basic_json-00-front-07[`front`] | access the first element | link:#nlohmann-basic_json-00-get-08[`get`] | get a pointer value (explicit) | link:#nlohmann-basic_json-00-get-0a[`get`] | get a (pointer) value (explicit) | link:#nlohmann-basic_json-00-get_binary-06[`get_binary`] | get a binary value | link:#nlohmann-basic_json-00-get_binary-01[`get_binary`] | get a binary value | link:#nlohmann-basic_json-00-get_ptr-0e[`get_ptr`] | get a pointer value (implicit) | link:#nlohmann-basic_json-00-get_ptr-0d[`get_ptr`] | get a pointer value (implicit) | link:#nlohmann-basic_json-00-get_ref-0e[`get_ref`] | get a reference value (implicit) | link:#nlohmann-basic_json-00-get_ref-05[`get_ref`] | get a reference value (implicit) | link:#nlohmann-basic_json-00-get_to-05[`get_to`] | get a value (explicit) | link:#nlohmann-basic_json-00-get_to-00[`get_to`] | | link:#nlohmann-basic_json-00-get_to-07[`get_to`] | | link:#nlohmann-basic_json-00-insert-00[`insert`] | inserts range of elements into object | link:#nlohmann-basic_json-00-insert-0a[`insert`] | inserts elements from initializer list into array | link:#nlohmann-basic_json-00-insert-0d6[`insert`] | inserts element into array | link:#nlohmann-basic_json-00-insert-03[`insert`] | inserts element into array | link:#nlohmann-basic_json-00-insert-0dc[`insert`] | inserts range of elements into array | link:#nlohmann-basic_json-00-insert-07[`insert`] | inserts copies of element into array | link:#nlohmann-basic_json-00-insert_iterator[`insert_iterator`] | Helper for insertion of an iterator | link:#nlohmann-basic_json-00-is_array[`is_array`] | return whether value is an array | link:#nlohmann-basic_json-00-is_binary[`is_binary`] | return whether value is a binary array | link:#nlohmann-basic_json-00-is_boolean[`is_boolean`] | return whether value is a boolean | link:#nlohmann-basic_json-00-is_discarded[`is_discarded`] | return whether value is discarded | link:#nlohmann-basic_json-00-is_null[`is_null`] | return whether value is null | link:#nlohmann-basic_json-00-is_number[`is_number`] | return whether value is a number | link:#nlohmann-basic_json-00-is_number_float[`is_number_float`] | return whether value is a floating‐point number | link:#nlohmann-basic_json-00-is_number_integer[`is_number_integer`] | return whether value is an integer number | link:#nlohmann-basic_json-00-is_number_unsigned[`is_number_unsigned`] | return whether value is an unsigned integer number | link:#nlohmann-basic_json-00-is_object[`is_object`] | return whether value is an object | link:#nlohmann-basic_json-00-is_primitive[`is_primitive`] | return whether type is primitive | link:#nlohmann-basic_json-00-is_string[`is_string`] | return whether value is a string | link:#nlohmann-basic_json-00-is_structured[`is_structured`] | return whether type is structured | link:#nlohmann-basic_json-00-items-0b[`items`] | helper to access iterator member functions in range‐based for | link:#nlohmann-basic_json-00-items-0d[`items`] | helper to access iterator member functions in range‐based for | link:#nlohmann-basic_json-00-max_size[`max_size`] | returns the maximum possible number of elements | link:#nlohmann-basic_json-00-merge_patch[`merge_patch`] | applies a JSON Merge Patch | link:#nlohmann-basic_json-00-operator_plus_eq-0c[`operator+=`] | add an object to an object | link:#nlohmann-basic_json-00-operator_plus_eq-08[`operator+=`] | add an object to an array | link:#nlohmann-basic_json-00-operator_plus_eq-03[`operator+=`] | add an object to an object | link:#nlohmann-basic_json-00-operator_plus_eq-0b[`operator+=`] | add an object to an array | link:#nlohmann-basic_json-00-operator_subs-08[`operator[]`] | access specified object element | link:#nlohmann-basic_json-00-operator_subs-0102[`operator[]`] | access specified array element | link:#nlohmann-basic_json-00-operator_subs-02[`operator[]`] | access specified array element | link:#nlohmann-basic_json-00-operator_subs-0b[`operator[]`] | access specified element via JSON Pointer | link:#nlohmann-basic_json-00-operator_subs-03[`operator[]`] | access specified element via JSON Pointer | link:#nlohmann-basic_json-00-operator_subs-07[`operator[]`] | access specified object element | link:#nlohmann-basic_json-00-operator_subs-00[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-00-operator_subs-05[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-00-operator_subs-0c[`operator[]`] | access specified object element | link:#nlohmann-basic_json-00-operator_subs-010a[`operator[]`] | access specified object element | link:#nlohmann-basic_json-00-operator_subs-09[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-00-operator_subs-0e[`operator[]`] | Subscript operator | link:#nlohmann-basic_json-00-patch[`patch`] | applies a JSON patch to a copy of the current object | link:#nlohmann-basic_json-00-patch_inplace[`patch_inplace`] | applies a JSON patch in‐place without copying the object | link:#nlohmann-basic_json-00-push_back-04[`push_back`] | add an object to an object | link:#nlohmann-basic_json-00-push_back-0d[`push_back`] | add an object to an array | link:#nlohmann-basic_json-00-push_back-00[`push_back`] | add an object to an object | link:#nlohmann-basic_json-00-push_back-01[`push_back`] | add an object to an array | link:#nlohmann-basic_json-00-rbegin-0e[`rbegin`] | returns an iterator to the reverse‐beginning | link:#nlohmann-basic_json-00-rbegin-00[`rbegin`] | returns an iterator to the reverse‐beginning | link:#nlohmann-basic_json-00-rend-02[`rend`] | returns an iterator to the reverse‐end | link:#nlohmann-basic_json-00-rend-0b[`rend`] | returns an iterator to the reverse‐end | link:#nlohmann-basic_json-00-size[`size`] | returns the number of elements | link:#nlohmann-basic_json-00-swap-0b[`swap`] | exchanges the values | link:#nlohmann-basic_json-00-swap-04e[`swap`] | exchanges the values | link:#nlohmann-basic_json-00-swap-0e[`swap`] | exchanges the values | link:#nlohmann-basic_json-00-swap-09[`swap`] | exchanges the values | link:#nlohmann-basic_json-00-swap-048[`swap`] | exchanges the values | link:#nlohmann-basic_json-00-swap-03[`swap`] | exchanges the values | link:#nlohmann-basic_json-00-type[`type`] | return the type of the JSON value (explicit) | link:#nlohmann-basic_json-00-type_name[`type_name`] | return the type as string | link:#nlohmann-basic_json-00-unflatten[`unflatten`] | unflatten a previously flattened JSON value | link:#nlohmann-basic_json-00-update-0c[`update`] | updates a JSON object from another object, overwriting existing keys | link:#nlohmann-basic_json-00-update-06[`update`] | updates a JSON object from another object, overwriting existing keys | link:#nlohmann-basic_json-00-value-07[`value`] | access specified object element via JSON Pointer with default value | link:#nlohmann-basic_json-00-value-0eb[`value`] | access specified object element with default value | link:#nlohmann-basic_json-00-value-0b[`value`] | access specified object element via JSON Pointer with default value | link:#nlohmann-basic_json-00-value-0ed[`value`] | access specified object element with default value | link:#nlohmann-basic_json-00-value-09[`value`] | | link:#nlohmann-basic_json-00-value-01[`value`] | access specified object element with default value | link:#nlohmann-basic_json-00-value-08[`value`] | | link:#nlohmann-basic_json-00-value-0f[`value`] | access specified object element via JSON Pointer with default value | link:#nlohmann-basic_json-00-2conversion-0a[`operator ValueType`] | get a value (implicit) | link:#nlohmann-basic_json-00-2conversion-05[`operator value_t`] | return the type of the JSON value (implicit) | link:#nlohmann-basic_json-00-operator_eq-08[`operator==`] | comparison: equal | link:#nlohmann-basic_json-00-operator_eq-05[`operator==`] | comparison: equal | link:#nlohmann-basic_json-00-operator_not_eq[`operator!=`] | comparison: not equal | link:#nlohmann-basic_json-00-operator_3way-0c[`operator<=>`] | comparison: 3‐way | link:#nlohmann-basic_json-00-operator_3way-04[`operator<=>`] | comparison: 3‐way |=== == Static Member Functions [cols=2] |=== | Name | Description | link:#nlohmann-basic_json-00-accept-02[`accept`] | | link:#nlohmann-basic_json-00-accept-0e[`accept`] | check if the input is valid JSON | link:#nlohmann-basic_json-00-accept-04[`accept`] | check if the input is valid JSON | link:#nlohmann-basic_json-00-array[`array`] | explicitly create an array from an initializer list | link:#nlohmann-basic_json-00-binary-08[`binary`] | explicitly create a binary array (without subtype) | link:#nlohmann-basic_json-00-binary-0f[`binary`] | explicitly create a binary array | link:#nlohmann-basic_json-00-binary-04[`binary`] | explicitly create a binary array (with subtype) | link:#nlohmann-basic_json-00-binary-0c[`binary`] | explicitly create a binary array (with subtype) | link:#nlohmann-basic_json-00-diff[`diff`] | creates a diff as a JSON patch | link:#nlohmann-basic_json-00-from_bjdata-02[`from_bjdata`] | create a JSON value from an input in BJData format | link:#nlohmann-basic_json-00-from_bjdata-0f[`from_bjdata`] | create a JSON value from an input in BJData format | link:#nlohmann-basic_json-00-from_bson-04[`from_bson`] | | link:#nlohmann-basic_json-00-from_bson-09[`from_bson`] | create a JSON value from an input in BSON format | link:#nlohmann-basic_json-00-from_bson-05[`from_bson`] | create a JSON value from an input in BSON format | link:#nlohmann-basic_json-00-from_bson-0e[`from_bson`] | | link:#nlohmann-basic_json-00-from_cbor-01[`from_cbor`] | | link:#nlohmann-basic_json-00-from_cbor-03[`from_cbor`] | create a JSON value from an input in CBOR format | link:#nlohmann-basic_json-00-from_cbor-0d[`from_cbor`] | create a JSON value from an input in CBOR format | link:#nlohmann-basic_json-00-from_cbor-09[`from_cbor`] | | link:#nlohmann-basic_json-00-from_msgpack-04[`from_msgpack`] | | link:#nlohmann-basic_json-00-from_msgpack-0b[`from_msgpack`] | create a JSON value from an input in MessagePack format | link:#nlohmann-basic_json-00-from_msgpack-00[`from_msgpack`] | create a JSON value from an input in MessagePack format | link:#nlohmann-basic_json-00-from_msgpack-06[`from_msgpack`] | | link:#nlohmann-basic_json-00-from_ubjson-09[`from_ubjson`] | | link:#nlohmann-basic_json-00-from_ubjson-0b[`from_ubjson`] | create a JSON value from an input in UBJSON format | link:#nlohmann-basic_json-00-from_ubjson-04[`from_ubjson`] | create a JSON value from an input in UBJSON format | link:#nlohmann-basic_json-00-from_ubjson-0d[`from_ubjson`] | | link:#nlohmann-basic_json-00-get_allocator[`get_allocator`] | returns the allocator associated with the container | link:#nlohmann-basic_json-00-iterator_wrapper-0a[`iterator_wrapper`] | wrapper to access iterator member functions in range‐based for | link:#nlohmann-basic_json-00-iterator_wrapper-03[`iterator_wrapper`] | wrapper to access iterator member functions in range‐based for | link:#nlohmann-basic_json-00-meta[`meta`] | returns version information on the library | link:#nlohmann-basic_json-00-object[`object`] | explicitly create an object from an initializer list | link:#nlohmann-basic_json-00-parse-01[`parse`] | | link:#nlohmann-basic_json-00-parse-0f[`parse`] | deserialize from a compatible input | link:#nlohmann-basic_json-00-parse-09[`parse`] | deserialize from a pair of character iterators | link:#nlohmann-basic_json-00-sax_parse-01[`sax_parse`] | generate SAX events | link:#nlohmann-basic_json-00-sax_parse-0b[`sax_parse`] | generate SAX events | link:#nlohmann-basic_json-00-sax_parse-04[`sax_parse`] | generate SAX events | link:#nlohmann-basic_json-00-to_bjdata-01[`to_bjdata`] | create a BJData serialization of a given JSON value | link:#nlohmann-basic_json-00-to_bjdata-0a[`to_bjdata`] | create a BJData serialization of a given JSON value | link:#nlohmann-basic_json-00-to_bjdata-0c[`to_bjdata`] | create a BJData serialization of a given JSON value | link:#nlohmann-basic_json-00-to_bson-01[`to_bson`] | create a BSON serialization of a given JSON value | link:#nlohmann-basic_json-00-to_bson-0b[`to_bson`] | create a BSON serialization of a given JSON value | link:#nlohmann-basic_json-00-to_bson-0f[`to_bson`] | create a BSON serialization of a given JSON value | link:#nlohmann-basic_json-00-to_cbor-05f[`to_cbor`] | create a CBOR serialization of a given JSON value | link:#nlohmann-basic_json-00-to_cbor-00[`to_cbor`] | create a CBOR serialization of a given JSON value | link:#nlohmann-basic_json-00-to_cbor-05c[`to_cbor`] | create a CBOR serialization of a given JSON value | link:#nlohmann-basic_json-00-to_msgpack-04[`to_msgpack`] | create a MessagePack serialization of a given JSON value | link:#nlohmann-basic_json-00-to_msgpack-03[`to_msgpack`] | create a MessagePack serialization of a given JSON value | link:#nlohmann-basic_json-00-to_msgpack-01[`to_msgpack`] | create a MessagePack serialization of a given JSON value | link:#nlohmann-basic_json-00-to_ubjson-02[`to_ubjson`] | create a UBJSON serialization of a given JSON value | link:#nlohmann-basic_json-00-to_ubjson-06[`to_ubjson`] | create a UBJSON serialization of a given JSON value | link:#nlohmann-basic_json-00-to_ubjson-0f[`to_ubjson`] | create a UBJSON serialization of a given JSON value |=== == Friends [cols=2] |=== | Name | Description | `link:#nlohmann-operator_rshift-0e[nlohmann::operator>>]` | deserialize from stream | `link:#nlohmann-operator_lshift-07[nlohmann::operator<<]` | deserialize from stream | `link:#nlohmann-operator_rshift-0d[nlohmann::operator>>]` | serialize to stream | `link:#nlohmann-operator_lshift-03[nlohmann::operator<<]` | serialize to stream | `link:#nlohmann-swap-03[nlohmann::swap]` | exchanges the values | `nlohmann::detail::exception` | general exception of the `basic_json` class | `nlohmann::detail::serializer` | | `link:#nlohmann-json_pointer-0b[nlohmann::json_pointer]` | |=== == Non-Member Functions [cols=2] |=== | Name | Description | link:#nlohmann-operator_lshift-053[`operator<<`] | deserialize from stream | link:#nlohmann-operator_rshift-08[`operator>>`] | serialize to stream | link:#nlohmann-to_string[`to_string`] | user‐defined to_string function for JSON values |=== == Description a class to store JSON values [,cpp] ---- @invariant The member variables @a m_value and @a m_type have the following relationship: - If `m_type == value_t::object`, then `m_value.object != nullptr`. - If `m_type == value_t::array`, then `m_value.array != nullptr`. - If `m_type == value_t::string`, then `m_value.string != nullptr`. The invariants are checked by member function assert_invariant(). @note ObjectType trick from https://stackoverflow.com/a/9860911 ---- the allocator type == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using allocator_type = AllocatorType<basic_json>; ---- a type for an array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using array_t = ArrayType<basic_json, AllocatorType<basic_json>>; ---- a type for a packed binary type == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using binary_t = link:#nlohmann-byte_container_with_subtype-04[nlohmann::byte_container_with_subtype<BinaryType>]; ---- how to encode BJData == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using bjdata_version_t = detail::bjdata_version_t; ---- a type for a boolean == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using boolean_t = BooleanType; ---- how to treat CBOR tags == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using cbor_tag_handler_t = detail::cbor_tag_handler_t; ---- a const iterator for a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using const_iterator = link:#nlohmann-basic_json-00[iter_impl<basic_json const>]; ---- the type of an element const pointer == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using const_pointer = std::allocator_traits<allocator_type>::const_pointer; ---- the type of an element const reference == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using const_reference = link:#nlohmann-basic_json-00-value_type[value_type] const&; ---- a const reverse iterator for a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using const_reverse_iterator = link:#nlohmann-basic_json-00[json_reverse_iterator<basic_json::const_iterator>]; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using default_object_comparator_t = std::less; ---- a type to represent differences between iterators == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using difference_type = std::ptrdiff_t; ---- how to treat decoding errors == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using error_handler_t = detail::error_handler_t; ---- Classes to implement user‐defined exceptions. @{ == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using exception = detail::exception; ---- helper type for initializer lists of basic_json values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using initializer_list_t = std::initializer_list<detail::json_ref<basic_json>>; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using input_format_t = detail::input_format_t; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using invalid_iterator = detail::invalid_iterator; ---- an iterator for a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using iterator = link:#nlohmann-basic_json-00[iter_impl<basic_json>]; ---- JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using json_pointer = link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<StringType>]; ---- SAX interface type, see `nlohmann::json_sax` == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using json_sax_t = json_sax<basic_json>; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, typename SFINAE> using json_serializer = JSONSerializer<T, SFINAE>; ---- a type for a number (floating‐point) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using number_float_t = NumberFloatType; ---- a type for a number (integer) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using number_integer_t = NumberIntegerType; ---- a type for a number (unsigned) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using number_unsigned_t = NumberUnsignedType; ---- object key comparator type == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using object_comparator_t = detail::actual_object_comparator_t<basic_json>; ---- a type for an object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using object_t = ObjectType<StringType, basic_json, default_object_comparator_t, AllocatorType<std::pair<StringType const, basic_json>>>; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using other_error = detail::other_error; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using out_of_range = detail::out_of_range; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using parse_error = detail::parse_error; ---- parser event types == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using parse_event_t = detail::parse_event_t; ---- per‐element parser callback type == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using parser_callback_t = detail::parser_callback_t<basic_json>; ---- the type of an element pointer == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using pointer = std::allocator_traits<allocator_type>::pointer; ---- the type of an element reference == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using reference = link:#nlohmann-basic_json-00-value_type[value_type]&; ---- a reverse iterator for a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using reverse_iterator = link:#nlohmann-basic_json-00[json_reverse_iterator<basic_json::iterator>]; ---- a type to represent container sizes == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using size_type = std::size_t; ---- a type for a string == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using string_t = StringType; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using type_error = detail::type_error; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using value_t = detail::value_t; ---- the type of elements in a basic_json container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using value_type = link:#nlohmann-basic_json-00[basic_json]; ---- copy constructor == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json(link:#nlohmann-basic_json-00[basic_json] const& other); ---- == Parameters [cols=2] |=== | Name | Description | *other* | The object to copy construct from |=== move constructor == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json(link:#nlohmann-basic_json-00[basic_json]&& other) noexcept; ---- == Parameters [cols=2] |=== | Name | Description | *other* | The object to move construct from |=== create a null object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json(std::nullptr_t value = nullptr) noexcept; ---- == Parameters [cols=2] |=== | Name | Description | *value* | The object to construct from |=== create an empty value with a given type == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json(link:#nlohmann-basic_json-00-value_t[value_t] const v); ---- == Parameters [cols=2] |=== | Name | Description | *v* | The object to construct from |=== create a JSON value from an existing one == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value&& !std::is_same<basic_json, BasicJsonType>::value basic_json(BasicJsonType const& val); ---- == Parameters [cols=2] |=== | Name | Description | *val* | The object to copy construct from |=== //////////////////////////////////// == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename JsonRef> requires detail::conjunction<detail::is_json_ref<JsonRef>, std::is_same<typename JsonRef::value_type, basic_json>>::value basic_json(JsonRef const& ref); ---- == Parameters [cols=2] |=== | Name | Description | *ref* | The object to copy construct from |=== create a JSON value from compatible types == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename CompatibleType, typename U = detail::uncvref_t<CompatibleType>> requires !detail::is_basic_json<U>::value && detail::is_compatible_type<basic_json_t, U>::value basic_json(CompatibleType&& val) noexcept(noexcept(JSONSerializer<U, void>::to_json(std::declval<basic_json_t &>(), std::forward<CompatibleType>(val)))); ---- == Parameters [cols=2] |=== | Name | Description | *val* | The object to move construct from |=== construct an array with count copies of given value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json( link:#nlohmann-basic_json-00-size_type[size_type] cnt, link:#nlohmann-basic_json-00[basic_json] const& val); ---- == Parameters [cols=2] |=== | Name | Description | *cnt* | The object to construct from | *val* | a class to store JSON values |=== construct a JSON container given an iterator range == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class InputIT> requires std::is_same<InputIT, typename basic_json_t::iterator>::value || std::is_same<InputIT, typename basic_json_t::const_iterator>::value basic_json( InputIT first, InputIT last); ---- == Parameters [cols=2] |=== | Name | Description | *first* | The object to construct from |=== create a container (array or object) from an initializer list == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- basic_json( link:#nlohmann-basic_json-00-initializer_list_t[initializer_list_t] init, bool type_deduction = true, link:#nlohmann-basic_json-00-value_t[value_t] manual_type = value_t::array); ---- == Parameters [cols=2] |=== | Name | Description | *init* | The object to construct from |=== destructor == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- ~basic_json() noexcept; ---- copy assignment == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00[basic_json]& operator=(link:#nlohmann-basic_json-00[basic_json] other) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value && std::is_nothrow_move_assignable<json_base_class_t>::value); ---- == Return Value Reference to the current object == Parameters [cols=2] |=== | Name | Description | *other* | The object to assign from |=== access specified array element with bounds checking == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] at(link:#nlohmann-basic_json-00-size_type[size_type] idx); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *idx* | a type to represent container sizes |=== access specified array element with bounds checking == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reference[const_reference] at(link:#nlohmann-basic_json-00-size_type[size_type] idx) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *idx* | a type to represent container sizes |=== access specified element via JSON Pointer == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] at(link:#nlohmann-basic_json-00-json_pointer[json_pointer] const& ptr); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *ptr* | JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] |=== access specified element via JSON Pointer == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reference[const_reference] at(link:#nlohmann-basic_json-00-json_pointer[json_pointer] const& ptr) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *ptr* | JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] |=== access specified object element with bounds checking == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] at(object_t::key_type const& key); ---- == Return Value the type of an element reference access specified object element with bounds checking == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reference[const_reference] at(object_t::key_type const& key) const; ---- == Return Value the type of an element const reference == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value [[__deprecated__]] link:#nlohmann-basic_json-00-reference[reference] at(link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value [[__deprecated__]] link:#nlohmann-basic_json-00-const_reference[const_reference] at(link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr) const; ---- access specified object element with bounds checking == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-00-const_reference[const_reference] at(KeyType&& key) const; ---- == Return Value the type of an element const reference access specified object element with bounds checking == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-00-reference[reference] at(KeyType&& key); ---- == Return Value the type of an element reference access the last element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] back(); ---- == Return Value the type of an element reference access the last element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reference[const_reference] back() const; ---- == Return Value the type of an element const reference returns an iterator to the first element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-iterator[iterator] begin() noexcept; ---- == Return Value an iterator for a basic_json container returns an iterator to the first element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_iterator[const_iterator] begin() const noexcept; ---- == Return Value a const iterator for a basic_json container returns a const iterator to the first element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_iterator[const_iterator] cbegin() const noexcept; ---- == Return Value a const iterator for a basic_json container returns an iterator to one past the last element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_iterator[const_iterator] cend() const noexcept; ---- == Return Value a const iterator for a basic_json container clears the contents == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void clear() noexcept; ---- check the existence of an element in a JSON object given a JSON pointer == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool contains(link:#nlohmann-basic_json-00-json_pointer[json_pointer] const& ptr) const; ---- == Parameters [cols=2] |=== | Name | Description | *ptr* | JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] |=== check the existence of an element in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool contains(object_t::key_type const& key) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value [[__deprecated__]] bool contains(link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr) const; ---- check the existence of an element in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value bool contains(KeyType&& key) const; ---- returns the number of occurrences of a key in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-size_type[size_type] count(object_t::key_type const& key) const; ---- == Return Value a type to represent container sizes returns the number of occurrences of a key in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-00-size_type[size_type] count(KeyType&& key) const; ---- == Return Value a type to represent container sizes returns a const reverse iterator to the last element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reverse_iterator[const_reverse_iterator] crbegin() const noexcept; ---- == Return Value a const reverse iterator for a basic_json container returns a const reverse iterator to one before the first == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reverse_iterator[const_reverse_iterator] crend() const noexcept; ---- == Return Value a const reverse iterator for a basic_json container serialization == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-string_t[string_t] dump( int const indent = ‐1, char const indent_char = ' ', bool const ensure_ascii = false, link:#nlohmann-basic_json-00-error_handler_t[error_handler_t] const error_handler = error_handler_t::strict) const; ---- == Return Value a type for a string == Parameters [cols=2] |=== | Name | Description | *error_handler* | how to treat decoding errors |=== add an object to an object if key does not exist == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class... Args> std::pair<iterator, bool> emplace(Args...&&... args); ---- add an object to an array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class... Args> link:#nlohmann-basic_json-00-reference[reference] emplace_back(Args...&&... args); ---- == Return Value the type of an element reference checks whether the container is empty. == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool empty() const noexcept; ---- returns an iterator to one past the last element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-iterator[iterator] end() noexcept; ---- == Return Value an iterator for a basic_json container returns an iterator to one past the last element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_iterator[const_iterator] end() const noexcept; ---- == Return Value a const iterator for a basic_json container remove element from a JSON array given an index == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void erase(link:#nlohmann-basic_json-00-size_type[size_type] const idx); ---- == Parameters [cols=2] |=== | Name | Description | *idx* | a type to represent container sizes |=== remove element from a JSON object given a key == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-size_type[size_type] erase(object_t::key_type const& key); ---- == Return Value a type to represent container sizes remove element given an iterator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class IteratorType> requires std::is_same<IteratorType, typename basic_json_t::iterator>::value || std::is_same<IteratorType, typename basic_json_t::const_iterator>::value IteratorType erase(IteratorType pos); ---- remove element from a JSON object given a key == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-00-size_type[size_type] erase(KeyType&& key); ---- == Return Value a type to represent container sizes remove elements given an iterator range == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class IteratorType> requires std::is_same<IteratorType, typename basic_json_t::iterator>::value || std::is_same<IteratorType, typename basic_json_t::const_iterator>::value IteratorType erase( IteratorType first, IteratorType last); ---- find an element in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-iterator[iterator] find(object_t::key_type const& key); ---- == Return Value an iterator for a basic_json container find an element in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_iterator[const_iterator] find(object_t::key_type const& key) const; ---- == Return Value a const iterator for a basic_json container find an element in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-00-const_iterator[const_iterator] find(KeyType&& key) const; ---- == Return Value a const iterator for a basic_json container find an element in a JSON object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-00-iterator[iterator] find(KeyType&& key); ---- == Return Value an iterator for a basic_json container return flattened JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00[basic_json] flatten() const; ---- == Return Value a class to store JSON values access the first element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] front(); ---- == Return Value the type of an element reference access the first element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reference[const_reference] front() const; ---- == Return Value the type of an element const reference get a pointer value (explicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename PointerType> requires std::is_pointer<PointerType>::value decltype(std::declval<basic_json_t&>().template get_ptr<PointerType>()) get() noexcept; ---- == Description Explicit pointer access to the internally stored JSON value. No copies are made. [WARNING] The pointer becomes invalid if the underlying JSON object changes. Constant. {The example below shows how pointers to internal values of a JSON value can be requested. Note that no type conversions are made and a `nullptr` is returned if the value and the requested pointer type does not match.,get_PointerType} == Return Value pointer to the internally stored JSON value if the requested pointer type _PointerType_ fits to the JSON value; `nullptr` otherwise == Template Parameters [cols=2] |=== | Name | Description | *PointerType* | pointer type; must be a pointer to link:#nlohmann-basic_json-00-array_t[`array_t`], link:#nlohmann-basic_json-00-object_t[`object_t`], link:#nlohmann-basic_json-00-string_t[`string_t`], link:#nlohmann-basic_json-00-boolean_t[`boolean_t`], link:#nlohmann-basic_json-00-number_integer_t[`number_integer_t`], link:#nlohmann-basic_json-00-number_unsigned_t[`number_unsigned_t`], or link:#nlohmann-basic_json-00-number_float_t[`number_float_t`]. |=== get a (pointer) value (explicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename ValueTypeCV, typename ValueType = detail::uncvref_t<ValueTypeCV>> constexpr decltype(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {})) get() const noexcept(noexcept(std::declval<const basic_json_t &>().template get_impl<ValueType>(detail::priority_tag<4>{}))); ---- == Description Performs explicit type conversion between the JSON value and a compatible value if required. ‐ If the requested type is a pointer to the internally stored JSON value that pointer is returned. No copies are made. ‐ If the requested type is the current link:#nlohmann-basic_json-00-2constructor-0f[`basic_json`], or a different link:#nlohmann-basic_json-00-2constructor-0f[`basic_json`] convertible from the current link:#nlohmann-basic_json-00-2constructor-0f[`basic_json`]. ‐ Otherwise the value is converted by calling the link:#nlohmann-basic_json-00-json_serializer[`json_serializer<ValueType>`] `from_json()` method. == Exceptions [cols=2] |=== | Name | Thrown on | `what` | link:#nlohmann-basic_json-00-json_serializer[`json_serializer<ValueType>`] `from_json()` method throws if conversion is required |=== == Return Value copy of the JSON value, converted to == Template Parameters [cols=2] |=== | Name | Description | *ValueTypeCV* | the provided value type | *ValueType* | the returned value type | *ValueType* | if necessary |=== get a binary value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-binary_t[binary_t]& get_binary(); ---- == Return Value a type for a packed binary type get a binary value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-binary_t[binary_t] const& get_binary() const; ---- == Return Value a type for a packed binary type get a pointer value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename PointerType> requires std::is_pointer<PointerType>::value&& std::is_const<typename std::remove_pointer<PointerType>::type>::value constexpr decltype(std::declval<const basic_json_t&>().get_impl_ptr(std::declval<PointerType>())) get_ptr() const noexcept; ---- get a pointer value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename PointerType> requires std::is_pointer<PointerType>::value decltype(std::declval<basic_json_t&>().get_impl_ptr(std::declval<PointerType>())) get_ptr() noexcept; ---- get a reference value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ReferenceType> requires std::is_reference<ReferenceType>::value ReferenceType get_ref(); ---- get a reference value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ReferenceType> requires std::is_reference<ReferenceType>::value&& std::is_const<typename std::remove_reference<ReferenceType>::type>::value ReferenceType get_ref() const; ---- get a value (explicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ValueType> requires !detail::is_basic_json<ValueType>::value&& detail::has_from_json<basic_json_t, ValueType>::value ValueType& get_to(ValueType& v) const noexcept(noexcept(JSONSerializer<ValueType, void>::from_json(std::declval<const basic_json_t &>(), v))); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ValueType> requires detail::is_basic_json<ValueType>::value ValueType& get_to(ValueType& v) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, std::size_t N, typename Array = T(&)[]> requires detail::has_from_json<basic_json_t, Array>::value Array get_to(T(& v)[]) const noexcept(noexcept(JSONSerializer<Array, void>::from_json(std::declval<const basic_json_t &>(), v))); ---- inserts range of elements into object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void insert( link:#nlohmann-basic_json-00-const_iterator[const_iterator] first, link:#nlohmann-basic_json-00-const_iterator[const_iterator] last); ---- == Parameters [cols=2] |=== | Name | Description | *first* | a const iterator for a basic_json container | *last* | a const iterator for a basic_json container |=== inserts elements from initializer list into array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-iterator[iterator] insert( link:#nlohmann-basic_json-00-const_iterator[const_iterator] pos, link:#nlohmann-basic_json-00-initializer_list_t[initializer_list_t] ilist); ---- == Return Value an iterator for a basic_json container == Parameters [cols=2] |=== | Name | Description | *pos* | a const iterator for a basic_json container | *ilist* | helper type for initializer lists of basic_json values |=== inserts element into array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-iterator[iterator] insert( link:#nlohmann-basic_json-00-const_iterator[const_iterator] pos, link:#nlohmann-basic_json-00[basic_json] const& val); ---- == Return Value an iterator for a basic_json container == Parameters [cols=2] |=== | Name | Description | *pos* | a const iterator for a basic_json container | *val* | a class to store JSON values |=== inserts element into array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-iterator[iterator] insert( link:#nlohmann-basic_json-00-const_iterator[const_iterator] pos, link:#nlohmann-basic_json-00[basic_json]&& val); ---- == Return Value an iterator for a basic_json container == Parameters [cols=2] |=== | Name | Description | *pos* | a const iterator for a basic_json container | *val* | a class to store JSON values |=== inserts range of elements into array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-iterator[iterator] insert( link:#nlohmann-basic_json-00-const_iterator[const_iterator] pos, link:#nlohmann-basic_json-00-const_iterator[const_iterator] first, link:#nlohmann-basic_json-00-const_iterator[const_iterator] last); ---- == Return Value an iterator for a basic_json container == Parameters [cols=2] |=== | Name | Description | *pos* | a const iterator for a basic_json container | *first* | a const iterator for a basic_json container | *last* | a const iterator for a basic_json container |=== inserts copies of element into array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-iterator[iterator] insert( link:#nlohmann-basic_json-00-const_iterator[const_iterator] pos, link:#nlohmann-basic_json-00-size_type[size_type] cnt, link:#nlohmann-basic_json-00[basic_json] const& val); ---- == Return Value an iterator for a basic_json container == Parameters [cols=2] |=== | Name | Description | *pos* | a const iterator for a basic_json container | *cnt* | a type to represent container sizes | *val* | a class to store JSON values |=== Helper for insertion of an iterator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename... Args> link:#nlohmann-basic_json-00-iterator[iterator] insert_iterator( link:#nlohmann-basic_json-00-const_iterator[const_iterator] pos, Args...&&... args); ---- == Description [NOTE] : This uses std::distance to support GCC 4.8, see https://github.com/nlohmann/json/pull/1257 == Return Value an iterator for a basic_json container == Parameters [cols=2] |=== | Name | Description | *pos* | a const iterator for a basic_json container |=== return whether value is an array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_array() const noexcept; ---- return whether value is a binary array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_binary() const noexcept; ---- return whether value is a boolean == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_boolean() const noexcept; ---- return whether value is discarded == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_discarded() const noexcept; ---- return whether value is null == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_null() const noexcept; ---- return whether value is a number == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_number() const noexcept; ---- return whether value is a floating‐point number == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_number_float() const noexcept; ---- return whether value is an integer number == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_number_integer() const noexcept; ---- return whether value is an unsigned integer number == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_number_unsigned() const noexcept; ---- return whether value is an object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_object() const noexcept; ---- return whether type is primitive == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_primitive() const noexcept; ---- return whether value is a string == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_string() const noexcept; ---- return whether type is structured == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool is_structured() const noexcept; ---- helper to access iterator member functions in range‐based for == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00[iteration_proxy<iterator>] items() noexcept; ---- helper to access iterator member functions in range‐based for == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00[iteration_proxy<const_iterator>] items() const noexcept; ---- returns the maximum possible number of elements == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-size_type[size_type] max_size() const noexcept; ---- == Return Value a type to represent container sizes applies a JSON Merge Patch == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void merge_patch(link:#nlohmann-basic_json-00[basic_json] const& apply_patch); ---- == Parameters [cols=2] |=== | Name | Description | *apply_patch* | a class to store JSON values |=== add an object to an object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] operator+=(link:#nlohmann-basic_json-00-initializer_list_t[initializer_list_t] init); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *init* | The right operand |=== add an object to an array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] operator+=(link:#nlohmann-basic_json-00[basic_json] const& val); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *val* | The right operand |=== add an object to an object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] operator+=(object_t::value_type const& val); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *val* | The right operand |=== add an object to an array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] operator+=(link:#nlohmann-basic_json-00[basic_json]&& val); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *val* | The right operand |=== access specified object element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] operator[](object_t::key_type key); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== access specified array element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] operator[](link:#nlohmann-basic_json-00-size_type[size_type] idx); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *idx* | The right operand |=== access specified array element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reference[const_reference] operator[](link:#nlohmann-basic_json-00-size_type[size_type] idx) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *idx* | The right operand |=== access specified element via JSON Pointer == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reference[reference] operator[](link:#nlohmann-basic_json-00-json_pointer[json_pointer] const& ptr); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *ptr* | The right operand |=== access specified element via JSON Pointer == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reference[const_reference] operator[](link:#nlohmann-basic_json-00-json_pointer[json_pointer] const& ptr) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *ptr* | The right operand |=== access specified object element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reference[const_reference] operator[](object_t::key_type const& key) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value [[__deprecated__]] link:#nlohmann-basic_json-00-const_reference[const_reference] operator[](link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *ptr* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value [[__deprecated__]] link:#nlohmann-basic_json-00-reference[reference] operator[](link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *ptr* | The right operand |=== access specified object element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-00-reference[reference] operator[](KeyType&& key); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== access specified object element == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value link:#nlohmann-basic_json-00-const_reference[const_reference] operator[](KeyType&& key) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> link:#nlohmann-basic_json-00-reference[reference] operator[](T* key); ---- == Return Value the type of an element reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== Subscript operator == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> link:#nlohmann-basic_json-00-const_reference[const_reference] operator[](T* key) const; ---- == Return Value the type of an element const reference == Parameters [cols=2] |=== | Name | Description | *key* | The right operand |=== applies a JSON patch to a copy of the current object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00[basic_json] patch(link:#nlohmann-basic_json-00[basic_json] const& json_patch) const; ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *json_patch* | a class to store JSON values |=== applies a JSON patch in‐place without copying the object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void patch_inplace(link:#nlohmann-basic_json-00[basic_json] const& json_patch); ---- == Parameters [cols=2] |=== | Name | Description | *json_patch* | a class to store JSON values |=== add an object to an object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void push_back(link:#nlohmann-basic_json-00-initializer_list_t[initializer_list_t] init); ---- == Parameters [cols=2] |=== | Name | Description | *init* | helper type for initializer lists of basic_json values |=== add an object to an array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void push_back(link:#nlohmann-basic_json-00[basic_json] const& val); ---- == Parameters [cols=2] |=== | Name | Description | *val* | a class to store JSON values |=== add an object to an object == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void push_back(object_t::value_type const& val); ---- add an object to an array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void push_back(link:#nlohmann-basic_json-00[basic_json]&& val); ---- == Parameters [cols=2] |=== | Name | Description | *val* | a class to store JSON values |=== returns an iterator to the reverse‐beginning == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reverse_iterator[reverse_iterator] rbegin() noexcept; ---- == Return Value a reverse iterator for a basic_json container returns an iterator to the reverse‐beginning == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reverse_iterator[const_reverse_iterator] rbegin() const noexcept; ---- == Return Value a const reverse iterator for a basic_json container returns an iterator to the reverse‐end == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-reverse_iterator[reverse_iterator] rend() noexcept; ---- == Return Value a reverse iterator for a basic_json container returns an iterator to the reverse‐end == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-const_reverse_iterator[const_reverse_iterator] rend() const noexcept; ---- == Return Value a const reverse iterator for a basic_json container returns the number of elements == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00-size_type[size_type] size() const noexcept; ---- == Return Value a type to represent container sizes exchanges the values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-basic_json-00-reference[reference] other) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value); ---- == Parameters [cols=2] |=== | Name | Description | *other* | the type of an element reference |=== exchanges the values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-basic_json-00-array_t[array_t]& other); ---- == Parameters [cols=2] |=== | Name | Description | *other* | a type for an array |=== exchanges the values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-basic_json-00-binary_t[binary_t]& other); ---- == Parameters [cols=2] |=== | Name | Description | *other* | a type for a packed binary type |=== exchanges the values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(binary_t::container_type& other); ---- exchanges the values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-basic_json-00-object_t[object_t]& other); ---- == Parameters [cols=2] |=== | Name | Description | *other* | a type for an object |=== exchanges the values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(link:#nlohmann-basic_json-00-string_t[string_t]& other); ---- == Parameters [cols=2] |=== | Name | Description | *other* | a type for a string |=== return the type of the JSON value (explicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr link:#nlohmann-basic_json-00-value_t[value_t] type() const noexcept; ---- return the type as string == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__returns_nonnull__]] char const* type_name() const noexcept; ---- unflatten a previously flattened JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-basic_json-00[basic_json] unflatten() const; ---- == Return Value a class to store JSON values updates a JSON object from another object, overwriting existing keys == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void update( link:#nlohmann-basic_json-00-const_reference[const_reference] j, bool merge_objects = false); ---- == Parameters [cols=2] |=== | Name | Description | *j* | the type of an element const reference |=== updates a JSON object from another object, overwriting existing keys == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void update( link:#nlohmann-basic_json-00-const_iterator[const_iterator] first, link:#nlohmann-basic_json-00-const_iterator[const_iterator] last, bool merge_objects = false); ---- == Parameters [cols=2] |=== | Name | Description | *first* | a const iterator for a basic_json container | *last* | a const iterator for a basic_json container |=== access specified object element via JSON Pointer with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ValueType> requires detail::is_getable<basic_json_t, ValueType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ValueType value( link:#nlohmann-basic_json-00-json_pointer[json_pointer] const& ptr, ValueType const& default_value) const; ---- == Parameters [cols=2] |=== | Name | Description | *ptr* | JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] |=== access specified object element with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ValueType> requires !detail::is_transparent<object_comparator_t>::value && detail::is_getable<basic_json_t, ValueType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ValueType value( object_t::key_type const& key, ValueType const& default_value) const; ---- access specified object element via JSON Pointer with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class ReturnType = value_return_type<ValueType>::type> requires detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ReturnType value( link:#nlohmann-basic_json-00-json_pointer[json_pointer] const& ptr, ValueType&& default_value) const; ---- == Parameters [cols=2] |=== | Name | Description | *ptr* | JSON Pointer, see link:#nlohmann-json_pointer-0b[`nlohmann::json_pointer`] |=== access specified object element with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class ReturnType = value_return_type<ValueType>::type> requires !detail::is_transparent<object_comparator_t>::value && detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ReturnType value( object_t::key_type const& key, ValueType&& default_value) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class BasicJsonType> requires detail::is_basic_json<BasicJsonType>::value && detail::is_getable<basic_json_t, ValueType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value [[__deprecated__]] ValueType value( link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr, ValueType const& default_value) const; ---- access specified object element with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class KeyType> requires detail::is_transparent<object_comparator_t>::value && !detail::is_json_pointer<KeyType>::value && is_comparable_with_object_key<KeyType>::value && detail::is_getable<basic_json_t, ValueType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ValueType value( KeyType&& key, ValueType const& default_value) const; ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class BasicJsonType, class ReturnType = value_return_type<ValueType>::type> requires detail::is_basic_json<BasicJsonType>::value && detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value [[__deprecated__]] ReturnType value( link:#nlohmann-json_pointer-0a[nlohmann::json_pointer<BasicJsonType>] const& ptr, ValueType&& default_value) const; ---- access specified object element via JSON Pointer with default value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class ValueType, class KeyType, class ReturnType = value_return_type<ValueType>::type> requires detail::is_transparent<object_comparator_t>::value && !detail::is_json_pointer<KeyType>::value && is_comparable_with_object_key<KeyType>::value && detail::is_getable<basic_json_t, ReturnType>::value && !std::is_same<value_t, detail::uncvref_t<ValueType>>::value ReturnType value( KeyType&& key, ValueType&& default_value) const; ---- get a value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ValueType> requires detail::conjunction < detail::negation<std::is_pointer<ValueType>>, detail::negation<std::is_same<ValueType, std::nullptr_t>>, detail::negation<std::is_same<ValueType, detail::json_ref<basic_json>>>, detail::negation<std::is_same<ValueType, typename string_t::value_type>>, detail::negation<detail::is_basic_json<ValueType>>, detail::negation<std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>>, #if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1910 && _MSC_VER <= 1914)) detail::negation<std::is_same<ValueType, std::string_view>>, #endif #if defined(JSON_HAS_CPP_17) && JSON_HAS_STATIC_RTTI detail::negation<std::is_same<ValueType, std::any>>, #endif detail::is_detected_lazy<detail::get_template_function, const basic_json_t&, ValueType> >::value operator ValueType() const; ---- == Description Implicit type conversion between the JSON value and a compatible value. The call is realized by calling link:#nlohmann-basic_json-00-get-0a[`get() const`]. Linear in the size of the JSON value. {The example below shows several conversions from JSON values to other types. There a few things to note: (1) Floating‐point numbers can be converted to integers, (2) A JSON array can be converted to a standard `std::vector<short>`, (3) A JSON object can be converted to C++ associative containers such as `std::unordered_map<std::string, json>`.,operator_ValueType} == Exceptions [cols=2] |=== | Name | Thrown on | `type_error.302` | in case passed type _ValueType_ is incompatible to the JSON value type (e.g., the JSON value is of type boolean, but a string is requested); see example below |=== == Return Value copy of the JSON value, converted to type _ValueType_ == Template Parameters [cols=2] |=== | Name | Description | *ValueType* | non‐pointer type compatible to the JSON value, for instance `int` for JSON integer numbers, `bool` for JSON booleans, or `std::vector` types for JSON arrays. The character type of link:#nlohmann-basic_json-00-string_t[`string_t`] as well as an initializer list of this type is excluded to avoid ambiguities as these types implicitly convert to `std::string`. |=== return the type of the JSON value (implicit) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr operator link:#nlohmann-basic_json-00-value_t[value_t]() const noexcept; ---- == Return Value The object converted to `value_t` comparison: equal == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ScalarType> requires std::is_scalar_v<ScalarType> bool operator==(ScalarType rhs) const noexcept; ---- == Return Value `true` if the objects are equal, `false` otherwise == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== comparison: equal == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool operator==(link:#nlohmann-basic_json-00-const_reference[const_reference] rhs) const noexcept; ---- == Return Value `true` if the objects are equal, `false` otherwise == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== comparison: not equal == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool operator!=(link:#nlohmann-basic_json-00-const_reference[const_reference] rhs) const noexcept; ---- == Return Value `true` if the objects are not equal, `false` otherwise == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== comparison: 3‐way == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename ScalarType> requires std::is_scalar_v<ScalarType> std::partial_ordering operator<=>(ScalarType rhs) const noexcept; ---- == Return Value The relative order of the objects == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== comparison: 3‐way == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::partial_ordering operator<=>(link:#nlohmann-basic_json-00-const_reference[const_reference] rhs) const noexcept; ---- == Return Value The relative order of the objects == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static bool accept( detail::span_input_adapter&& i, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- check if the input is valid JSON == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> static bool accept( InputType&& i, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- check if the input is valid JSON == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> static bool accept( IteratorType first, IteratorType last, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- explicitly create an array from an initializer list == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] array(link:#nlohmann-basic_json-00-initializer_list_t[initializer_list_t] init = {}); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *init* | helper type for initializer lists of basic_json values |=== explicitly create a binary array (without subtype) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] binary(binary_t::container_type const& init); ---- == Return Value a class to store JSON values explicitly create a binary array == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] binary(binary_t::container_type&& init); ---- == Return Value a class to store JSON values explicitly create a binary array (with subtype) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] binary( binary_t::container_type const& init, binary_t::subtype_type subtype); ---- == Return Value a class to store JSON values explicitly create a binary array (with subtype) == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] binary( binary_t::container_type&& init, binary_t::subtype_type subtype); ---- == Return Value a class to store JSON values creates a diff as a JSON patch == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] diff( link:#nlohmann-basic_json-00[basic_json] const& source, link:#nlohmann-basic_json-00[basic_json] const& target, link:#nlohmann-basic_json-00-string_t[string_t] const& path = ""); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *source* | a class to store JSON values | *target* | a class to store JSON values | *path* | a type for a string |=== create a JSON value from an input in BJData format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_bjdata( InputType&& i, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values create a JSON value from an input in BJData format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_bjdata( IteratorType first, IteratorType last, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_bson( detail::span_input_adapter&& i, bool const strict = true, bool const allow_exceptions = true); ---- create a JSON value from an input in BSON format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_bson( InputType&& i, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values create a JSON value from an input in BSON format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_bson( IteratorType first, IteratorType last, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_bson( T const* ptr, std::size_t len, bool const strict = true, bool const allow_exceptions = true); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_cbor( detail::span_input_adapter&& i, bool const strict = true, bool const allow_exceptions = true, link:#nlohmann-basic_json-00-cbor_tag_handler_t[cbor_tag_handler_t] const tag_handler = cbor_tag_handler_t::error); ---- create a JSON value from an input in CBOR format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_cbor( InputType&& i, bool const strict = true, bool const allow_exceptions = true, link:#nlohmann-basic_json-00-cbor_tag_handler_t[cbor_tag_handler_t] const tag_handler = cbor_tag_handler_t::error); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *tag_handler* | how to treat CBOR tags |=== create a JSON value from an input in CBOR format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_cbor( IteratorType first, IteratorType last, bool const strict = true, bool const allow_exceptions = true, link:#nlohmann-basic_json-00-cbor_tag_handler_t[cbor_tag_handler_t] const tag_handler = cbor_tag_handler_t::error); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *tag_handler* | how to treat CBOR tags |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_cbor( T const* ptr, std::size_t len, bool const strict = true, bool const allow_exceptions = true, link:#nlohmann-basic_json-00-cbor_tag_handler_t[cbor_tag_handler_t] const tag_handler = cbor_tag_handler_t::error); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_msgpack( detail::span_input_adapter&& i, bool const strict = true, bool const allow_exceptions = true); ---- create a JSON value from an input in MessagePack format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_msgpack( InputType&& i, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values create a JSON value from an input in MessagePack format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_msgpack( IteratorType first, IteratorType last, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_msgpack( T const* ptr, std::size_t len, bool const strict = true, bool const allow_exceptions = true); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_ubjson( detail::span_input_adapter&& i, bool const strict = true, bool const allow_exceptions = true); ---- create a JSON value from an input in UBJSON format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_ubjson( InputType&& i, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values create a JSON value from an input in UBJSON format == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] from_ubjson( IteratorType first, IteratorType last, bool const strict = true, bool const allow_exceptions = true); ---- == Return Value a class to store JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] from_ubjson( T const* ptr, std::size_t len, bool const strict = true, bool const allow_exceptions = true); ---- returns the allocator associated with the container == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static link:#nlohmann-basic_json-00-allocator_type[allocator_type] get_allocator(); ---- == Return Value the allocator type wrapper to access iterator member functions in range‐based for == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] static link:#nlohmann-basic_json-00[iteration_proxy<const_iterator>] iterator_wrapper(link:#nlohmann-basic_json-00-const_reference[const_reference] ref) noexcept; ---- == Parameters [cols=2] |=== | Name | Description | *ref* | the type of an element const reference |=== wrapper to access iterator member functions in range‐based for == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] static link:#nlohmann-basic_json-00[iteration_proxy<iterator>] iterator_wrapper(link:#nlohmann-basic_json-00-reference[reference] ref) noexcept; ---- == Parameters [cols=2] |=== | Name | Description | *ref* | the type of an element reference |=== returns version information on the library == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] meta(); ---- == Return Value a class to store JSON values explicitly create an object from an initializer list == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] object(link:#nlohmann-basic_json-00-initializer_list_t[initializer_list_t] init = {}); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *init* | helper type for initializer lists of basic_json values |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__warn_unused_result__, __deprecated__]] static link:#nlohmann-basic_json-00[basic_json] parse( detail::span_input_adapter&& i, link:#nlohmann-basic_json-00-parser_callback_t[parser_callback_t] cb = nullptr, bool const allow_exceptions = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- deserialize from a compatible input == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] parse( InputType&& i, link:#nlohmann-basic_json-00-parser_callback_t[parser_callback_t] cb = nullptr, bool const allow_exceptions = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *cb* | per‐element parser callback type |=== deserialize from a pair of character iterators == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename IteratorType> [[__warn_unused_result__]] static link:#nlohmann-basic_json-00[basic_json] parse( IteratorType first, IteratorType last, link:#nlohmann-basic_json-00-parser_callback_t[parser_callback_t] cb = nullptr, bool const allow_exceptions = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- == Return Value a class to store JSON values == Parameters [cols=2] |=== | Name | Description | *cb* | per‐element parser callback type |=== generate SAX events == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename SAX> [[__deprecated__, __nonnull__]] static bool sax_parse( detail::span_input_adapter&& i, SAX* sax, link:#nlohmann-basic_json-00-input_format_t[input_format_t] format = input_format_t::json, bool const strict = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- generate SAX events == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename InputType, typename SAX> [[__nonnull__]] static bool sax_parse( InputType&& i, SAX* sax, link:#nlohmann-basic_json-00-input_format_t[input_format_t] format = input_format_t::json, bool const strict = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- generate SAX events == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class IteratorType, class SAX> [[__nonnull__]] static bool sax_parse( IteratorType first, IteratorType last, SAX* sax, link:#nlohmann-basic_json-00-input_format_t[input_format_t] format = input_format_t::json, bool const strict = true, bool const ignore_comments = false, bool const ignore_trailing_commas = false); ---- create a BJData serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::vector<uint8_t> to_bjdata( link:#nlohmann-basic_json-00[basic_json] const& j, bool const use_size = false, bool const use_type = false, link:#nlohmann-basic_json-00-bjdata_version_t[bjdata_version_t] const version = bjdata_version_t::draft2); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values | *version* | how to encode BJData |=== create a BJData serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_bjdata( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<uint8_t> o, bool const use_size = false, bool const use_type = false, link:#nlohmann-basic_json-00-bjdata_version_t[bjdata_version_t] const version = bjdata_version_t::draft2); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values | *version* | how to encode BJData |=== create a BJData serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_bjdata( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<char> o, bool const use_size = false, bool const use_type = false, link:#nlohmann-basic_json-00-bjdata_version_t[bjdata_version_t] const version = bjdata_version_t::draft2); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values | *version* | how to encode BJData |=== create a BSON serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::vector<uint8_t> to_bson(link:#nlohmann-basic_json-00[basic_json] const& j); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a BSON serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_bson( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<uint8_t> o); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a BSON serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_bson( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<char> o); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a CBOR serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::vector<uint8_t> to_cbor(link:#nlohmann-basic_json-00[basic_json] const& j); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a CBOR serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_cbor( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<uint8_t> o); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a CBOR serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_cbor( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<char> o); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a MessagePack serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::vector<uint8_t> to_msgpack(link:#nlohmann-basic_json-00[basic_json] const& j); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a MessagePack serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_msgpack( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<uint8_t> o); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a MessagePack serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_msgpack( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<char> o); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a UBJSON serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::vector<uint8_t> to_ubjson( link:#nlohmann-basic_json-00[basic_json] const& j, bool const use_size = false, bool const use_type = false); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a UBJSON serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_ubjson( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<uint8_t> o, bool const use_size = false, bool const use_type = false); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== create a UBJSON serialization of a given JSON value == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void to_ubjson( link:#nlohmann-basic_json-00[basic_json] const& j, detail::output_adapter<char> o, bool const use_size = false, bool const use_type = false); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== an internal type for a backed binary type == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename BinaryType> class byte_container_with_subtype : public BinaryType ---- == Base Classes [cols=2] |=== | Name | Description | `BinaryType` | |=== == Types [cols=1] |=== | Name | link:#nlohmann-byte_container_with_subtype-04-container_type[`container_type`] | link:#nlohmann-byte_container_with_subtype-04-subtype_type[`subtype_type`] |=== == Member Functions [cols=2] |=== | Name | Description | link:#nlohmann-byte_container_with_subtype-04-2constructor-05[`byte_container_with_subtype`] [.small]#[constructor]# | Default constructor | link:#nlohmann-byte_container_with_subtype-04-2constructor-0e[`byte_container_with_subtype`] [.small]#[constructor]# | Construct from `container_type` | link:#nlohmann-byte_container_with_subtype-04-2constructor-01[`byte_container_with_subtype`] [.small]#[constructor]# | Construct from `container_type` | link:#nlohmann-byte_container_with_subtype-04-2constructor-07[`byte_container_with_subtype`] [.small]#[constructor]# | | link:#nlohmann-byte_container_with_subtype-04-2constructor-04[`byte_container_with_subtype`] [.small]#[constructor]# | | link:#nlohmann-byte_container_with_subtype-04-clear_subtype[`clear_subtype`] | clears the binary subtype | link:#nlohmann-byte_container_with_subtype-04-has_subtype[`has_subtype`] | return whether the value has a subtype | link:#nlohmann-byte_container_with_subtype-04-set_subtype[`set_subtype`] | sets the binary subtype | link:#nlohmann-byte_container_with_subtype-04-subtype[`subtype`] | return the binary subtype | link:#nlohmann-byte_container_with_subtype-04-operator_eq[`operator==`] | Equality operator | link:#nlohmann-byte_container_with_subtype-04-operator_not_eq[`operator!=`] | Inequality operator |=== == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using container_type = BinaryType; ---- == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using subtype_type = uint64_t; ---- Default constructor == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- byte_container_with_subtype() noexcept(noexcept(container_type())); ---- Construct from `container_type` == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- byte_container_with_subtype(link:#nlohmann-byte_container_with_subtype-04-container_type[container_type] const& b) noexcept(noexcept(container_type(b))); ---- == Parameters [cols=2] |=== | Name | Description | *b* | The object to copy construct from |=== Construct from `container_type` == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- byte_container_with_subtype(link:#nlohmann-byte_container_with_subtype-04-container_type[container_type]&& b) noexcept(noexcept(container_type(std::move(b)))); ---- == Parameters [cols=2] |=== | Name | Description | *b* | The object to move construct from |=== == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- byte_container_with_subtype( link:#nlohmann-byte_container_with_subtype-04-container_type[container_type] const& b, link:#nlohmann-byte_container_with_subtype-04-subtype_type[subtype_type] subtype_) noexcept(noexcept(container_type(b))); ---- == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- byte_container_with_subtype( link:#nlohmann-byte_container_with_subtype-04-container_type[container_type]&& b, link:#nlohmann-byte_container_with_subtype-04-subtype_type[subtype_type] subtype_) noexcept(noexcept(container_type(std::move(b)))); ---- clears the binary subtype == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void clear_subtype() noexcept; ---- return whether the value has a subtype == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool has_subtype() const noexcept; ---- sets the binary subtype == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void set_subtype(link:#nlohmann-byte_container_with_subtype-04-subtype_type[subtype_type] subtype_) noexcept; ---- return the binary subtype == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr link:#nlohmann-byte_container_with_subtype-04-subtype_type[subtype_type] subtype() const noexcept; ---- Equality operator == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool operator==(link:#nlohmann-byte_container_with_subtype-04[byte_container_with_subtype] const& rhs) const; ---- == Return Value `true` if the objects are equal, `false` otherwise == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== Inequality operator == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool operator!=(link:#nlohmann-byte_container_with_subtype-04[byte_container_with_subtype] const& rhs) const; ---- == Return Value `true` if the objects are not equal, `false` otherwise == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> class link:#nlohmann-byte_container_with_subtype-04[byte_container_with_subtype]<vector<unsigned char>> : public vector<unsigned char> ---- == Base Classes [cols=2] |=== | Name | Description | `vector<unsigned char>` | |=== == Types [cols=1] |=== | Name | link:#nlohmann-byte_container_with_subtype-09-container_type[`container_type`] | link:#nlohmann-byte_container_with_subtype-09-subtype_type[`subtype_type`] |=== == Member Functions [cols=2] |=== | Name | Description | link:#nlohmann-byte_container_with_subtype-09-2constructor-0a[`byte_container_with_subtype`] [.small]#[constructor]# | Constructors | link:#nlohmann-byte_container_with_subtype-09-clear_subtype[`clear_subtype`] | | link:#nlohmann-byte_container_with_subtype-09-has_subtype[`has_subtype`] | | link:#nlohmann-byte_container_with_subtype-09-set_subtype[`set_subtype`] | | link:#nlohmann-byte_container_with_subtype-09-subtype[`subtype`] | | link:#nlohmann-byte_container_with_subtype-09-operator_eq[`operator==`] | Equality operator | link:#nlohmann-byte_container_with_subtype-09-operator_not_eq[`operator!=`] | Inequality operator |=== == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using container_type = vector<unsigned char>; ---- == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using subtype_type = uint64_t; ---- Constructors == Synopses Declared in `<nlohmann/byte_container_with_subtype.hpp>` Default constructor [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-byte_container_with_subtype-09-2constructor-0f[byte_container_with_subtype]() noexcept(noexcept(container_type())); ---- [.small]#link:#nlohmann-byte_container_with_subtype-09-2constructor-0f[_» more..._]# Construct from `container_type` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-byte_container_with_subtype-09-2constructor-01[byte_container_with_subtype](link:#nlohmann-byte_container_with_subtype-09-container_type[container_type] const& b) noexcept(noexcept(container_type(b))); ---- [.small]#link:#nlohmann-byte_container_with_subtype-09-2constructor-01[_» more..._]# Construct from `container_type` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-byte_container_with_subtype-09-2constructor-09[byte_container_with_subtype](link:#nlohmann-byte_container_with_subtype-09-container_type[container_type]&& b) noexcept(noexcept(container_type(std::move(b)))); ---- [.small]#link:#nlohmann-byte_container_with_subtype-09-2constructor-09[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-byte_container_with_subtype-09-2constructor-0d[byte_container_with_subtype]( link:#nlohmann-byte_container_with_subtype-09-container_type[container_type] const& b, link:#nlohmann-byte_container_with_subtype-04-subtype_type[subtype_type] subtype_) noexcept(noexcept(container_type(b))); ---- [.small]#link:#nlohmann-byte_container_with_subtype-09-2constructor-0d[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-byte_container_with_subtype-09-2constructor-07[byte_container_with_subtype]( link:#nlohmann-byte_container_with_subtype-09-container_type[container_type]&& b, link:#nlohmann-byte_container_with_subtype-04-subtype_type[subtype_type] subtype_) noexcept(noexcept(container_type(std::move(b)))); ---- [.small]#link:#nlohmann-byte_container_with_subtype-09-2constructor-07[_» more..._]# Default constructor == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- byte_container_with_subtype() noexcept(noexcept(container_type())); ---- Construct from `container_type` == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- byte_container_with_subtype(link:#nlohmann-byte_container_with_subtype-09-container_type[container_type] const& b) noexcept(noexcept(container_type(b))); ---- == Parameters [cols=2] |=== | Name | Description | *b* | The object to copy construct from |=== Construct from `container_type` == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- byte_container_with_subtype(link:#nlohmann-byte_container_with_subtype-09-container_type[container_type]&& b) noexcept(noexcept(container_type(std::move(b)))); ---- == Parameters [cols=2] |=== | Name | Description | *b* | The object to move construct from |=== == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- byte_container_with_subtype( link:#nlohmann-byte_container_with_subtype-09-container_type[container_type] const& b, link:#nlohmann-byte_container_with_subtype-04-subtype_type[subtype_type] subtype_) noexcept(noexcept(container_type(b))); ---- == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- byte_container_with_subtype( link:#nlohmann-byte_container_with_subtype-09-container_type[container_type]&& b, link:#nlohmann-byte_container_with_subtype-04-subtype_type[subtype_type] subtype_) noexcept(noexcept(container_type(std::move(b)))); ---- == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void clear_subtype() noexcept; ---- == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr bool has_subtype() const noexcept; ---- == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void set_subtype(link:#nlohmann-byte_container_with_subtype-04-subtype_type[subtype_type] subtype_) noexcept; ---- == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr link:#nlohmann-byte_container_with_subtype-04-subtype_type[subtype_type] subtype() const noexcept; ---- Equality operator == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool operator==(link:#nlohmann-byte_container_with_subtype-04[byte_container_with_subtype<vector<unsigned char>>] const& rhs) const; ---- == Return Value `true` if the objects are equal, `false` otherwise == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== Inequality operator == Synopsis Declared in `<nlohmann/byte_container_with_subtype.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- bool operator!=(link:#nlohmann-byte_container_with_subtype-04[byte_container_with_subtype<vector<unsigned char>>] const& rhs) const; ---- == Return Value `true` if the objects are not equal, `false` otherwise == Parameters [cols=2] |=== | Name | Description | *rhs* | The right operand |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename> class json_pointer; ---- JSON Pointer defines a string syntax for identifying a specific value within a JSON document == Synopsis Declared in `<nlohmann/json_fwd.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename RefStringType> class json_pointer; ---- == Friends [cols=2] |=== | Name | Description | `nlohmann::operator/` | create a new JSON pointer by appending the array‐index‐token at the end of the JSON pointer | `nlohmann::operator/` | create a new JSON pointer by appending the unescaped token at the end of the JSON pointer | `nlohmann::operator/` | create a new JSON pointer by appending the right JSON pointer at the end of the left JSON pointer | `nlohmann::operator<<` | write string representation of the JSON pointer to stream | `link:#nlohmann-json_pointer-0a[nlohmann::json_pointer]` | JSON Pointer defines a string syntax for identifying a specific value within a JSON document | `link:#nlohmann-basic_json-00[nlohmann::basic_json]` | a class to store JSON values |=== a minimal map‐like container that preserves insertion order == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class Key, class T, class IgnoredLess, class Allocator> struct ordered_map : std::vector<std::pair<Key const, T>, Allocator> ---- == Base Classes [cols=2] |=== | Name | Description | `std::vector<std::pair<Key const, T>, Allocator>` | |=== == Types [cols=1] |=== | Name | link:#nlohmann-ordered_map-Container[`Container`] | link:#nlohmann-ordered_map-const_iterator[`const_iterator`] | link:#nlohmann-ordered_map-iterator[`iterator`] | link:#nlohmann-ordered_map-key_compare[`key_compare`] | link:#nlohmann-ordered_map-key_type[`key_type`] | link:#nlohmann-ordered_map-mapped_type[`mapped_type`] | link:#nlohmann-ordered_map-require_input_iter[`require_input_iter`] | link:#nlohmann-ordered_map-size_type[`size_type`] | link:#nlohmann-ordered_map-value_type[`value_type`] |=== == Member Functions [cols=2] |=== | Name | Description | link:#nlohmann-ordered_map-2constructor-0c[`ordered_map`] [.small]#[constructor]# | Constructors | link:#nlohmann-ordered_map-at-00[`at`] | | link:#nlohmann-ordered_map-count-0b[`count`] | | link:#nlohmann-ordered_map-emplace-0e[`emplace`] | | link:#nlohmann-ordered_map-erase-08[`erase`] | | link:#nlohmann-ordered_map-find-033[`find`] | | link:#nlohmann-ordered_map-insert-02c[`insert`] | | link:#nlohmann-ordered_map-operator_subs-08[`operator[]`] | Subscript operators |=== == Description ordered_map: a minimal map‐like container that preserves insertion order for use within nlohmann::basic_json<ordered_map> == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using Container = std::vector<std::pair<Key const, T>, Allocator>; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using const_iterator = Container::const_iterator; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using iterator = Container::iterator; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using key_compare = std::equal_to; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using key_type = Key; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using mapped_type = T; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename InputIt> using require_input_iter = void; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using size_type = Container::size_type; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using value_type = Container::value_type; ---- Constructors == Synopses Declared in `<nlohmann/ordered_map.hpp>` Default constructor [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-2constructor-08[ordered_map]() noexcept(noexcept(Container())); ---- [.small]#link:#nlohmann-ordered_map-2constructor-08[_» more..._]# Construct from `Allocator` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit link:#nlohmann-ordered_map-2constructor-03[ordered_map](Allocator const& alloc) noexcept(noexcept(Container(alloc))); ---- [.small]#link:#nlohmann-ordered_map-2constructor-03[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-2constructor-0f[ordered_map]( std::initializer_list<value_type> init, Allocator const& alloc = Allocator()); ---- [.small]#link:#nlohmann-ordered_map-2constructor-0f[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class It> link:#nlohmann-ordered_map-2constructor-0d[ordered_map]( It first, It last, Allocator const& alloc = Allocator()); ---- [.small]#link:#nlohmann-ordered_map-2constructor-0d[_» more..._]# Default constructor == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- ordered_map() noexcept(noexcept(Container())); ---- Construct from `Allocator` == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit ordered_map(Allocator const& alloc) noexcept(noexcept(Container(alloc))); ---- == Parameters [cols=2] |=== | Name | Description | *alloc* | The object to copy construct from |=== == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- ordered_map( std::initializer_list<value_type> init, Allocator const& alloc = Allocator()); ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class It> ordered_map( It first, It last, Allocator const& alloc = Allocator()); ---- == Synopses Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- T& link:#nlohmann-ordered_map-at-07[at](link:#nlohmann-ordered_map-key_type[key_type] const& key); ---- [.small]#link:#nlohmann-ordered_map-at-07[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- T const& link:#nlohmann-ordered_map-at-09[at](link:#nlohmann-ordered_map-key_type[key_type] const& key) const; ---- [.small]#link:#nlohmann-ordered_map-at-09[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value T const& link:#nlohmann-ordered_map-at-0db[at](KeyType&& key) const; ---- [.small]#link:#nlohmann-ordered_map-at-0db[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value T& link:#nlohmann-ordered_map-at-0d7[at](KeyType&& key); ---- [.small]#link:#nlohmann-ordered_map-at-0d7[_» more..._]# == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- T& at(link:#nlohmann-ordered_map-key_type[key_type] const& key); ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- T const& at(link:#nlohmann-ordered_map-key_type[key_type] const& key) const; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value T const& at(KeyType&& key) const; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value T& at(KeyType&& key); ---- == Synopses Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-size_type[size_type] link:#nlohmann-ordered_map-count-04[count](link:#nlohmann-ordered_map-key_type[key_type] const& key) const; ---- [.small]#link:#nlohmann-ordered_map-count-04[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value link:#nlohmann-ordered_map-size_type[size_type] link:#nlohmann-ordered_map-count-0c[count](KeyType&& key) const; ---- [.small]#link:#nlohmann-ordered_map-count-0c[_» more..._]# == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-size_type[size_type] count(link:#nlohmann-ordered_map-key_type[key_type] const& key) const; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value link:#nlohmann-ordered_map-size_type[size_type] count(KeyType&& key) const; ---- == Synopses Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::pair<iterator, bool> link:#nlohmann-ordered_map-emplace-00[emplace]( link:#nlohmann-ordered_map-key_type[key_type] const& key, T&& t); ---- [.small]#link:#nlohmann-ordered_map-emplace-00[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value std::pair<iterator, bool> link:#nlohmann-ordered_map-emplace-01[emplace]( KeyType&& key, T&& t); ---- [.small]#link:#nlohmann-ordered_map-emplace-01[_» more..._]# == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::pair<iterator, bool> emplace( link:#nlohmann-ordered_map-key_type[key_type] const& key, T&& t); ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value std::pair<iterator, bool> emplace( KeyType&& key, T&& t); ---- == Synopses Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-iterator[iterator] link:#nlohmann-ordered_map-erase-0f[erase](link:#nlohmann-ordered_map-iterator[iterator] pos); ---- [.small]#link:#nlohmann-ordered_map-erase-0f[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-size_type[size_type] link:#nlohmann-ordered_map-erase-03[erase](link:#nlohmann-ordered_map-key_type[key_type] const& key); ---- [.small]#link:#nlohmann-ordered_map-erase-03[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value link:#nlohmann-ordered_map-size_type[size_type] link:#nlohmann-ordered_map-erase-0e[erase](KeyType&& key); ---- [.small]#link:#nlohmann-ordered_map-erase-0e[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-iterator[iterator] link:#nlohmann-ordered_map-erase-0a[erase]( link:#nlohmann-ordered_map-iterator[iterator] first, link:#nlohmann-ordered_map-iterator[iterator] last); ---- [.small]#link:#nlohmann-ordered_map-erase-0a[_» more..._]# == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-iterator[iterator] erase(link:#nlohmann-ordered_map-iterator[iterator] pos); ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-size_type[size_type] erase(link:#nlohmann-ordered_map-key_type[key_type] const& key); ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value link:#nlohmann-ordered_map-size_type[size_type] erase(KeyType&& key); ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-iterator[iterator] erase( link:#nlohmann-ordered_map-iterator[iterator] first, link:#nlohmann-ordered_map-iterator[iterator] last); ---- == Synopses Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-iterator[iterator] link:#nlohmann-ordered_map-find-04[find](link:#nlohmann-ordered_map-key_type[key_type] const& key); ---- [.small]#link:#nlohmann-ordered_map-find-04[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-const_iterator[const_iterator] link:#nlohmann-ordered_map-find-00[find](link:#nlohmann-ordered_map-key_type[key_type] const& key) const; ---- [.small]#link:#nlohmann-ordered_map-find-00[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value link:#nlohmann-ordered_map-iterator[iterator] link:#nlohmann-ordered_map-find-03e[find](KeyType&& key); ---- [.small]#link:#nlohmann-ordered_map-find-03e[_» more..._]# == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-iterator[iterator] find(link:#nlohmann-ordered_map-key_type[key_type] const& key); ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- link:#nlohmann-ordered_map-const_iterator[const_iterator] find(link:#nlohmann-ordered_map-key_type[key_type] const& key) const; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value link:#nlohmann-ordered_map-iterator[iterator] find(KeyType&& key); ---- == Synopses Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::pair<iterator, bool> link:#nlohmann-ordered_map-insert-026[insert](link:#nlohmann-ordered_map-value_type[value_type] const& value); ---- [.small]#link:#nlohmann-ordered_map-insert-026[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::pair<iterator, bool> link:#nlohmann-ordered_map-insert-0e[insert](link:#nlohmann-ordered_map-value_type[value_type]&& value); ---- [.small]#link:#nlohmann-ordered_map-insert-0e[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename InputIt, typename = link:#nlohmann-ordered_map-require_input_iter[require_input_iter<InputIt>]> void link:#nlohmann-ordered_map-insert-0c[insert]( InputIt first, InputIt last); ---- [.small]#link:#nlohmann-ordered_map-insert-0c[_» more..._]# == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::pair<iterator, bool> insert(link:#nlohmann-ordered_map-value_type[value_type] const& value); ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::pair<iterator, bool> insert(link:#nlohmann-ordered_map-value_type[value_type]&& value); ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename InputIt, typename = link:#nlohmann-ordered_map-require_input_iter[require_input_iter<InputIt>]> void insert( InputIt first, InputIt last); ---- Subscript operators == Synopses Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- T& link:#nlohmann-ordered_map-operator_subs-07[operator[]](link:#nlohmann-ordered_map-key_type[key_type] const& key); ---- [.small]#link:#nlohmann-ordered_map-operator_subs-07[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- T const& link:#nlohmann-ordered_map-operator_subs-04[operator[]](link:#nlohmann-ordered_map-key_type[key_type] const& key) const; ---- [.small]#link:#nlohmann-ordered_map-operator_subs-04[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value T const& link:#nlohmann-ordered_map-operator_subs-0f[operator[]](KeyType&& key) const; ---- [.small]#link:#nlohmann-ordered_map-operator_subs-0f[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value T& link:#nlohmann-ordered_map-operator_subs-06[operator[]](KeyType&& key); ---- [.small]#link:#nlohmann-ordered_map-operator_subs-06[_» more..._]# == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- T& operator[](link:#nlohmann-ordered_map-key_type[key_type] const& key); ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- T const& operator[](link:#nlohmann-ordered_map-key_type[key_type] const& key) const; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value T const& operator[](KeyType&& key) const; ---- == Synopsis Declared in `<nlohmann/ordered_map.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class KeyType> requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value T& operator[](KeyType&& key); ---- == Synopses Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__nonnull__]] link:#nlohmann-json[nlohmann::json] link:#nlohmann-2function-04[Unnamed function]( char const* s, std::size_t n); ---- [.small]#link:#nlohmann-2function-04[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__nonnull__]] link:#nlohmann-basic_json-0e-json_pointer[nlohmann::json::json_pointer] link:#nlohmann-2function-0b[Unnamed function]( char const* s, std::size_t n); ---- [.small]#link:#nlohmann-2function-0b[_» more..._]# == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__nonnull__]] link:#nlohmann-json[nlohmann::json] Unnamed function( char const* s, std::size_t n); ---- == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__nonnull__]] link:#nlohmann-basic_json-0e-json_pointer[nlohmann::json::json_pointer] Unnamed function( char const* s, std::size_t n); ---- Right shift operators == Synopses Declared in `<nlohmann/json.hpp>` deserialize from stream [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::istream& link:#nlohmann-operator_rshift-0e[operator>>]( std::istream& i, link:#nlohmann-basic_json-00[basic_json]& j); ---- [.small]#link:#nlohmann-operator_rshift-0e[_» more..._]# deserialize from stream [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::istream& link:#nlohmann-operator_rshift-02[operator>>]( std::istream& i, link:#nlohmann-basic_json-00[basic_json]& j); ---- [.small]#link:#nlohmann-operator_rshift-02[_» more..._]# serialize to stream [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] std::ostream& link:#nlohmann-operator_rshift-0d[operator>>]( link:#nlohmann-basic_json-00[basic_json] const& j, std::ostream& o); ---- [.small]#link:#nlohmann-operator_rshift-0d[_» more..._]# serialize to stream [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] std::ostream& link:#nlohmann-operator_rshift-08[operator>>]( link:#nlohmann-basic_json-00[basic_json] const& j, std::ostream& o); ---- [.small]#link:#nlohmann-operator_rshift-08[_» more..._]# deserialize from stream == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::istream& operator>>( std::istream& i, link:#nlohmann-basic_json-00[basic_json]& j); ---- == Parameters [cols=2] |=== | Name | Description | *i* | The left operand | *j* | The right operand |=== deserialize from stream == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::istream& operator>>( std::istream& i, link:#nlohmann-basic_json-00[basic_json]& j); ---- == Parameters [cols=2] |=== | Name | Description | *i* | The left operand | *j* | The right operand |=== serialize to stream == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] std::ostream& operator>>( link:#nlohmann-basic_json-00[basic_json] const& j, std::ostream& o); ---- == Parameters [cols=2] |=== | Name | Description | *j* | The left operand | *o* | The right operand |=== serialize to stream == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] std::ostream& operator>>( link:#nlohmann-basic_json-00[basic_json] const& j, std::ostream& o); ---- == Parameters [cols=2] |=== | Name | Description | *j* | The left operand | *o* | The right operand |=== exchanges the values == Synopses Declared in `<nlohmann/json.hpp>` exchanges the values [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void link:#nlohmann-swap-05[swap]( link:#nlohmann-basic_json-0e-reference[reference] left, link:#nlohmann-basic_json-0e-reference[reference] right) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value); ---- [.small]#link:#nlohmann-swap-05[_» more..._]# exchanges the values [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void link:#nlohmann-swap-03[swap]( link:#nlohmann-basic_json-00-reference[reference] left, link:#nlohmann-basic_json-00-reference[reference] right) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value); ---- [.small]#link:#nlohmann-swap-03[_» more..._]# exchanges the values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap( link:#nlohmann-basic_json-0e-reference[reference] left, link:#nlohmann-basic_json-0e-reference[reference] right) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value); ---- == Parameters [cols=2] |=== | Name | Description | *left* | the type of an element reference | *right* | the type of an element reference |=== exchanges the values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap( link:#nlohmann-basic_json-00-reference[reference] left, link:#nlohmann-basic_json-00-reference[reference] right) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value); ---- == Parameters [cols=2] |=== | Name | Description | *left* | the type of an element reference | *right* | the type of an element reference |=== user‐defined to_string function for JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< template< typename, typename, typename...> typename ObjectType, template< typename, typename...> typename ArrayType, class StringType, class BooleanType, class NumberIntegerType, class NumberUnsignedType, class NumberFloatType, template<typename> typename AllocatorType, template< typename, typename = void> typename JSONSerializer, class BinaryType, class CustomBaseClass> std::string to_string(link:#nlohmann-basic_json-00[basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>] const& j); ---- == Parameters [cols=2] |=== | Name | Description | *j* | a class to store JSON values |=== Left shift operators == Synopses Declared in `<nlohmann/json.hpp>` deserialize from stream [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] std::istream& link:#nlohmann-operator_lshift-07[operator<<]( link:#nlohmann-basic_json-00[basic_json]& j, std::istream& i); ---- [.small]#link:#nlohmann-operator_lshift-07[_» more..._]# serialize to stream [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::ostream& link:#nlohmann-operator_lshift-03[operator<<]( std::ostream& o, link:#nlohmann-basic_json-00[basic_json] const& j); ---- [.small]#link:#nlohmann-operator_lshift-03[_» more..._]# write string representation of the JSON pointer to stream [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& o, link:#nlohmann-json_pointer-0a[json_pointer] const& ptr); ---- [.small]#[_» more..._]# deserialize from stream [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] std::istream& link:#nlohmann-operator_lshift-053[operator<<]( link:#nlohmann-basic_json-00[basic_json]& j, std::istream& i); ---- [.small]#link:#nlohmann-operator_lshift-053[_» more..._]# serialize to stream [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::ostream& link:#nlohmann-operator_lshift-01[operator<<]( std::ostream& o, link:#nlohmann-basic_json-00[basic_json] const& j); ---- [.small]#link:#nlohmann-operator_lshift-01[_» more..._]# deserialize from stream == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] std::istream& operator<<( link:#nlohmann-basic_json-00[basic_json]& j, std::istream& i); ---- == Parameters [cols=2] |=== | Name | Description | *j* | The left operand | *i* | The right operand |=== serialize to stream == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& o, link:#nlohmann-basic_json-00[basic_json] const& j); ---- == Return Value Reference to the current output stream == Parameters [cols=2] |=== | Name | Description | *o* | An output stream | *j* | The object to output |=== deserialize from stream == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[__deprecated__]] std::istream& operator<<( link:#nlohmann-basic_json-00[basic_json]& j, std::istream& i); ---- == Parameters [cols=2] |=== | Name | Description | *j* | The left operand | *i* | The right operand |=== serialize to stream == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::ostream& operator<<( std::ostream& o, link:#nlohmann-basic_json-00[basic_json] const& j); ---- == Return Value Reference to the current output stream == Parameters [cols=2] |=== | Name | Description | *o* | An output stream | *j* | The object to output |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using nlohmann::literals::json_literals::; ---- == Introduced Symbols [cols=1] |=== | Name | link:#nlohmann-2function-04[nlohmann::] |=== == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- using nlohmann::literals::json_literals::; ---- == Introduced Symbols [cols=1] |=== | Name | link:#nlohmann-2function-0b[nlohmann::] |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#