CINXE.COM

GitHub - nlohmann/json: JSON for Modern C++

<!DOCTYPE html> <html lang="en" data-color-mode="auto" data-light-theme="light" data-dark-theme="dark" data-a11y-animated-images="system" data-a11y-link-underlines="true" > <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> <link rel="preconnect" href="https://github.githubassets.com" crossorigin> <link rel="preconnect" href="https://avatars.githubusercontent.com"> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/light-74231a1f3bbb.css" /><link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/dark-8a995f0bacd4.css" /><link data-color-theme="dark_dimmed" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_dimmed-f37fb7684b1f.css" /><link data-color-theme="dark_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_high_contrast-9ac301c3ebe5.css" /><link data-color-theme="dark_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_colorblind-cd826e8636dc.css" /><link data-color-theme="light_colorblind" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_colorblind-f91b0f603451.css" /><link data-color-theme="light_high_contrast" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_high_contrast-83beb16e0ecf.css" /><link data-color-theme="light_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/light_tritanopia-6e122dab64fc.css" /><link data-color-theme="dark_tritanopia" crossorigin="anonymous" media="all" rel="stylesheet" data-href="https://github.githubassets.com/assets/dark_tritanopia-18119e682df0.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-primitives-225433424a87.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-aaa714e5674d.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-7d4d2344e7ab.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/github-43ae85d4871b.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repository-4fce88777fa8.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-0210be90f4d3.css" /> <script type="application/json" id="client-env">{"locale":"en","featureFlags":["a11y_quote_reply_fix","copilot_immersive_issue_preview","copilot_new_references_ui","copilot_chat_repo_custom_instructions_preview","copilot_no_floating_button","copilot_topics_as_references","copilot_read_shared_conversation","copilot_duplicate_thread","copilot_buffered_streaming","dotcom_chat_client_side_skills","experimentation_azure_variant_endpoint","failbot_handle_non_errors","fgpat_form_ui_updates","geojson_azure_maps","ghost_pilot_confidence_truncation_25","ghost_pilot_confidence_truncation_40","github_models_o3_mini_streaming","hovercard_accessibility","insert_before_patch","issues_react_remove_placeholders","issues_react_blur_item_picker_on_close","marketing_pages_search_explore_provider","primer_react_css_modules_ga","react_data_router_pull_requests","remove_child_patch","sample_network_conn_type","swp_enterprise_contact_form","site_proxima_australia_update","viewscreen_sandbox","issues_react_create_milestone","issues_react_cache_fix_workaround","lifecycle_label_name_updates","copilot_task_oriented_assistive_prompts","issues_react_assignee_warning","issue_types_prevent_private_type_creation","turbo_app_id_restore"]}</script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/wp-runtime-7e63cc235734.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover_js-9da652f58479.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_arianotify-polyfill_ariaNotify-polyfill_js-node_modules_github_mi-3abb8f-46b9f4874d95.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_failbot_failbot_ts-75968cfb5298.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/environment-f04cb2a9fc8c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_primer_behaviors_dist_esm_index_mjs-0dbb79f97f8f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_selector-observer_dist_index_esm_js-f690fd9ae3d5.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_relative-time-element_dist_index_js-62d275b7ddd9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_text-expander-element_dist_index_js-78748950cb0c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_auto-complete-element_dist_index_js-node_modules_github_catalyst_-8e9f78-a90ac05d2469.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-b5f1d7-a1760ffda83d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_markdown-toolbar-element_dist_index_js-ceef33f593fa.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-c44a69-8c52cf4cd0d3.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/github-elements-394f8eb34f19.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/element-registry-0bebfa1427c4.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_braintree_browser-detection_dist_browser-detection_js-node_modules_githu-2906d7-2a07a295af40.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_lit-html_lit-html_js-be8cb88f481b.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_morphdom_dist_morphdom-e-7c534c-a4a1922eb55f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_turbo_dist_turbo_es2017-esm_js-a03ee12d659a.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-893f9f-b6294cf703b7.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_color-convert_index_js-e3180fe3bcb3.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_quote-selection_dist_index_js-node_modules_github_session-resume_-947061-e7a6c4a19f98.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_updatable-content_updatable-content_ts-2a55124d5c52.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_task-list_ts-app_assets_modules_github_sso_ts-ui_packages-900dde-768abe60b1f8.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_sticky-scroll-into-view_ts-3e000c5d31a9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_ajax-error_ts-app_assets_modules_github_behaviors_include-87a4ae-8be71414579a.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_behaviors_commenting_edit_ts-app_assets_modules_github_behaviors_ht-83c235-e429cff6ceb1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/behaviors-7ebb6421bf22.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_delegated-events_dist_index_js-node_modules_github_catalyst_lib_index_js-f6223d90c7ba.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-global-01e85cd1be94.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_virtualized-list_es_index_js-node_modules_github_template-parts_lib_index_js-94dc7a2157c1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-70450e-4b93df70b903.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/app_assets_modules_github_ref-selector_ts-3e9d848bab5f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/codespaces-c3bcacfe317c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_filter-input-element_dist_index_js-node_modules_github_remote-inp-3eebbd-0763620ad7bf.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_decorators_js-node_modules_delegated-events_di-e161aa-9d41fb1b6c9e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_github_remote--3c9c82-b71ef90fbdc7.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repositories-7a0dbaa42c57.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_github_catalyst_lib_inde-dbbea9-26cce2010167.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/code-menu-1c0aedc134b1.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/primer-react-e05a7c4c5398.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-core-6a3ef8158713.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/react-lib-f1bca44e0926.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/octicons-react-cf2f2ab8dab4.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_emotion_is-prop-valid_dist_emotion-is-prop-valid_esm_js-node_modules_emo-62da9f-2df2f32ec596.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_mini-throttle_dist_index_js-node_modules_stacktrace-parser_dist_s-e7dcdd-9a233856b02c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_oddbird_popover-polyfill_dist_popover-fn_js-55fea94174bf.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/notifications-subscriptions-menu-58a0c58bfee4.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.e0c9f0687c56358ed85e.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/notifications-subscriptions-menu.1bcff9205c241e99cff2.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.e0c9f0687c56358ed85e.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/notifications-subscriptions-menu.1bcff9205c241e99cff2.module.css" /> <title>GitHub - nlohmann/json: JSON for Modern C++</title> <meta name="route-pattern" content="/:user_id/:repository" data-turbo-transient> <meta name="route-controller" content="files" data-turbo-transient> <meta name="route-action" content="disambiguate" data-turbo-transient> <meta name="current-catalog-service-hash" content="f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb"> <meta name="request-id" content="95BA:33D1B2:2A1181:3462EF:67E066B6" data-pjax-transient="true"/><meta name="html-safe-nonce" content="d70a2f9d910cea3a523cc747f3372acb601b55991696a673ad7d20cf9af61078" data-pjax-transient="true"/><meta name="visitor-payload" content="eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUJBOjMzRDFCMjoyQTExODE6MzQ2MkVGOjY3RTA2NkI2IiwidmlzaXRvcl9pZCI6IjYxMDY3MTYwNDk0NTM5MDE0OTQiLCJyZWdpb25fZWRnZSI6InNvdXRoZWFzdGFzaWEiLCJyZWdpb25fcmVuZGVyIjoic291dGhlYXN0YXNpYSJ9" data-pjax-transient="true"/><meta name="visitor-hmac" content="ae986e0ca9a99b2380698b8f5ff56d64ccf9415ee653cfd0f1f8b87b86f8d887" data-pjax-transient="true"/> <meta name="hovercard-subject-tag" content="repository:11171548" data-turbo-transient> <meta name="github-keyboard-shortcuts" content="repository,copilot" data-turbo-transient="true" /> <meta name="selected-link" value="repo_source" data-turbo-transient> <link rel="assets" href="https://github.githubassets.com/"> <meta name="google-site-verification" content="Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I"> <meta name="octolytics-url" content="https://collector.github.com/github/collect" /> <meta name="analytics-location" content="/&lt;user-name&gt;/&lt;repo-name&gt;" data-turbo-transient="true" /> <meta name="user-login" content=""> <meta name="viewport" content="width=device-width"> <meta name="description" content="JSON for Modern C++. Contribute to nlohmann/json development by creating an account on GitHub."> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> <meta property="fb:app_id" content="1401488693436528"> <meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://github.com/nlohmann/json" /> <meta name="twitter:image" content="https://repository-images.githubusercontent.com/11171548/a403c600-b5f0-11e9-8db8-2d5e6ec2ac98" /><meta name="twitter:site" content="@github" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="GitHub - nlohmann/json: JSON for Modern C++" /><meta name="twitter:description" content="JSON for Modern C++. Contribute to nlohmann/json development by creating an account on GitHub." /> <meta property="og:image" content="https://repository-images.githubusercontent.com/11171548/a403c600-b5f0-11e9-8db8-2d5e6ec2ac98" /><meta property="og:image:alt" content="JSON for Modern C++. Contribute to nlohmann/json development by creating an account on GitHub." /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="GitHub - nlohmann/json: JSON for Modern C++" /><meta property="og:url" content="https://github.com/nlohmann/json" /><meta property="og:description" content="JSON for Modern C++. Contribute to nlohmann/json development by creating an account on GitHub." /> <meta name="hostname" content="github.com"> <meta name="expected-hostname" content="github.com"> <meta http-equiv="x-pjax-version" content="052a71b7c02165fbf2715bdbfbab05187e4b16e53a581d8594996a90b2e7e0b4" data-turbo-track="reload"> <meta http-equiv="x-pjax-csp-version" content="77190eb53eb47fc30bd2fcc17a7eefa2dfd8505869fee9299ba911be3a40a9eb" data-turbo-track="reload"> <meta http-equiv="x-pjax-css-version" content="3c046d4b918199cbb4d255cca63226853d0617dbae6529663229394aa9b0742a" data-turbo-track="reload"> <meta http-equiv="x-pjax-js-version" content="1529793745024e41638e0c5e8b0d9e42797bb9de3789d89787088aa632e6de83" data-turbo-track="reload"> <meta name="turbo-cache-control" content="no-preview" data-turbo-transient=""> <meta data-hydrostats="publish"> <meta name="go-import" content="github.com/nlohmann/json git https://github.com/nlohmann/json.git"> <meta name="octolytics-dimension-user_id" content="159488" /><meta name="octolytics-dimension-user_login" content="nlohmann" /><meta name="octolytics-dimension-repository_id" content="11171548" /><meta name="octolytics-dimension-repository_nwo" content="nlohmann/json" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="11171548" /><meta name="octolytics-dimension-repository_network_root_nwo" content="nlohmann/json" /> <link rel="canonical" href="https://github.com/nlohmann/json" data-turbo-transient> <meta name="turbo-body-classes" content="logged-out env-production page-responsive"> <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> <meta name="release" content="c452c9dda983c67755073a578000a324ee049ecd"> <link rel="mask-icon" href="https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg" color="#000000"> <link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://github.githubassets.com/favicons/favicon.png"> <link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://github.githubassets.com/favicons/favicon.svg" data-base-href="https://github.githubassets.com/favicons/favicon"> <meta name="theme-color" content="#1e2327"> <meta name="color-scheme" content="light dark" /> <link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> </head> <body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div data-turbo-body class="logged-out env-production page-responsive" style="word-wrap: break-word;"> <div class="position-relative header-wrapper js-header-wrapper "> <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a> <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full"> <span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span> </span> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_ui-commands_ui-commands_ts-8c874fb594e9.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/keyboard-shortcuts-dialog-33dfb803e078.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.e0c9f0687c56358ed85e.module.css" /> <react-partial partial-name="keyboard-shortcuts-dialog" data-ssr="false" data-attempted-ssr="false" > <script type="application/json" data-target="react-partial.embeddedData">{"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}</script> <div data-target="react-partial.reactRoot"></div> </react-partial> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_github_remote-form_dist_index_js-node_modules_delegated-events_dist_inde-94fd67-4898d1bf4b51.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/sessions-730dca81d0a2.js"></script> <header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark> <h2 class="sr-only">Navigation Menu</h2> <button type="button" class="HeaderMktg-backdrop d-lg-none border-0 position-fixed top-0 left-0 width-full height-full js-details-target" aria-label="Toggle navigation"> <span class="d-none">Toggle navigation</span> </button> <div class="d-flex flex-column flex-lg-row flex-items-center px-3 px-md-4 px-lg-5 height-full position-relative z-1"> <div class="d-flex flex-justify-between flex-items-center width-full width-lg-auto"> <div class="flex-1"> <button aria-label="Toggle navigation" aria-expanded="false" type="button" data-view-component="true" class="js-details-target js-nav-padding-recalculate js-header-menu-toggle Button--link Button--medium Button d-lg-none color-fg-inherit p-1"> <span class="Button-content"> <span class="Button-label"><div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div> <div class="HeaderMenu-toggle-bar rounded my-1"></div></span> </span> </button> </div> <a class="mr-lg-3 color-fg-inherit flex-order-2 js-prevent-focus-on-mobile-nav" href="/" aria-label="Homepage" data-analytics-event="{&quot;category&quot;:&quot;Marketing nav&quot;,&quot;action&quot;:&quot;click to go to homepage&quot;,&quot;label&quot;:&quot;ref_page:Marketing;ref_cta:Logomark;ref_loc:Header&quot;}"> <svg height="32" aria-hidden="true" viewBox="0 0 24 24" version="1.1" width="32" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> </a> <div class="flex-1 flex-order-2 text-right"> <a href="/login?return_to=https%3A%2F%2Fgithub.com%2Fnlohmann%2Fjson" class="HeaderMenu-link HeaderMenu-button d-inline-flex d-lg-none flex-order-1 f5 no-underline border color-border-default rounded-2 px-2 py-1 color-fg-inherit js-prevent-focus-on-mobile-nav" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/nlohmann/json&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="4a37c1ab851072e027d147dc955e44c325f34ee84b2e146c38ac5427d2913385" data-analytics-event="{&quot;category&quot;:&quot;Marketing nav&quot;,&quot;action&quot;:&quot;click to Sign in&quot;,&quot;label&quot;:&quot;ref_page:Marketing;ref_cta:Sign in;ref_loc:Header&quot;}" > Sign in </a> </div> </div> <div class="HeaderMenu js-header-menu height-fit position-lg-relative d-lg-flex flex-column flex-auto top-0"> <div class="HeaderMenu-wrapper d-flex flex-column flex-self-start flex-lg-row flex-auto rounded rounded-lg-0"> <nav class="HeaderMenu-nav" aria-label="Global"> <ul class="d-lg-flex list-style-none"> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Product <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_copilot&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_copilot_link_product_navbar&quot;}" href="https://github.com/features/copilot"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M23.922 16.992c-.861 1.495-5.859 5.023-11.922 5.023-6.063 0-11.061-3.528-11.922-5.023A.641.641 0 0 1 0 16.736v-2.869a.841.841 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952 1.399-1.136 3.392-2.093 6.122-2.093 2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.832.832 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256ZM12.172 11h-.344a4.323 4.323 0 0 1-.355.508C10.703 12.455 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a2.005 2.005 0 0 1-.085-.104L4 11.741v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.016.016Zm.641-2.935c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"></path><path d="M14.5 14.25a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Zm-5 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Z"></path> </svg> <div> <div class="color-fg-default h4">GitHub Copilot</div> Write better code with AI </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;security&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;security_link_product_navbar&quot;}" href="https://github.com/features/security"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">Security</div> Find and fix vulnerabilities </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;actions&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;actions_link_product_navbar&quot;}" href="https://github.com/features/actions"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-workflow color-fg-subtle mr-3"> <path d="M1 3a2 2 0 0 1 2-2h6.5a2 2 0 0 1 2 2v6.5a2 2 0 0 1-2 2H7v4.063C7 16.355 7.644 17 8.438 17H12.5v-2.5a2 2 0 0 1 2-2H21a2 2 0 0 1 2 2V21a2 2 0 0 1-2 2h-6.5a2 2 0 0 1-2-2v-2.5H8.437A2.939 2.939 0 0 1 5.5 15.562V11.5H3a2 2 0 0 1-2-2Zm2-.5a.5.5 0 0 0-.5.5v6.5a.5.5 0 0 0 .5.5h6.5a.5.5 0 0 0 .5-.5V3a.5.5 0 0 0-.5-.5ZM14.5 14a.5.5 0 0 0-.5.5V21a.5.5 0 0 0 .5.5H21a.5.5 0 0 0 .5-.5v-6.5a.5.5 0 0 0-.5-.5Z"></path> </svg> <div> <div class="color-fg-default h4">Actions</div> Automate any workflow </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;codespaces&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;codespaces_link_product_navbar&quot;}" href="https://github.com/features/codespaces"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-codespaces color-fg-subtle mr-3"> <path d="M3.5 3.75C3.5 2.784 4.284 2 5.25 2h13.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 18.75 13H5.25a1.75 1.75 0 0 1-1.75-1.75Zm-2 12c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v4a1.75 1.75 0 0 1-1.75 1.75H3.25a1.75 1.75 0 0 1-1.75-1.75ZM5.25 3.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h13.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Zm-2 12a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h17.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25Z"></path><path d="M10 17.75a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> <div> <div class="color-fg-default h4">Codespaces</div> Instant dev environments </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;issues&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;issues_link_product_navbar&quot;}" href="https://github.com/features/issues"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-issue-opened color-fg-subtle mr-3"> <path d="M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1ZM2.5 12a9.5 9.5 0 0 0 9.5 9.5 9.5 9.5 0 0 0 9.5-9.5A9.5 9.5 0 0 0 12 2.5 9.5 9.5 0 0 0 2.5 12Zm9.5 2a2 2 0 1 1-.001-3.999A2 2 0 0 1 12 14Z"></path> </svg> <div> <div class="color-fg-default h4">Issues</div> Plan and track work </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;code_review&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;code_review_link_product_navbar&quot;}" href="https://github.com/features/code-review"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-review color-fg-subtle mr-3"> <path d="M10.3 6.74a.75.75 0 0 1-.04 1.06l-2.908 2.7 2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M1.5 4.25c0-.966.784-1.75 1.75-1.75h17.5c.966 0 1.75.784 1.75 1.75v12.5a1.75 1.75 0 0 1-1.75 1.75h-9.69l-3.573 3.573A1.458 1.458 0 0 1 5 21.043V18.5H3.25a1.75 1.75 0 0 1-1.75-1.75ZM3.25 4a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h2.5a.75.75 0 0 1 .75.75v3.19l3.72-3.72a.749.749 0 0 1 .53-.22h10a.25.25 0 0 0 .25-.25V4.25a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code Review</div> Manage code changes </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;discussions&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;discussions_link_product_navbar&quot;}" href="https://github.com/features/discussions"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Discussions</div> Collaborate outside of code </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;code_search&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;code_search_link_product_navbar&quot;}" href="https://github.com/features/code-search"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-code-square color-fg-subtle mr-3"> <path d="M10.3 8.24a.75.75 0 0 1-.04 1.06L7.352 12l2.908 2.7a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 0 1 1.06.04Zm3.44 1.06a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.908-2.7-2.908-2.7Z"></path><path d="M2 3.75C2 2.784 2.784 2 3.75 2h16.5c.966 0 1.75.784 1.75 1.75v16.5A1.75 1.75 0 0 1 20.25 22H3.75A1.75 1.75 0 0 1 2 20.25Zm1.75-.25a.25.25 0 0 0-.25.25v16.5c0 .138.112.25.25.25h16.5a.25.25 0 0 0 .25-.25V3.75a.25.25 0 0 0-.25-.25Z"></path> </svg> <div> <div class="color-fg-default h4">Code Search</div> Find more, search less </div> </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="product-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="product-explore-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;all_features&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;all_features_link_product_navbar&quot;}" href="https://github.com/features"> All features </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;documentation&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;documentation_link_product_navbar&quot;}" href="https://docs.github.com"> Documentation <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_skills&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_skills_link_product_navbar&quot;}" href="https://skills.github.com"> GitHub Skills <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;blog&quot;,&quot;context&quot;:&quot;product&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;blog_link_product_navbar&quot;}" href="https://github.blog"> Blog <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Solutions <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 pb-lg-3 mb-3 mb-lg-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-company-size-heading">By company size</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-company-size-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;enterprises&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;enterprises_link_solutions_navbar&quot;}" href="https://github.com/enterprise"> Enterprises </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;small_and_medium_teams&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;small_and_medium_teams_link_solutions_navbar&quot;}" href="https://github.com/team"> Small and medium teams </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;startups&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;startups_link_solutions_navbar&quot;}" href="https://github.com/enterprise/startups"> Startups </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;nonprofits&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;nonprofits_link_solutions_navbar&quot;}" href="/solutions/industry/nonprofits"> Nonprofits </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-use-case-heading">By use case</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-use-case-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;devsecops&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;devsecops_link_solutions_navbar&quot;}" href="/solutions/use-case/devsecops"> DevSecOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;devops&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;devops_link_solutions_navbar&quot;}" href="/solutions/use-case/devops"> DevOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;ci_cd&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;ci_cd_link_solutions_navbar&quot;}" href="/solutions/use-case/ci-cd"> CI/CD </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;view_all_use_cases&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;view_all_use_cases_link_solutions_navbar&quot;}" href="/solutions/use-case"> View all use cases </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="solutions-by-industry-heading">By industry</span> <ul class="list-style-none f5" aria-labelledby="solutions-by-industry-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;healthcare&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;healthcare_link_solutions_navbar&quot;}" href="/solutions/industry/healthcare"> Healthcare </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;financial_services&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;financial_services_link_solutions_navbar&quot;}" href="/solutions/industry/financial-services"> Financial services </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;manufacturing&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;manufacturing_link_solutions_navbar&quot;}" href="/solutions/industry/manufacturing"> Manufacturing </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;government&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;government_link_solutions_navbar&quot;}" href="/solutions/industry/government"> Government </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;view_all_industries&quot;,&quot;context&quot;:&quot;solutions&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;view_all_industries_link_solutions_navbar&quot;}" href="/solutions/industry"> View all industries </a></li> </ul> </div> </div> <div class="HeaderMenu-trailing-link rounded-bottom-2 flex-shrink-0 mt-lg-4 px-lg-4 py-4 py-lg-3 f5 text-semibold"> <a href="/solutions"> View all solutions <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-right HeaderMenu-trailing-link-icon"> <path d="M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z"></path> </svg> </a> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Resources <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 d-lg-flex flex-wrap dropdown-menu-wide"> <div class="HeaderMenu-column px-lg-4 border-lg-right mb-4 mb-lg-0 pr-lg-7"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="resources-topics-heading">Topics</span> <ul class="list-style-none f5" aria-labelledby="resources-topics-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;ai&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;ai_link_resources_navbar&quot;}" href="/resources/articles/ai"> AI </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;devops&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;devops_link_resources_navbar&quot;}" href="/resources/articles/devops"> DevOps </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;security&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;security_link_resources_navbar&quot;}" href="/resources/articles/security"> Security </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;software_development&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;software_development_link_resources_navbar&quot;}" href="/resources/articles/software-development"> Software Development </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;view_all&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;view_all_link_resources_navbar&quot;}" href="/resources/articles"> View all </a></li> </ul> </div> </div> <div class="HeaderMenu-column px-lg-4"> <div class="border-bottom pb-3 pb-lg-0 border-lg-bottom-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="resources-explore-heading">Explore</span> <ul class="list-style-none f5" aria-labelledby="resources-explore-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;learning_pathways&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;learning_pathways_link_resources_navbar&quot;}" href="https://resources.github.com/learn/pathways"> Learning Pathways <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;events_amp_webinars&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;events_amp_webinars_link_resources_navbar&quot;}" href="https://resources.github.com"> Events &amp; Webinars <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;ebooks_amp_whitepapers&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;ebooks_amp_whitepapers_link_resources_navbar&quot;}" href="https://github.com/resources/whitepapers"> Ebooks &amp; Whitepapers </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;customer_stories&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;customer_stories_link_resources_navbar&quot;}" href="https://github.com/customer-stories"> Customer Stories </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary Link--external" target="_blank" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;partners&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;partners_link_resources_navbar&quot;}" href="https://partner.github.com"> Partners <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link-external HeaderMenu-external-icon color-fg-subtle"> <path d="M3.75 2h3.5a.75.75 0 0 1 0 1.5h-3.5a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-3.5a.75.75 0 0 1 1.5 0v3.5A1.75 1.75 0 0 1 12.25 14h-8.5A1.75 1.75 0 0 1 2 12.25v-8.5C2 2.784 2.784 2 3.75 2Zm6.854-1h4.146a.25.25 0 0 1 .25.25v4.146a.25.25 0 0 1-.427.177L13.03 4.03 9.28 7.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.75-3.75-1.543-1.543A.25.25 0 0 1 10.604 1Z"></path> </svg> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;executive_insights&quot;,&quot;context&quot;:&quot;resources&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;executive_insights_link_resources_navbar&quot;}" href="https://github.com/solutions/executive-insights"> Executive Insights </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Open Source <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 px-lg-4"> <div class="HeaderMenu-column"> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;github_sponsors&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;github_sponsors_link_open_source_navbar&quot;}" href="/sponsors"> <div> <div class="color-fg-default h4">GitHub Sponsors</div> Fund open source developers </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;the_readme_project&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;the_readme_project_link_open_source_navbar&quot;}" href="https://github.com/readme"> <div> <div class="color-fg-default h4">The ReadME Project</div> GitHub community articles </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="open-source-repositories-heading">Repositories</span> <ul class="list-style-none f5" aria-labelledby="open-source-repositories-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;topics&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;topics_link_open_source_navbar&quot;}" href="https://github.com/topics"> Topics </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;trending&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;trending_link_open_source_navbar&quot;}" href="https://github.com/trending"> Trending </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;collections&quot;,&quot;context&quot;:&quot;open_source&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;collections_link_open_source_navbar&quot;}" href="https://github.com/collections"> Collections </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <button type="button" class="HeaderMenu-link border-0 width-full width-lg-auto px-0 px-lg-2 py-lg-2 no-wrap d-flex flex-items-center flex-justify-between js-details-target" aria-expanded="false"> Enterprise <svg opacity="0.5" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-chevron-down HeaderMenu-icon ml-1"> <path d="M12.78 5.22a.749.749 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.06 0L3.22 6.28a.749.749 0 1 1 1.06-1.06L8 8.939l3.72-3.719a.749.749 0 0 1 1.06 0Z"></path> </svg> </button> <div class="HeaderMenu-dropdown dropdown-menu rounded m-0 p-0 pt-2 pt-lg-4 position-relative position-lg-absolute left-0 left-lg-n3 pb-2 pb-lg-4 px-lg-4"> <div class="HeaderMenu-column"> <div class="border-bottom pb-3 pb-lg-0 pb-lg-3 mb-3 mb-lg-0 mb-lg-3"> <ul class="list-style-none f5" > <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;enterprise_platform&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;enterprise_platform_link_enterprise_navbar&quot;}" href="/enterprise"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-stack color-fg-subtle mr-3"> <path d="M11.063 1.456a1.749 1.749 0 0 1 1.874 0l8.383 5.316a1.751 1.751 0 0 1 0 2.956l-8.383 5.316a1.749 1.749 0 0 1-1.874 0L2.68 9.728a1.751 1.751 0 0 1 0-2.956Zm1.071 1.267a.25.25 0 0 0-.268 0L3.483 8.039a.25.25 0 0 0 0 .422l8.383 5.316a.25.25 0 0 0 .268 0l8.383-5.316a.25.25 0 0 0 0-.422Z"></path><path d="M1.867 12.324a.75.75 0 0 1 1.035-.232l8.964 5.685a.25.25 0 0 0 .268 0l8.964-5.685a.75.75 0 0 1 .804 1.267l-8.965 5.685a1.749 1.749 0 0 1-1.874 0l-8.965-5.685a.75.75 0 0 1-.231-1.035Z"></path><path d="M1.867 16.324a.75.75 0 0 1 1.035-.232l8.964 5.685a.25.25 0 0 0 .268 0l8.964-5.685a.75.75 0 0 1 .804 1.267l-8.965 5.685a1.749 1.749 0 0 1-1.874 0l-8.965-5.685a.75.75 0 0 1-.231-1.035Z"></path> </svg> <div> <div class="color-fg-default h4">Enterprise platform</div> AI-powered developer platform </div> </a></li> </ul> </div> <div class="border-bottom pb-3 pb-lg-0 border-bottom-0"> <span class="d-block h4 color-fg-default my-1" id="enterprise-available-add-ons-heading">Available add-ons</span> <ul class="list-style-none f5" aria-labelledby="enterprise-available-add-ons-heading"> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;advanced_security&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;advanced_security_link_enterprise_navbar&quot;}" href="https://github.com/enterprise/advanced-security"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-shield-check color-fg-subtle mr-3"> <path d="M16.53 9.78a.75.75 0 0 0-1.06-1.06L11 13.19l-1.97-1.97a.75.75 0 0 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5-5Z"></path><path d="m12.54.637 8.25 2.675A1.75 1.75 0 0 1 22 4.976V10c0 6.19-3.771 10.704-9.401 12.83a1.704 1.704 0 0 1-1.198 0C5.77 20.705 2 16.19 2 10V4.976c0-.758.489-1.43 1.21-1.664L11.46.637a1.748 1.748 0 0 1 1.08 0Zm-.617 1.426-8.25 2.676a.249.249 0 0 0-.173.237V10c0 5.46 3.28 9.483 8.43 11.426a.199.199 0 0 0 .14 0C17.22 19.483 20.5 15.461 20.5 10V4.976a.25.25 0 0 0-.173-.237l-8.25-2.676a.253.253 0 0 0-.154 0Z"></path> </svg> <div> <div class="color-fg-default h4">Advanced Security</div> Enterprise-grade security features </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description pb-lg-3" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;copilot_for_business&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;copilot_for_business_link_enterprise_navbar&quot;}" href="/features/copilot/copilot-business"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-copilot color-fg-subtle mr-3"> <path d="M23.922 16.992c-.861 1.495-5.859 5.023-11.922 5.023-6.063 0-11.061-3.528-11.922-5.023A.641.641 0 0 1 0 16.736v-2.869a.841.841 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.195 10.195 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952 1.399-1.136 3.392-2.093 6.122-2.093 2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.832.832 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256ZM12.172 11h-.344a4.323 4.323 0 0 1-.355.508C10.703 12.455 9.555 13 7.965 13c-1.725 0-2.989-.359-3.782-1.259a2.005 2.005 0 0 1-.085-.104L4 11.741v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.323 4.323 0 0 1-.355-.508h-.016.016Zm.641-2.935c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"></path><path d="M14.5 14.25a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Zm-5 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0v-2a1 1 0 0 1 1-1Z"></path> </svg> <div> <div class="color-fg-default h4">Copilot for business</div> Enterprise-grade AI features </div> </a></li> <li> <a class="HeaderMenu-dropdown-link d-block no-underline position-relative py-2 Link--secondary d-flex flex-items-center Link--has-description" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;premium_support&quot;,&quot;context&quot;:&quot;enterprise&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;premium_support_link_enterprise_navbar&quot;}" href="/premium-support"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-comment-discussion color-fg-subtle mr-3"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 14.25 14H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 15.543V14H1.75A1.75 1.75 0 0 1 0 12.25v-9.5C0 1.784.784 1 1.75 1ZM1.5 2.75v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z"></path><path d="M22.5 8.75a.25.25 0 0 0-.25-.25h-3.5a.75.75 0 0 1 0-1.5h3.5c.966 0 1.75.784 1.75 1.75v9.5A1.75 1.75 0 0 1 22.25 20H21v1.543a1.457 1.457 0 0 1-2.487 1.03L15.939 20H10.75A1.75 1.75 0 0 1 9 18.25v-1.465a.75.75 0 0 1 1.5 0v1.465c0 .138.112.25.25.25h5.5a.75.75 0 0 1 .53.22l2.72 2.72v-2.19a.75.75 0 0 1 .75-.75h2a.25.25 0 0 0 .25-.25v-9.5Z"></path> </svg> <div> <div class="color-fg-default h4">Premium Support</div> Enterprise-grade 24/7 support </div> </a></li> </ul> </div> </div> </div> </li> <li class="HeaderMenu-item position-relative flex-wrap flex-justify-between flex-items-center d-block d-lg-flex flex-lg-nowrap flex-lg-items-center js-details-container js-header-menu-item"> <a class="HeaderMenu-link no-underline px-0 px-lg-2 py-3 py-lg-2 d-block d-lg-inline-block" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;pricing&quot;,&quot;context&quot;:&quot;global&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;pricing_link_global_navbar&quot;}" href="https://github.com/pricing">Pricing</a> </li> </ul> </nav> <div class="d-flex flex-column flex-lg-row width-full flex-justify-end flex-lg-items-center text-center mt-3 mt-lg-0 text-lg-left ml-lg-3"> <qbsearch-input class="search-input" data-scope="repo:nlohmann/json" data-custom-scopes-path="/search/custom_scopes" data-delete-custom-scopes-csrf="FJGspmhagC3edaKXMwULHTMmI6aEPv3iVAiawCAC58RcmBrRElMIPH-_AIU9C5qraQ7sx5kMP1olUrsaxx1Mfg" data-max-custom-scopes="10" data-header-redesign-enabled="false" data-initial-value="" data-blackbird-suggestions-path="/search/suggestions" data-jump-to-suggestions-path="/_graphql/GetSuggestedNavigationDestinations" data-current-repository="nlohmann/json" data-current-org="" data-current-owner="nlohmann" data-logged-in="false" data-copilot-chat-enabled="false" data-nl-search-enabled="false" data-retain-scroll-position="true"> <div class="search-input-container search-with-dialog position-relative d-flex flex-row flex-items-center mr-4 rounded" data-action="click:qbsearch-input#searchInputContainerClicked" > <button type="button" class="header-search-button placeholder input-button form-control d-flex flex-1 flex-self-stretch flex-items-center no-wrap width-full py-0 pl-2 pr-0 text-left border-0 box-shadow-none" data-target="qbsearch-input.inputButton" aria-label="Search or jump to…" aria-haspopup="dialog" placeholder="Search or jump to..." data-hotkey=s,/ autocapitalize="off" data-analytics-event="{&quot;location&quot;:&quot;navbar&quot;,&quot;action&quot;:&quot;searchbar&quot;,&quot;context&quot;:&quot;global&quot;,&quot;tag&quot;:&quot;input&quot;,&quot;label&quot;:&quot;searchbar_input_global_navbar&quot;}" data-action="click:qbsearch-input#handleExpand" > <div class="mr-2 color-fg-muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </div> <span class="flex-1" data-target="qbsearch-input.inputButtonText">Search or jump to...</span> <div class="d-flex" data-target="qbsearch-input.hotkeyIndicator"> <svg xmlns="http://www.w3.org/2000/svg" width="22" height="20" aria-hidden="true" class="mr-1"><path fill="none" stroke="#979A9C" opacity=".4" d="M3.5.5h12c1.7 0 3 1.3 3 3v13c0 1.7-1.3 3-3 3h-12c-1.7 0-3-1.3-3-3v-13c0-1.7 1.3-3 3-3z"></path><path fill="#979A9C" d="M11.8 6L8 15.1h-.9L10.8 6h1z"></path></svg> </div> </button> <input type="hidden" name="type" class="js-site-search-type-field"> <div class="Overlay--hidden " data-modal-dialog-overlay> <modal-dialog data-action="close:qbsearch-input#handleClose cancel:qbsearch-input#handleClose" data-target="qbsearch-input.searchSuggestionsDialog" role="dialog" id="search-suggestions-dialog" aria-modal="true" aria-labelledby="search-suggestions-dialog-header" data-view-component="true" class="Overlay Overlay--width-large Overlay--height-auto"> <h1 id="search-suggestions-dialog-header" class="sr-only">Search code, repositories, users, issues, pull requests...</h1> <div class="Overlay-body Overlay-body--paddingNone"> <div data-view-component="true"> <div class="search-suggestions position-fixed width-full color-shadow-large border color-fg-default color-bg-default overflow-hidden d-flex flex-column query-builder-container" style="border-radius: 12px;" data-target="qbsearch-input.queryBuilderContainer" hidden > <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="query-builder-test-form" action="" accept-charset="UTF-8" method="get"> <query-builder data-target="qbsearch-input.queryBuilder" id="query-builder-query-builder-test" data-filter-key=":" data-view-component="true" class="QueryBuilder search-query-builder"> <div class="FormControl FormControl--fullWidth"> <label id="query-builder-test-label" for="query-builder-test" class="FormControl-label sr-only"> Search </label> <div class="QueryBuilder-StyledInput width-fit " data-target="query-builder.styledInput" > <span id="query-builder-test-leadingvisual-wrap" class="FormControl-input-leadingVisualWrap QueryBuilder-leadingVisualWrap"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search FormControl-input-leadingVisual"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </span> <div data-target="query-builder.styledInputContainer" class="QueryBuilder-StyledInputContainer"> <div aria-hidden="true" class="QueryBuilder-StyledInputContent" data-target="query-builder.styledInputContent" ></div> <div class="QueryBuilder-InputWrapper"> <div aria-hidden="true" class="QueryBuilder-Sizer" data-target="query-builder.sizer"></div> <input id="query-builder-test" name="query-builder-test" value="" autocomplete="off" type="text" role="combobox" spellcheck="false" aria-expanded="false" aria-describedby="validation-dea6297f-ea97-444e-9ffc-0efbe5df0231" data-target="query-builder.input" data-action=" input:query-builder#inputChange blur:query-builder#inputBlur keydown:query-builder#inputKeydown focus:query-builder#inputFocus " data-view-component="true" class="FormControl-input QueryBuilder-Input FormControl-medium" /> </div> </div> <span class="sr-only" id="query-builder-test-clear">Clear</span> <button role="button" id="query-builder-test-clear-button" aria-labelledby="query-builder-test-clear query-builder-test-label" data-target="query-builder.clearButton" data-action=" click:query-builder#clear focus:query-builder#clearButtonFocus blur:query-builder#clearButtonBlur " variant="small" hidden="hidden" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium mr-1 px-2 py-0 d-flex flex-items-center rounded-1 color-fg-muted"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x-circle-fill Button-visual"> <path d="M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"></path> </svg> </button> </div> <template id="search-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-search"> <path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path> </svg> </template> <template id="code-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </template> <template id="file-code-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-code"> <path d="M4 1.75C4 .784 4.784 0 5.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v8.586A1.75 1.75 0 0 1 14.25 15h-9a.75.75 0 0 1 0-1.5h9a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 10 4.25V1.5H5.75a.25.25 0 0 0-.25.25v2.5a.75.75 0 0 1-1.5 0Zm1.72 4.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.47-1.47-1.47-1.47a.75.75 0 0 1 0-1.06ZM3.28 7.78 1.81 9.25l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Zm8.22-6.218V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path> </svg> </template> <template id="history-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history"> <path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path> </svg> </template> <template id="repo-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> </template> <template id="bookmark-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bookmark"> <path d="M3 2.75C3 1.784 3.784 1 4.75 1h6.5c.966 0 1.75.784 1.75 1.75v11.5a.75.75 0 0 1-1.227.579L8 11.722l-3.773 3.107A.751.751 0 0 1 3 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.91l3.023-2.489a.75.75 0 0 1 .954 0l3.023 2.49V2.75a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="plus-circle-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-plus-circle"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm7.25-3.25v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5a.75.75 0 0 1 1.5 0Z"></path> </svg> </template> <template id="circle-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> </template> <template id="trash-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-trash"> <path d="M11 1.75V3h2.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H5V1.75C5 .784 5.784 0 6.75 0h2.5C10.216 0 11 .784 11 1.75ZM4.496 6.675l.66 6.6a.25.25 0 0 0 .249.225h5.19a.25.25 0 0 0 .249-.225l.66-6.6a.75.75 0 0 1 1.492.149l-.66 6.6A1.748 1.748 0 0 1 10.595 15h-5.19a1.75 1.75 0 0 1-1.741-1.575l-.66-6.6a.75.75 0 1 1 1.492-.15ZM6.5 1.75V3h3V1.75a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25Z"></path> </svg> </template> <template id="team-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-people"> <path d="M2 5.5a3.5 3.5 0 1 1 5.898 2.549 5.508 5.508 0 0 1 3.034 4.084.75.75 0 1 1-1.482.235 4 4 0 0 0-7.9 0 .75.75 0 0 1-1.482-.236A5.507 5.507 0 0 1 3.102 8.05 3.493 3.493 0 0 1 2 5.5ZM11 4a3.001 3.001 0 0 1 2.22 5.018 5.01 5.01 0 0 1 2.56 3.012.749.749 0 0 1-.885.954.752.752 0 0 1-.549-.514 3.507 3.507 0 0 0-2.522-2.372.75.75 0 0 1-.574-.73v-.352a.75.75 0 0 1 .416-.672A1.5 1.5 0 0 0 11 5.5.75.75 0 0 1 11 4Zm-5.5-.5a2 2 0 1 0-.001 3.999A2 2 0 0 0 5.5 3.5Z"></path> </svg> </template> <template id="project-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-project"> <path d="M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25ZM11.75 3a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0v-7.5a.75.75 0 0 1 .75-.75Zm-8.25.75a.75.75 0 0 1 1.5 0v5.5a.75.75 0 0 1-1.5 0ZM8 3a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 3Z"></path> </svg> </template> <template id="pencil-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pencil"> <path d="M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"></path> </svg> </template> <template id="copilot-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copilot"> <path d="M7.998 15.035c-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.201-.508-.254-1.084-.254-1.656 0-.87.128-1.769.693-2.484.579-.733 1.494-1.124 2.724-1.261 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095v1.872c0 .766-3.351 3.795-8.002 3.795Zm0-1.485c2.28 0 4.584-1.11 5.002-1.433V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.059-.327-2.71-.991A3.222 3.222 0 0 1 8 6.303a3.24 3.24 0 0 1-.544.743c-.65.664-1.563.991-2.71.991-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433ZM6.762 2.83c-.193-.206-.637-.413-1.682-.297-1.019.113-1.479.404-1.713.7-.247.312-.369.789-.369 1.554 0 .793.129 1.171.308 1.371.162.181.519.379 1.442.379.853 0 1.339-.235 1.638-.54.315-.322.527-.827.617-1.553.117-.935-.037-1.395-.241-1.614Zm4.155-.297c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Z"></path><path d="M6.25 9.037a.75.75 0 0 1 .75.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 .75-.75Zm4.25.75v1.501a.75.75 0 0 1-1.5 0V9.787a.75.75 0 0 1 1.5 0Z"></path> </svg> </template> <template id="copilot-error-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copilot-error"> <path d="M16 11.24c0 .112-.072.274-.21.467L13 9.688V7.862l-.023-.116c-.49.21-1.075.291-1.727.291-.198 0-.388-.009-.571-.029L6.833 5.226a4.01 4.01 0 0 0 .17-.782c.117-.935-.037-1.395-.241-1.614-.193-.206-.637-.413-1.682-.297-.683.076-1.115.231-1.395.415l-1.257-.91c.579-.564 1.413-.877 2.485-.996 1.206-.134 2.262.034 2.944.765.05.053.096.108.139.165.044-.057.094-.112.143-.165.682-.731 1.738-.899 2.944-.765 1.23.137 2.145.528 2.724 1.261.566.715.693 1.614.693 2.484 0 .572-.053 1.148-.254 1.656.066.228.098.429.126.612.012.076.024.148.037.218.924.385 1.522 1.471 1.591 2.095Zm-5.083-8.707c-1.044-.116-1.488.091-1.681.297-.204.219-.359.679-.242 1.614.091.726.303 1.231.618 1.553.299.305.784.54 1.638.54.922 0 1.28-.198 1.442-.379.179-.2.308-.578.308-1.371 0-.765-.123-1.242-.37-1.554-.233-.296-.693-.587-1.713-.7Zm2.511 11.074c-1.393.776-3.272 1.428-5.43 1.428-4.562 0-7.873-2.914-7.998-3.749V9.338c.085-.628.677-1.686 1.588-2.065.013-.07.024-.143.036-.218.029-.183.06-.384.126-.612-.18-.455-.241-.963-.252-1.475L.31 4.107A.747.747 0 0 1 0 3.509V3.49a.748.748 0 0 1 .625-.73c.156-.026.306.047.435.139l14.667 10.578a.592.592 0 0 1 .227.264.752.752 0 0 1 .046.249v.022a.75.75 0 0 1-1.19.596Zm-1.367-.991L5.635 7.964a5.128 5.128 0 0 1-.889.073c-.652 0-1.236-.081-1.727-.291l-.023.116v4.255c.419.323 2.722 1.433 5.002 1.433 1.539 0 3.089-.505 4.063-.934Z"></path> </svg> </template> <template id="workflow-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-workflow"> <path d="M0 1.75C0 .784.784 0 1.75 0h3.5C6.216 0 7 .784 7 1.75v3.5A1.75 1.75 0 0 1 5.25 7H4v4a1 1 0 0 0 1 1h4v-1.25C9 9.784 9.784 9 10.75 9h3.5c.966 0 1.75.784 1.75 1.75v3.5A1.75 1.75 0 0 1 14.25 16h-3.5A1.75 1.75 0 0 1 9 14.25v-.75H5A2.5 2.5 0 0 1 2.5 11V7h-.75A1.75 1.75 0 0 1 0 5.25Zm1.75-.25a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Zm9 9a.25.25 0 0 0-.25.25v3.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-3.5a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="book-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> </template> <template id="code-review-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-review"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 13H8.061l-2.574 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25v-8.5C0 1.784.784 1 1.75 1ZM1.5 2.75v8.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm5.28 1.72a.75.75 0 0 1 0 1.06L5.31 7l1.47 1.47a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-2-2a.75.75 0 0 1 0-1.06l2-2a.75.75 0 0 1 1.06 0Zm2.44 0a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L10.69 7 9.22 5.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </template> <template id="codespaces-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-codespaces"> <path d="M0 11.25c0-.966.784-1.75 1.75-1.75h12.5c.966 0 1.75.784 1.75 1.75v3A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm2-9.5C2 .784 2.784 0 3.75 0h8.5C13.216 0 14 .784 14 1.75v5a1.75 1.75 0 0 1-1.75 1.75h-8.5A1.75 1.75 0 0 1 2 6.75Zm1.75-.25a.25.25 0 0 0-.25.25v5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5a.25.25 0 0 0-.25-.25Zm-2 9.5a.25.25 0 0 0-.25.25v3c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-3a.25.25 0 0 0-.25-.25Z"></path><path d="M7 12.75a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1-.75-.75Zm-4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1-.75-.75Z"></path> </svg> </template> <template id="comment-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment"> <path d="M1 2.75C1 1.784 1.784 1 2.75 1h10.5c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 13.25 12H9.06l-2.573 2.573A1.458 1.458 0 0 1 4 13.543V12H2.75A1.75 1.75 0 0 1 1 10.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h4.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> </template> <template id="comment-discussion-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment-discussion"> <path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path> </svg> </template> <template id="organization-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-organization"> <path d="M1.75 16A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0h8.5C11.216 0 12 .784 12 1.75v12.5c0 .085-.006.168-.018.25h2.268a.25.25 0 0 0 .25-.25V8.285a.25.25 0 0 0-.111-.208l-1.055-.703a.749.749 0 1 1 .832-1.248l1.055.703c.487.325.779.871.779 1.456v5.965A1.75 1.75 0 0 1 14.25 16h-3.5a.766.766 0 0 1-.197-.026c-.099.017-.2.026-.303.026h-3a.75.75 0 0 1-.75-.75V14h-1v1.25a.75.75 0 0 1-.75.75Zm-.25-1.75c0 .138.112.25.25.25H4v-1.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 .75.75v1.25h2.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM3.75 6h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 3.75A.75.75 0 0 1 3.75 3h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 3.75Zm4 3A.75.75 0 0 1 7.75 6h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 7 6.75ZM7.75 3h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 9.75A.75.75 0 0 1 3.75 9h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 9.75ZM7.75 9h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path> </svg> </template> <template id="rocket-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-rocket"> <path d="M14.064 0h.186C15.216 0 16 .784 16 1.75v.186a8.752 8.752 0 0 1-2.564 6.186l-.458.459c-.314.314-.641.616-.979.904v3.207c0 .608-.315 1.172-.833 1.49l-2.774 1.707a.749.749 0 0 1-1.11-.418l-.954-3.102a1.214 1.214 0 0 1-.145-.125L3.754 9.816a1.218 1.218 0 0 1-.124-.145L.528 8.717a.749.749 0 0 1-.418-1.11l1.71-2.774A1.748 1.748 0 0 1 3.31 4h3.204c.288-.338.59-.665.904-.979l.459-.458A8.749 8.749 0 0 1 14.064 0ZM8.938 3.623h-.002l-.458.458c-.76.76-1.437 1.598-2.02 2.5l-1.5 2.317 2.143 2.143 2.317-1.5c.902-.583 1.74-1.26 2.499-2.02l.459-.458a7.25 7.25 0 0 0 2.123-5.127V1.75a.25.25 0 0 0-.25-.25h-.186a7.249 7.249 0 0 0-5.125 2.123ZM3.56 14.56c-.732.732-2.334 1.045-3.005 1.148a.234.234 0 0 1-.201-.064.234.234 0 0 1-.064-.201c.103-.671.416-2.273 1.15-3.003a1.502 1.502 0 1 1 2.12 2.12Zm6.94-3.935c-.088.06-.177.118-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 0 0 .119-.213ZM3.678 8.116 5.2 5.766c.058-.09.117-.178.176-.266H3.309a.25.25 0 0 0-.213.119l-1.2 1.95ZM12 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </template> <template id="shield-check-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield-check"> <path d="m8.533.133 5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667l5.25-1.68a1.748 1.748 0 0 1 1.066 0Zm-.61 1.429.001.001-5.25 1.68a.251.251 0 0 0-.174.237V7c0 1.36.275 2.666 1.057 3.859.784 1.194 2.121 2.342 4.366 3.298a.196.196 0 0 0 .154 0c2.245-.957 3.582-2.103 4.366-3.297C13.225 9.666 13.5 8.358 13.5 7V3.48a.25.25 0 0 0-.174-.238l-5.25-1.68a.25.25 0 0 0-.153 0ZM11.28 6.28l-3.5 3.5a.75.75 0 0 1-1.06 0l-1.5-1.5a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l.97.97 2.97-2.97a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </template> <template id="heart-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-heart"> <path d="m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z"></path> </svg> </template> <template id="server-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-server"> <path d="M1.75 1h12.5c.966 0 1.75.784 1.75 1.75v4c0 .372-.116.717-.314 1 .198.283.314.628.314 1v4a1.75 1.75 0 0 1-1.75 1.75H1.75A1.75 1.75 0 0 1 0 12.75v-4c0-.358.109-.707.314-1a1.739 1.739 0 0 1-.314-1v-4C0 1.784.784 1 1.75 1ZM1.5 2.75v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Zm.25 5.75a.25.25 0 0 0-.25.25v4c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-4a.25.25 0 0 0-.25-.25ZM7 4.75A.75.75 0 0 1 7.75 4h4.5a.75.75 0 0 1 0 1.5h-4.5A.75.75 0 0 1 7 4.75ZM7.75 10h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM3 4.75A.75.75 0 0 1 3.75 4h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 4.75ZM3.75 10h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path> </svg> </template> <template id="globe-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-globe"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM5.78 8.75a9.64 9.64 0 0 0 1.363 4.177c.255.426.542.832.857 1.215.245-.296.551-.705.857-1.215A9.64 9.64 0 0 0 10.22 8.75Zm4.44-1.5a9.64 9.64 0 0 0-1.363-4.177c-.307-.51-.612-.919-.857-1.215a9.927 9.927 0 0 0-.857 1.215A9.64 9.64 0 0 0 5.78 7.25Zm-5.944 1.5H1.543a6.507 6.507 0 0 0 4.666 5.5c-.123-.181-.24-.365-.352-.552-.715-1.192-1.437-2.874-1.581-4.948Zm-2.733-1.5h2.733c.144-2.074.866-3.756 1.58-4.948.12-.197.237-.381.353-.552a6.507 6.507 0 0 0-4.666 5.5Zm10.181 1.5c-.144 2.074-.866 3.756-1.58 4.948-.12.197-.237.381-.353.552a6.507 6.507 0 0 0 4.666-5.5Zm2.733-1.5a6.507 6.507 0 0 0-4.666-5.5c.123.181.24.365.353.552.714 1.192 1.436 2.874 1.58 4.948Z"></path> </svg> </template> <template id="issue-opened-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> </template> <template id="device-mobile-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-mobile"> <path d="M3.75 0h8.5C13.216 0 14 .784 14 1.75v12.5A1.75 1.75 0 0 1 12.25 16h-8.5A1.75 1.75 0 0 1 2 14.25V1.75C2 .784 2.784 0 3.75 0ZM3.5 1.75v12.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM8 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path> </svg> </template> <template id="package-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-package"> <path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"></path> </svg> </template> <template id="credit-card-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-credit-card"> <path d="M10.75 9a.75.75 0 0 0 0 1.5h1.5a.75.75 0 0 0 0-1.5h-1.5Z"></path><path d="M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25ZM14.5 6.5h-13v5.75c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25Zm0-2.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25V5h13Z"></path> </svg> </template> <template id="play-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> </template> <template id="gift-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-gift"> <path d="M2 2.75A2.75 2.75 0 0 1 4.75 0c.983 0 1.873.42 2.57 1.232.268.318.497.668.68 1.042.183-.375.411-.725.68-1.044C9.376.42 10.266 0 11.25 0a2.75 2.75 0 0 1 2.45 4h.55c.966 0 1.75.784 1.75 1.75v2c0 .698-.409 1.301-1 1.582v4.918A1.75 1.75 0 0 1 13.25 16H2.75A1.75 1.75 0 0 1 1 14.25V9.332C.409 9.05 0 8.448 0 7.75v-2C0 4.784.784 4 1.75 4h.55c-.192-.375-.3-.8-.3-1.25ZM7.25 9.5H2.5v4.75c0 .138.112.25.25.25h4.5Zm1.5 0v5h4.5a.25.25 0 0 0 .25-.25V9.5Zm0-4V8h5.5a.25.25 0 0 0 .25-.25v-2a.25.25 0 0 0-.25-.25Zm-7 0a.25.25 0 0 0-.25.25v2c0 .138.112.25.25.25h5.5V5.5h-5.5Zm3-4a1.25 1.25 0 0 0 0 2.5h2.309c-.233-.818-.542-1.401-.878-1.793-.43-.502-.915-.707-1.431-.707ZM8.941 4h2.309a1.25 1.25 0 0 0 0-2.5c-.516 0-1 .205-1.43.707-.337.392-.646.975-.879 1.793Z"></path> </svg> </template> <template id="code-square-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-square"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25Zm7.47 3.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L10.69 8 9.22 6.53a.75.75 0 0 1 0-1.06ZM6.78 6.53 5.31 8l1.47 1.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </template> <template id="device-desktop-icon"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-device-desktop"> <path d="M14.25 1c.966 0 1.75.784 1.75 1.75v7.5A1.75 1.75 0 0 1 14.25 12h-3.727c.099 1.041.52 1.872 1.292 2.757A.752.752 0 0 1 11.25 16h-6.5a.75.75 0 0 1-.565-1.243c.772-.885 1.192-1.716 1.292-2.757H1.75A1.75 1.75 0 0 1 0 10.25v-7.5C0 1.784.784 1 1.75 1ZM1.75 2.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25ZM9.018 12H6.982a5.72 5.72 0 0 1-.765 2.5h3.566a5.72 5.72 0 0 1-.765-2.5Z"></path> </svg> </template> <div class="position-relative"> <ul role="listbox" class="ActionListWrap QueryBuilder-ListWrap" aria-label="Suggestions" data-action=" combobox-commit:query-builder#comboboxCommit mousedown:query-builder#resultsMousedown " data-target="query-builder.resultsList" data-persist-list=false id="query-builder-test-results" ></ul> </div> <div class="FormControl-inlineValidation" id="validation-dea6297f-ea97-444e-9ffc-0efbe5df0231" hidden="hidden"> <span class="FormControl-inlineValidation--visual"> <svg aria-hidden="true" height="12" viewBox="0 0 12 12" version="1.1" width="12" data-view-component="true" class="octicon octicon-alert-fill"> <path d="M4.855.708c.5-.896 1.79-.896 2.29 0l4.675 8.351a1.312 1.312 0 0 1-1.146 1.954H1.33A1.313 1.313 0 0 1 .183 9.058ZM7 7V3H5v4Zm-1 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path> </svg> </span> <span></span> </div> </div> <div data-target="query-builder.screenReaderFeedback" aria-live="polite" aria-atomic="true" class="sr-only"></div> </query-builder></form> <div class="d-flex flex-row color-fg-muted px-3 text-small color-bg-default search-feedback-prompt"> <a target="_blank" href="https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax" data-view-component="true" class="Link color-fg-accent text-normal ml-2">Search syntax tips</a> <div class="d-flex flex-1"></div> </div> </div> </div> </div> </modal-dialog></div> </div> <div data-action="click:qbsearch-input#retract" class="dark-backdrop position-fixed" hidden data-target="qbsearch-input.darkBackdrop"></div> <div class="color-fg-default"> <dialog-helper> <dialog data-target="qbsearch-input.feedbackDialog" data-action="close:qbsearch-input#handleDialogClose cancel:qbsearch-input#handleDialogClose" id="feedback-dialog" aria-modal="true" aria-labelledby="feedback-dialog-title" aria-describedby="feedback-dialog-description" data-view-component="true" class="Overlay Overlay-whenNarrow Overlay--size-medium Overlay--motion-scaleFade Overlay--disableScroll"> <div data-view-component="true" class="Overlay-header"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 class="Overlay-title " id="feedback-dialog-title"> Provide feedback </h1> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="feedback-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </div> <scrollable-region data-labelled-by="feedback-dialog-title"> <div data-view-component="true" class="Overlay-body"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="code-search-feedback-form" data-turbo="false" action="/search/feedback" accept-charset="UTF-8" method="post"><input type="hidden" data-csrf="true" name="authenticity_token" value="Y01DgpB1dUHdujir9QkKAXNlhzcJnBFJnXhmRWdOvSe6x9pBiQPOYLryfS2wzvM6Gf8OvKMUPELSzTonu/pmXQ==" /> <p>We read every piece of feedback, and take your input very seriously.</p> <textarea name="feedback" class="form-control width-full mb-2" style="height: 120px" id="feedback"></textarea> <input name="include_email" id="include_email" aria-label="Include my email address so I can be contacted" class="form-control mr-2" type="checkbox"> <label for="include_email" style="font-weight: normal">Include my email address so I can be contacted</label> </form></div> </scrollable-region> <div data-view-component="true" class="Overlay-footer Overlay-footer--alignEnd"> <button data-close-dialog-id="feedback-dialog" type="button" data-view-component="true" class="btn"> Cancel </button> <button form="code-search-feedback-form" data-action="click:qbsearch-input#submitFeedback" type="submit" data-view-component="true" class="btn-primary btn"> Submit feedback </button> </div> </dialog></dialog-helper> <custom-scopes data-target="qbsearch-input.customScopesManager"> <dialog-helper> <dialog data-target="custom-scopes.customScopesModalDialog" data-action="close:qbsearch-input#handleDialogClose cancel:qbsearch-input#handleDialogClose" id="custom-scopes-dialog" aria-modal="true" aria-labelledby="custom-scopes-dialog-title" aria-describedby="custom-scopes-dialog-description" data-view-component="true" class="Overlay Overlay-whenNarrow Overlay--size-medium Overlay--motion-scaleFade Overlay--disableScroll"> <div data-view-component="true" class="Overlay-header Overlay-header--divided"> <div class="Overlay-headerContentWrap"> <div class="Overlay-titleWrap"> <h1 class="Overlay-title " id="custom-scopes-dialog-title"> Saved searches </h1> <h2 id="custom-scopes-dialog-description" class="Overlay-description">Use saved searches to filter your results more quickly</h2> </div> <div class="Overlay-actionWrap"> <button data-close-dialog-id="custom-scopes-dialog" aria-label="Close" type="button" data-view-component="true" class="close-button Overlay-closeButton"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg></button> </div> </div> </div> <scrollable-region data-labelled-by="custom-scopes-dialog-title"> <div data-view-component="true" class="Overlay-body"> <div data-target="custom-scopes.customScopesModalDialogFlash"></div> <div hidden class="create-custom-scope-form" data-target="custom-scopes.createCustomScopeForm"> <!-- '"` --><!-- </textarea></xmp> --></option></form><form id="custom-scopes-dialog-form" data-turbo="false" action="/search/custom_scopes" accept-charset="UTF-8" method="post"><input type="hidden" data-csrf="true" name="authenticity_token" value="m8xJHB+KEkfx7tX/+tYocXcMbadnaalMs2oD/BURhq28pew8HqjKpCj2g71CDeuSUW+sdKdnPddaFgPLr1enGw==" /> <div data-target="custom-scopes.customScopesModalDialogFlash"></div> <input type="hidden" id="custom_scope_id" name="custom_scope_id" data-target="custom-scopes.customScopesIdField"> <div class="form-group"> <label for="custom_scope_name">Name</label> <auto-check src="/search/custom_scopes/check_name" required only-validate-on-blur="false"> <input type="text" name="custom_scope_name" id="custom_scope_name" data-target="custom-scopes.customScopesNameField" class="form-control" autocomplete="off" placeholder="github-ruby" required maxlength="50"> <input type="hidden" data-csrf="true" value="tk/6La8cLend3qQ+vPvR/RLA0ilBfQ8pUUzlMzV+5e0wkPKcLR4reCeUnNYwSMXYOHnGnr1oIUkzl2mQz2kmeQ==" /> </auto-check> </div> <div class="form-group"> <label for="custom_scope_query">Query</label> <input type="text" name="custom_scope_query" id="custom_scope_query" data-target="custom-scopes.customScopesQueryField" class="form-control" autocomplete="off" placeholder="(repo:mona/a OR repo:mona/b) AND lang:python" required maxlength="500"> </div> <p class="text-small color-fg-muted"> To see all available qualifiers, see our <a class="Link--inTextBlock" href="https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax">documentation</a>. </p> </form> </div> <div data-target="custom-scopes.manageCustomScopesForm"> <div data-target="custom-scopes.list"></div> </div> </div> </scrollable-region> <div data-view-component="true" class="Overlay-footer Overlay-footer--alignEnd Overlay-footer--divided"> <button data-action="click:custom-scopes#customScopesCancel" type="button" data-view-component="true" class="btn"> Cancel </button> <button form="custom-scopes-dialog-form" data-action="click:custom-scopes#customScopesSubmit" data-target="custom-scopes.customScopesSubmitButton" type="submit" data-view-component="true" class="btn-primary btn"> Create saved search </button> </div> </dialog></dialog-helper> </custom-scopes> </div> </qbsearch-input> <div class="position-relative HeaderMenu-link-wrap d-lg-inline-block"> <a href="/login?return_to=https%3A%2F%2Fgithub.com%2Fnlohmann%2Fjson" class="HeaderMenu-link HeaderMenu-link--sign-in HeaderMenu-button flex-shrink-0 no-underline d-none d-lg-inline-flex border border-lg-0 rounded rounded-lg-0 px-2 py-1" style="margin-left: 12px;" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/nlohmann/json&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="4a37c1ab851072e027d147dc955e44c325f34ee84b2e146c38ac5427d2913385" data-analytics-event="{&quot;category&quot;:&quot;Marketing nav&quot;,&quot;action&quot;:&quot;click to go to homepage&quot;,&quot;label&quot;:&quot;ref_page:Marketing;ref_cta:Sign in;ref_loc:Header&quot;}" > Sign in </a> </div> <a href="/signup?ref_cta=Sign+up&amp;ref_loc=header+logged+out&amp;ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&amp;source=header-repo&amp;source_repo=nlohmann%2Fjson" class="HeaderMenu-link HeaderMenu-link--sign-up HeaderMenu-button flex-shrink-0 d-flex d-lg-inline-flex no-underline border color-border-default rounded px-2 py-1" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;site header menu&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;SIGN_UP&quot;,&quot;originating_url&quot;:&quot;https://github.com/nlohmann/json&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="4a37c1ab851072e027d147dc955e44c325f34ee84b2e146c38ac5427d2913385" data-analytics-event="{&quot;category&quot;:&quot;Sign up&quot;,&quot;action&quot;:&quot;click to sign up for account&quot;,&quot;label&quot;:&quot;ref_page:/&lt;user-name&gt;/&lt;repo-name&gt;;ref_cta:Sign up;ref_loc:header logged out&quot;}" > Sign up </a> <button type="button" class="sr-only js-header-menu-focus-trap d-block d-lg-none">Reseting focus</button> </div> </div> </div> </div> </header> <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span class="js-stale-session-flash-signed-in" hidden>You signed in with another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-signed-out" hidden>You signed out in another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <span class="js-stale-session-flash-switched" hidden>You switched accounts on another tab or window. <a class="Link--inTextBlock" href="">Reload</a> to refresh your session.</span> <button id="icon-button-7b1f1e65-e804-46a2-9978-c9a61330dd26" aria-labelledby="tooltip-c5be5d75-6457-4cb8-9e2d-7c4ca65ab185" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button><tool-tip id="tooltip-c5be5d75-6457-4cb8-9e2d-7c4ca65ab185" for="icon-button-7b1f1e65-e804-46a2-9978-c9a61330dd26" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Dismiss alert</tool-tip> </div> </div> <div id="start-of-content" class="show-on-focus"></div> <div id="js-flash-container" class="flash-container" data-turbo-replace> <template class="js-flash-template"> <div class="flash flash-full {{ className }}"> <div > <button autofocus class="flash-close js-flash-close" type="button" aria-label="Dismiss this message"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div aria-atomic="true" role="alert" class="js-flash-alert"> <div>{{ message }}</div> </div> </div> </div> </template> </div> <div class="application-main " data-commit-hovercards-enabled data-discussion-hovercards-enabled data-issue-and-pr-hovercards-enabled data-project-hovercards-enabled > <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> <main id="js-repo-pjax-container" > <div id="repository-container-header" class="pt-3 hide-full-screen" style="background-color: var(--page-header-bgColor, var(--color-page-header-bg));" data-turbo-replace> <div class="d-flex flex-nowrap flex-justify-end mb-3 px-3 px-lg-5" style="gap: 1rem;"> <div class="flex-auto min-width-0 width-fit"> <div class=" d-flex flex-wrap flex-items-center wb-break-word f3 text-normal"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo color-fg-muted mr-2"> <path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"></path> </svg> <span class="author flex-self-stretch" itemprop="author"> <a class="url fn" rel="author" data-hovercard-type="user" data-hovercard-url="/users/nlohmann/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/nlohmann"> nlohmann </a> </span> <span class="mx-1 flex-self-stretch color-fg-muted">/</span> <strong itemprop="name" class="mr-2 flex-self-stretch"> <a data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/nlohmann/json">json</a> </strong> <span></span><span class="Label Label--secondary v-align-middle mr-1">Public</span> </div> </div> <div id="repository-details-container" class="flex-shrink-0" data-turbo-replace style="max-width: 70%;"> <ul class="pagehead-actions flex-shrink-0 d-none d-md-inline" style="padding: 2px 0;"> <li> <include-fragment src="/nlohmann/json/sponsor_button"></include-fragment> </li> <li> <a href="/login?return_to=%2Fnlohmann%2Fjson" rel="nofollow" id="repository-details-watch-button" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;notification subscription menu watch&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/nlohmann/json&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="e90c8c3d80d95b54dc483ad1c34b332a8e1eac4f61d18e66e8fae91be8216cbe" aria-label="You must be signed in to change notification settings" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path> </svg>Notifications </a> <tool-tip id="tooltip-63bf2daa-81f8-445d-bbd3-6462379b6369" for="repository-details-watch-button" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to change notification settings</tool-tip> </li> <li> <a icon="repo-forked" id="fork-button" href="/login?return_to=%2Fnlohmann%2Fjson" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;repo details fork button&quot;,&quot;repository_id&quot;:11171548,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/nlohmann/json&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="da8956f66d80f65ed5158af41dee363de6dcc7d25f53a99523164a6e8782fc3c" data-view-component="true" class="btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg>Fork <span id="repo-network-counter" data-pjax-replace="true" data-turbo-replace="true" title="6,910" data-view-component="true" class="Counter">6.9k</span> </a> </li> <li> <div data-view-component="true" class="BtnGroup d-flex"> <a href="/login?return_to=%2Fnlohmann%2Fjson" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;star button&quot;,&quot;repository_id&quot;:11171548,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/nlohmann/json&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="f422025720491224f2a15ce88302b624e7e2b88f4bd8f51c703ada06d810d1fe" aria-label="You must be signed in to star a repository" data-view-component="true" class="tooltipped tooltipped-sw btn-sm btn"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg><span data-view-component="true" class="d-inline"> Star </span> <span id="repo-stars-counter-star" aria-label="44855 users starred this repository" data-singular-suffix="user starred this repository" data-plural-suffix="users starred this repository" data-turbo-replace="true" title="44,855" data-view-component="true" class="Counter js-social-count">44.9k</span> </a></div> </li> </ul> </div> </div> <div id="responsive-meta-container" data-turbo-replace> <div class="d-block d-md-none mb-2 px-3 px-md-4 px-lg-5"> <p class="f4 mb-3 "> JSON for Modern C++ </p> <div class="mb-2 d-flex flex-items-center Link--secondary"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link flex-shrink-0 mr-2"> <path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path> </svg> <span class="flex-auto min-width-0 css-truncate css-truncate-target width-fit"> <a title="https://json.nlohmann.me" role="link" target="_blank" class="text-bold" rel="noopener noreferrer" href="https://json.nlohmann.me">json.nlohmann.me</a> </span> </div> <h3 class="sr-only">License</h3> <div class="mb-2"> <a href="/nlohmann/json/blob/develop/LICENSE.MIT" class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:license&quot;}" > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-law mr-2"> <path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path> </svg> MIT license </a> </div> <div class="mb-3"> <a class="Link--secondary no-underline mr-3" href="/nlohmann/json/stargazers"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star mr-1"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> <span class="text-bold">44.9k</span> stars </a> <a class="Link--secondary no-underline mr-3" href="/nlohmann/json/forks"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-1"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg> <span class="text-bold">6.9k</span> forks </a> <a class="Link--secondary no-underline mr-3 d-inline-block" href="/nlohmann/json/branches"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-branch mr-1"> <path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path> </svg> <span>Branches</span> </a> <a class="Link--secondary no-underline d-inline-block" href="/nlohmann/json/tags"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-tag mr-1"> <path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path> </svg> <span>Tags</span> </a> <a class="Link--secondary no-underline d-inline-block" href="/nlohmann/json/activity"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pulse mr-1"> <path d="M6 2c.306 0 .582.187.696.471L10 10.731l1.304-3.26A.751.751 0 0 1 12 7h3.25a.75.75 0 0 1 0 1.5h-2.742l-1.812 4.528a.751.751 0 0 1-1.392 0L6 4.77 4.696 8.03A.75.75 0 0 1 4 8.5H.75a.75.75 0 0 1 0-1.5h2.742l1.812-4.529A.751.751 0 0 1 6 2Z"></path> </svg> <span>Activity</span> </a> </div> <div class="d-flex flex-wrap gap-2"> <div class="flex-1"> <div data-view-component="true" class="BtnGroup d-flex"> <a href="/login?return_to=%2Fnlohmann%2Fjson" rel="nofollow" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;star button&quot;,&quot;repository_id&quot;:11171548,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/nlohmann/json&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="f422025720491224f2a15ce88302b624e7e2b88f4bd8f51c703ada06d810d1fe" aria-label="You must be signed in to star a repository" data-view-component="true" class="tooltipped tooltipped-sw btn-sm btn btn-block"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star v-align-text-bottom d-inline-block mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg><span data-view-component="true" class="d-inline"> Star </span> </a></div> </div> <div class="flex-1"> <a href="/login?return_to=%2Fnlohmann%2Fjson" rel="nofollow" id="files-overview-watch-button" data-hydro-click="{&quot;event_type&quot;:&quot;authentication.click&quot;,&quot;payload&quot;:{&quot;location_in_page&quot;:&quot;notification subscription menu watch&quot;,&quot;repository_id&quot;:null,&quot;auth_type&quot;:&quot;LOG_IN&quot;,&quot;originating_url&quot;:&quot;https://github.com/nlohmann/json&quot;,&quot;user_id&quot;:null}}" data-hydro-click-hmac="e90c8c3d80d95b54dc483ad1c34b332a8e1eac4f61d18e66e8fae91be8216cbe" aria-label="You must be signed in to change notification settings" data-view-component="true" class="btn-sm btn btn-block"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-bell mr-2"> <path d="M8 16a2 2 0 0 0 1.985-1.75c.017-.137-.097-.25-.235-.25h-3.5c-.138 0-.252.113-.235.25A2 2 0 0 0 8 16ZM3 5a5 5 0 0 1 10 0v2.947c0 .05.015.098.042.139l1.703 2.555A1.519 1.519 0 0 1 13.482 13H2.518a1.516 1.516 0 0 1-1.263-2.36l1.703-2.554A.255.255 0 0 0 3 7.947Zm5-3.5A3.5 3.5 0 0 0 4.5 5v2.947c0 .346-.102.683-.294.97l-1.703 2.556a.017.017 0 0 0-.003.01l.001.006c0 .002.002.004.004.006l.006.004.007.001h10.964l.007-.001.006-.004.004-.006.001-.007a.017.017 0 0 0-.003-.01l-1.703-2.554a1.745 1.745 0 0 1-.294-.97V5A3.5 3.5 0 0 0 8 1.5Z"></path> </svg>Notifications </a> <tool-tip id="tooltip-7deecfec-2dda-4e65-8e68-326aa7213f8b" for="files-overview-watch-button" popover="manual" data-direction="s" data-type="description" data-view-component="true" class="sr-only position-absolute">You must be signed in to change notification settings</tool-tip> </div> <span> </span> </div> </div> </div> <nav data-pjax="#js-repo-pjax-container" aria-label="Repository" data-view-component="true" class="js-repo-nav js-sidenav-container-pjax js-responsive-underlinenav overflow-hidden UnderlineNav px-3 px-md-4 px-lg-5"> <ul data-view-component="true" class="UnderlineNav-body list-style-none"> <li data-view-component="true" class="d-inline-flex"> <a id="code-tab" href="/nlohmann/json" data-tab-item="i0code-tab" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages repo_deployments repo_attestations /nlohmann/json" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g c" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Code&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" aria-current="page" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item selected"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code UnderlineNav-octicon d-none d-sm-inline"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> <span data-content="Code">Code</span> <span id="code-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="issues-tab" href="/nlohmann/json/issues" data-tab-item="i1issues-tab" data-selected-links="repo_issues repo_labels repo_milestones /nlohmann/json/issues" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g i" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Issues&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> <span data-content="Issues">Issues</span> <span id="issues-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="52" data-view-component="true" class="Counter">52</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="pull-requests-tab" href="/nlohmann/json/pulls" data-tab-item="i2pull-requests-tab" data-selected-links="repo_pulls checks /nlohmann/json/pulls" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g p" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Pull requests&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> <span data-content="Pull requests">Pull requests</span> <span id="pull-requests-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="64" data-view-component="true" class="Counter">64</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="discussions-tab" href="/nlohmann/json/discussions" data-tab-item="i3discussions-tab" data-selected-links="repo_discussions /nlohmann/json/discussions" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g g" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Discussions&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment-discussion UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path> </svg> <span data-content="Discussions">Discussions</span> <span id="discussions-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="actions-tab" href="/nlohmann/json/actions" data-tab-item="i4actions-tab" data-selected-links="repo_actions /nlohmann/json/actions" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g a" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Actions&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play UnderlineNav-octicon d-none d-sm-inline"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> <span data-content="Actions">Actions</span> <span id="actions-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="projects-tab" href="/nlohmann/json/projects" data-tab-item="i5projects-tab" data-selected-links="repo_projects new_repo_project repo_project /nlohmann/json/projects" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g b" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Projects&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table UnderlineNav-octicon d-none d-sm-inline"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path> </svg> <span data-content="Projects">Projects</span> <span id="projects-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="0" hidden="hidden" data-view-component="true" class="Counter">0</span> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="security-tab" href="/nlohmann/json/security" data-tab-item="i6security-tab" data-selected-links="security overview alerts policy token_scanning code_scanning /nlohmann/json/security" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-hotkey="g s" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Security&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield UnderlineNav-octicon d-none d-sm-inline"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <span data-content="Security">Security</span> <include-fragment src="/nlohmann/json/security/overall-count" accept="text/fragment+html"></include-fragment> </a></li> <li data-view-component="true" class="d-inline-flex"> <a id="insights-tab" href="/nlohmann/json/pulse" data-tab-item="i7insights-tab" data-selected-links="repo_graphs repo_contributors dependency_graph dependabot_updates pulse people community /nlohmann/json/pulse" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" data-analytics-event="{&quot;category&quot;:&quot;Underline navbar&quot;,&quot;action&quot;:&quot;Click tab&quot;,&quot;label&quot;:&quot;Insights&quot;,&quot;target&quot;:&quot;UNDERLINE_NAV.TAB&quot;}" data-view-component="true" class="UnderlineNav-item no-wrap js-responsive-underlinenav-item js-selected-navigation-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph UnderlineNav-octicon d-none d-sm-inline"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> <span data-content="Insights">Insights</span> <span id="insights-repo-tab-count" data-pjax-replace="" data-turbo-replace="" title="Not available" data-view-component="true" class="Counter"></span> </a></li> </ul> <div style="visibility:hidden;" data-view-component="true" class="UnderlineNav-actions js-responsive-underlinenav-overflow position-absolute pr-3 pr-md-4 pr-lg-5 right-0"> <action-menu data-select-variant="none" data-view-component="true"> <focus-group direction="vertical" mnemonics retain> <button id="action-menu-689409a4-b19c-490d-9aa3-b9098b7d3bae-button" popovertarget="action-menu-689409a4-b19c-490d-9aa3-b9098b7d3bae-overlay" aria-controls="action-menu-689409a4-b19c-490d-9aa3-b9098b7d3bae-list" aria-haspopup="true" aria-labelledby="tooltip-dca332c5-7cf6-4d29-9f54-9562f5faa5ec" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--medium UnderlineNav-item"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-kebab-horizontal Button-visual"> <path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> </svg> </button><tool-tip id="tooltip-dca332c5-7cf6-4d29-9f54-9562f5faa5ec" for="action-menu-689409a4-b19c-490d-9aa3-b9098b7d3bae-button" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">Additional navigation options</tool-tip> <anchored-position data-target="action-menu.overlay" id="action-menu-689409a4-b19c-490d-9aa3-b9098b7d3bae-overlay" anchor="action-menu-689409a4-b19c-490d-9aa3-b9098b7d3bae-button" align="start" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true"> <div data-view-component="true" class="Overlay Overlay--size-auto"> <div data-view-component="true" class="Overlay-body Overlay-body--paddingNone"> <action-list> <div data-view-component="true"> <ul aria-labelledby="action-menu-689409a4-b19c-490d-9aa3-b9098b7d3bae-button" id="action-menu-689409a4-b19c-490d-9aa3-b9098b7d3bae-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap"> <li hidden="hidden" data-menu-item="i0code-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-45d3e5f4-dfa1-4739-ace6-1caf87b05b4c" href="/nlohmann/json" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code"> <path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Code </span> </a> </li> <li hidden="hidden" data-menu-item="i1issues-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-0925762a-d5dc-457c-91ce-e5868918d0b0" href="/nlohmann/json/issues" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-issue-opened"> <path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Issues </span> </a> </li> <li hidden="hidden" data-menu-item="i2pull-requests-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-00919127-5576-4a91-9688-2fb030d057d8" href="/nlohmann/json/pulls" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-git-pull-request"> <path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Pull requests </span> </a> </li> <li hidden="hidden" data-menu-item="i3discussions-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-93bc26d8-5a93-40bc-b85f-9dad56d5f8e2" href="/nlohmann/json/discussions" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-comment-discussion"> <path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Discussions </span> </a> </li> <li hidden="hidden" data-menu-item="i4actions-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-c2148a92-0aa4-44e8-a6cd-644c859e0877" href="/nlohmann/json/actions" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-play"> <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Actions </span> </a> </li> <li hidden="hidden" data-menu-item="i5projects-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-eca370e1-d3e7-472e-bea1-d5fde50e7e14" href="/nlohmann/json/projects" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-table"> <path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25ZM6.5 6.5v8h7.75a.25.25 0 0 0 .25-.25V6.5Zm8-1.5V1.75a.25.25 0 0 0-.25-.25H6.5V5Zm-13 1.5v7.75c0 .138.112.25.25.25H5v-8ZM5 5V1.5H1.75a.25.25 0 0 0-.25.25V5Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Projects </span> </a> </li> <li hidden="hidden" data-menu-item="i6security-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-560b06cb-c18f-43db-9d3e-7098d27b7d7f" href="/nlohmann/json/security" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-shield"> <path d="M7.467.133a1.748 1.748 0 0 1 1.066 0l5.25 1.68A1.75 1.75 0 0 1 15 3.48V7c0 1.566-.32 3.182-1.303 4.682-.983 1.498-2.585 2.813-5.032 3.855a1.697 1.697 0 0 1-1.33 0c-2.447-1.042-4.049-2.357-5.032-3.855C1.32 10.182 1 8.566 1 7V3.48a1.75 1.75 0 0 1 1.217-1.667Zm.61 1.429a.25.25 0 0 0-.153 0l-5.25 1.68a.25.25 0 0 0-.174.238V7c0 1.358.275 2.666 1.057 3.86.784 1.194 2.121 2.34 4.366 3.297a.196.196 0 0 0 .154 0c2.245-.956 3.582-2.104 4.366-3.298C13.225 9.666 13.5 8.36 13.5 7V3.48a.251.251 0 0 0-.174-.237l-5.25-1.68ZM8.75 4.75v3a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 1.5 0ZM9 10.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Security </span> </a> </li> <li hidden="hidden" data-menu-item="i7insights-tab" data-targets="action-list.items" role="none" data-view-component="true" class="ActionListItem"> <a tabindex="-1" id="item-b402811b-1873-4d82-8d7d-54b61928e115" href="/nlohmann/json/pulse" role="menuitem" data-view-component="true" class="ActionListContent ActionListContent--visual16"> <span class="ActionListItem-visual ActionListItem-visual--leading"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-graph"> <path d="M1.5 1.75V13.5h13.75a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75V1.75a.75.75 0 0 1 1.5 0Zm14.28 2.53-5.25 5.25a.75.75 0 0 1-1.06 0L7 7.06 4.28 9.78a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042l3.25-3.25a.75.75 0 0 1 1.06 0L10 7.94l4.72-4.72a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z"></path> </svg> </span> <span data-view-component="true" class="ActionListItem-label"> Insights </span> </a> </li> </ul> </div></action-list> </div> </div></anchored-position> </focus-group> </action-menu></div> </nav> </div> <turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class=""> <div id="repo-content-pjax-container" class="repository-content " > <h1 class='sr-only'>nlohmann/json</h1> <div class="clearfix container-xl px-md-4 px-lg-5 px-3"> <div> <div style="max-width: 100%" data-view-component="true" class="Layout Layout--flowRow-until-md react-repos-overview-margin Layout--sidebarPosition-end Layout--sidebarPosition-flowRow-end"> <div data-view-component="true" class="Layout-main"> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_dompurify_dist_purify_es_mjs-dd1d3ea6a436.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/vendors-node_modules_tanstack_query-core_build_modern_queryObserver_js-node_modules_tanstack_-defd52-843b41414e0e.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_aria-live_aria-live_ts-ui_packages_promise-with-resolvers-polyfill_promise-with-r-17c672-34345cb18aac.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_paths_index_ts-e019c54eb886.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_ref-selector_RefSelector_tsx-7496afc3784d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_commit-attribution_index_ts-ui_packages_commit-checks-status_index_ts-ui_packages-7094d4-15017f02e61c.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_code-view-shared_hooks_shortcuts_ts-ui_packages_code-view-shared_utilities_styles-0dc246-f8753c5db08d.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/ui_packages_code-view-shared_hooks_use-canonical-object_ts-ui_packages_code-view-shared_hooks-a83ec0-5ee2b562b57f.js"></script> <script crossorigin="anonymous" defer="defer" type="application/javascript" src="https://github.githubassets.com/assets/repos-overview-ca785c0ab4fa.js"></script> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-react.e0c9f0687c56358ed85e.module.css" /> <link crossorigin="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repos-overview.0ee7cac3ab511a65d9f9.module.css" /> <react-partial partial-name="repos-overview" data-ssr="true" data-attempted-ssr="true" > <script type="application/json" data-target="react-partial.embeddedData">{"props":{"initialPayload":{"allShortcutsEnabled":false,"path":"/","repo":{"id":11171548,"defaultBranch":"develop","name":"json","ownerLogin":"nlohmann","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2013-07-04T08:47:49.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/159488?v=4","public":true,"private":false,"isOrgOwned":false},"currentUser":null,"refInfo":{"name":"develop","listCacheKey":"v0:1742485609.0","canEdit":false,"refType":"branch","currentOid":"11a835df85677002a8aadc5b4e945684c5b7f68b"},"tree":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":".reuse","path":".reuse","contentType":"directory"},{"name":"LICENSES","path":"LICENSES","contentType":"directory"},{"name":"cmake","path":"cmake","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"include/nlohmann","path":"include/nlohmann","contentType":"directory","hasSimplifiedPath":true},{"name":"single_include/nlohmann","path":"single_include/nlohmann","contentType":"directory","hasSimplifiedPath":true},{"name":"tests","path":"tests","contentType":"directory"},{"name":"tools","path":"tools","contentType":"directory"},{"name":".cirrus.yml","path":".cirrus.yml","contentType":"file"},{"name":".clang-tidy","path":".clang-tidy","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"BUILD.bazel","path":"BUILD.bazel","contentType":"file"},{"name":"CITATION.cff","path":"CITATION.cff","contentType":"file"},{"name":"CMakeLists.txt","path":"CMakeLists.txt","contentType":"file"},{"name":"ChangeLog.md","path":"ChangeLog.md","contentType":"file"},{"name":"FILES.md","path":"FILES.md","contentType":"file"},{"name":"LICENSE.MIT","path":"LICENSE.MIT","contentType":"file"},{"name":"MODULE.bazel","path":"MODULE.bazel","contentType":"file"},{"name":"Makefile","path":"Makefile","contentType":"file"},{"name":"Package.swift","path":"Package.swift","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"meson.build","path":"meson.build","contentType":"file"},{"name":"nlohmann_json.natvis","path":"nlohmann_json.natvis","contentType":"file"}],"templateDirectorySuggestionUrl":null,"readme":null,"totalCount":24,"showBranchInfobar":false},"fileTree":null,"fileTreeProcessingTime":null,"foldersToFetch":[],"treeExpanded":false,"symbolsExpanded":false,"isOverview":true,"overview":{"banners":{"shouldRecommendReadme":false,"isPersonalRepo":false,"showUseActionBanner":false,"actionSlug":null,"actionId":null,"showProtectBranchBanner":false,"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_repo","releasePath":"/nlohmann/json/releases/new?marketplace=true","showPublishActionBanner":false},"interactionLimitBanner":null,"showInvitationBanner":false,"inviterName":null,"actionsMigrationBannerInfo":{"releaseTags":[],"showImmutableActionsMigrationBanner":false,"initialMigrationStatus":null}},"codeButton":{"contactPath":"/contact","isEnterprise":false,"local":{"protocolInfo":{"httpAvailable":true,"sshAvailable":null,"httpUrl":"https://github.com/nlohmann/json.git","showCloneWarning":null,"sshUrl":null,"sshCertificatesRequired":null,"sshCertificatesAvailable":null,"ghCliUrl":"gh repo clone nlohmann/json","defaultProtocol":"http","newSshKeyUrl":"/settings/ssh/new","setProtocolPath":"/users/set_protocol"},"platformInfo":{"cloneUrl":"https://desktop.github.com","showVisualStudioCloneButton":false,"visualStudioCloneUrl":"https://windows.github.com","showXcodeCloneButton":false,"xcodeCloneUrl":"xcode://clone?repo=https%3A%2F%2Fgithub.com%2Fnlohmann%2Fjson","zipballUrl":"/nlohmann/json/archive/refs/heads/develop.zip"}},"newCodespacePath":"/codespaces/new?hide_repo_select=true\u0026repo=11171548"},"popovers":{"rename":null,"renamedParentRepo":null},"commitCount":"4,695","overviewFiles":[{"displayName":"README.md","repoName":"json","refName":"develop","path":"README.md","preferredFileType":"readme","tabName":"README","richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cp dir=\"auto\"\u003e\u003ca href=\"https://github.com/nlohmann/json/releases\"\u003e\u003cimg src=\"/nlohmann/json/raw/develop/docs/mkdocs/docs/images/json.gif\" alt=\"JSON for Modern C++\" data-animated-image=\"\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://ci.appveyor.com/project/nlohmann/json\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/edd68836500ad8d09155b045cde02e56cd95f1cdd19bebe9c347cfe4265b9198/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f3161636233363678667967337179626b2f6272616e63682f646576656c6f703f7376673d74727565\" alt=\"Build Status\" data-canonical-src=\"https://ci.appveyor.com/api/projects/status/1acb366xfyg3qybk/branch/develop?svg=true\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/nlohmann/json/actions?query=workflow%3AUbuntu\"\u003e\u003cimg src=\"https://github.com/nlohmann/json/workflows/Ubuntu/badge.svg\" alt=\"Ubuntu\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/nlohmann/json/actions?query=workflow%3AmacOS\"\u003e\u003cimg src=\"https://github.com/nlohmann/json/workflows/macOS/badge.svg\" alt=\"macOS\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/nlohmann/json/actions?query=workflow%3AWindows\"\u003e\u003cimg src=\"https://github.com/nlohmann/json/workflows/Windows/badge.svg\" alt=\"Windows\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://coveralls.io/github/nlohmann/json?branch=develop\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/2787aea563ab914b27d3cb496937660fdc1b7b6354aaf6ab6a2f26f48ba28d3e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e6c6f686d616e6e2f6a736f6e2f62616467652e7376673f6272616e63683d646576656c6f70\" alt=\"Coverage Status\" data-canonical-src=\"https://coveralls.io/repos/github/nlohmann/json/badge.svg?branch=develop\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://scan.coverity.com/projects/nlohmann-json\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/e86e5b2a7cde6a3f739deeb162abb2bfb046a026b428dbd41cbeb0bef7e4c4c2/68747470733a2f2f7363616e2e636f7665726974792e636f6d2f70726f6a656374732f353535302f62616467652e737667\" alt=\"Coverity Scan Build Status\" data-canonical-src=\"https://scan.coverity.com/projects/5550/badge.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://app.codacy.com/gh/nlohmann/json/dashboard?utm_source=gh\u0026amp;utm_medium=referral\u0026amp;utm_content=\u0026amp;utm_campaign=Badge_grade\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/adb256ade3511928a73d655dd85dca6b66b49f40f8a235cc35822ee314832573/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6530643161396435643666643436666362363535633463623933306262336538\" alt=\"Codacy Badge\" data-canonical-src=\"https://app.codacy.com/project/badge/Grade/e0d1a9d5d6fd46fcb655c4cb930bb3e8\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://cirrus-ci.com/github/nlohmann/json\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/e90101264d33507fe6c18740220432366a343c0bc68986aafa43fc83c5ed3d1a/68747470733a2f2f6170692e6369727275732d63692e636f6d2f6769746875622f6e6c6f686d616e6e2f6a736f6e2e737667\" alt=\"Cirrus CI\" data-canonical-src=\"https://api.cirrus-ci.com/github/nlohmann/json.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened\u0026amp;can=1\u0026amp;q=proj:json\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/5e84b71074d9de291be80ac3931ca9f195144908750ad7320ad0cdf60d758606/68747470733a2f2f6f73732d66757a7a2d6275696c642d6c6f67732e73746f726167652e676f6f676c65617069732e636f6d2f6261646765732f6a736f6e2e737667\" alt=\"Fuzzing Status\" data-canonical-src=\"https://oss-fuzz-build-logs.storage.googleapis.com/badges/json.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://wandbox.org/permlink/1mp10JbaANo6FUc7\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/d143e703ce01a12ed5273943c6dab84e0cfea2ab11db226bcbffdd5754a083e3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7472792d6f6e6c696e652d626c75652e737667\" alt=\"Try online\" data-canonical-src=\"https://img.shields.io/badge/try-online-blue.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://json.nlohmann.me\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/c5ede95d445ad5d9f5e365eb4f2314f84a0873e10bb5941fbb6e6290e28ca439/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d6d6b646f63732d626c75652e737667\" alt=\"Documentation\" data-canonical-src=\"https://img.shields.io/badge/docs-mkdocs-blue.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://raw.githubusercontent.com/nlohmann/json/master/LICENSE.MIT\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/6581c31c16c1b13ddc2efb92e2ad69a93ddc4a92fd871ff15d401c4c6c9155a4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667\" alt=\"GitHub license\" data-canonical-src=\"https://img.shields.io/badge/license-MIT-blue.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/nlohmann/json/releases\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/a8799678a3067f81afcedccd5dea79711ff511dd79510514a0d52de87bdab1af/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e6c6f686d616e6e2f6a736f6e2e737667\" alt=\"GitHub Releases\" data-canonical-src=\"https://img.shields.io/github/release/nlohmann/json.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://repology.org/project/nlohmann-json/versions\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/6228104fb35a646eb103b776f16a9f5637b31f2275c42100113e369157a9e8df/68747470733a2f2f7265706f6c6f67792e6f72672f62616467652f74696e792d7265706f732f6e6c6f686d616e6e2d6a736f6e2e737667\" alt=\"Packaging status\" data-canonical-src=\"https://repology.org/badge/tiny-repos/nlohmann-json.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/nlohmann/json/releases\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/f89c8366693cc5f6c35f61c50e4341db7b37e4a79f15196490ce956c7bd6898b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f6e6c6f686d616e6e2f6a736f6e2f746f74616c\" alt=\"GitHub Downloads\" data-canonical-src=\"https://img.shields.io/github/downloads/nlohmann/json/total\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/nlohmann/json/issues\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/42a1cb8f26c5f094c7f26b7d8b4c598c4dcfe222cb557f88844378b7d2654edc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6e6c6f686d616e6e2f6a736f6e2e737667\" alt=\"GitHub Issues\" data-canonical-src=\"https://img.shields.io/github/issues/nlohmann/json.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://isitmaintained.com/project/nlohmann/json\" title=\"Average time to resolve an issue\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/d25a4b6294dcd8b4ce26e4038ba5b891b5dcd65c1898d7bd18d8574672fb443e/68747470733a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f7265736f6c7574696f6e2f6e6c6f686d616e6e2f6a736f6e2e737667\" alt=\"Average time to resolve an issue\" data-canonical-src=\"https://isitmaintained.com/badge/resolution/nlohmann/json.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://bestpractices.coreinfrastructure.org/projects/289\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/2736df12905b69fec83f525f4edc9e6b39676732656df4bd348623fc58174707/68747470733a2f2f626573747072616374696365732e636f7265696e6672617374727563747572652e6f72672f70726f6a656374732f3238392f6261646765\" alt=\"CII Best Practices\" data-canonical-src=\"https://bestpractices.coreinfrastructure.org/projects/289/badge\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://scorecard.dev/viewer/?uri=github.com/nlohmann/json\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/f997411a438de53e94fb535bba862502c23b98085ee2ccc9852ef5586da9996e/68747470733a2f2f6170692e73636f7265636172642e6465762f70726f6a656374732f6769746875622e636f6d2f6e6c6f686d616e6e2f6a736f6e2f6261646765\" alt=\"OpenSSF Scorecard\" data-canonical-src=\"https://api.scorecard.dev/projects/github.com/nlohmann/json/badge\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/sponsors/nlohmann\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/557eb0d571bd9690353de596ded801b3fbcc641e939a616b8cd863c92b62d633/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d53706f6e736f72732d666636396234\" alt=\"GitHub Sponsors\" data-canonical-src=\"https://img.shields.io/badge/GitHub-Sponsors-ff69b4\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://api.reuse.software/info/github.com/nlohmann/json\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/3d31d4296b4445e5851d3099c10da0b1d7dadfadeacacfb92164116028542827/68747470733a2f2f6170692e72657573652e736f6674776172652f62616467652f6769746875622e636f6d2f6e6c6f686d616e6e2f6a736f6e\" alt=\"REUSE status\" data-canonical-src=\"https://api.reuse.software/badge/github.com/nlohmann/json\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://discord.gg/6mrGXKvX7y\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/6c2388179ca51e7faf2df1404491a97e477ee7213885e60ad1659a79b6fad641/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f31303033373433333134333431373933393133\" alt=\"Discord\" data-canonical-src=\"https://img.shields.io/discord/1003743314341793913\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#design-goals\"\u003eDesign goals\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#sponsors\"\u003eSponsors\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#support\"\u003eSupport\u003c/a\u003e (\u003ca href=\"https://json.nlohmann.me\" rel=\"nofollow\"\u003edocumentation\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/home/faq/\" rel=\"nofollow\"\u003eFAQ\u003c/a\u003e, \u003ca href=\"https://github.com/nlohmann/json/discussions\"\u003ediscussions\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/\" rel=\"nofollow\"\u003eAPI\u003c/a\u003e, \u003ca href=\"https://github.com/nlohmann/json/issues\"\u003ebug issues\u003c/a\u003e)\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#quick-reference\"\u003eQuick reference\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#read-json-from-a-file\"\u003eRead JSON from a file\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#creating-json-objects-from-json-literals\"\u003eCreating \u003ccode\u003ejson\u003c/code\u003e objects from JSON literals\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#json-as-first-class-data-type\"\u003eJSON as first-class data type\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#serialization--deserialization\"\u003eSerialization / Deserialization\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#stl-like-access\"\u003eSTL-like access\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#conversion-from-stl-containers\"\u003eConversion from STL containers\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#json-pointer-and-json-patch\"\u003eJSON Pointer and JSON Patch\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#json-merge-patch\"\u003eJSON Merge Patch\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#implicit-conversions\"\u003eImplicit conversions\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#arbitrary-types-conversions\"\u003eConversions to/from arbitrary types\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#specializing-enum-conversion\"\u003eSpecializing enum conversion\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#binary-formats-bson-cbor-messagepack-ubjson-and-bjdata\"\u003eBinary formats (BSON, CBOR, MessagePack, UBJSON, and BJData)\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#customers\"\u003eCustomers\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#supported-compilers\"\u003eSupported compilers\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#integration\"\u003eIntegration\u003c/a\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"#cmake\"\u003eCMake\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#package-managers\"\u003ePackage Managers\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#pkg-config\"\u003ePkg-config\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#thanks\"\u003eThanks\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#used-third-party-tools\"\u003eUsed third-party tools\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#notes\"\u003eNotes\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"#execute-unit-tests\"\u003eExecute unit tests\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDesign goals\u003c/h2\u003e\u003ca id=\"user-content-design-goals\" class=\"anchor\" aria-label=\"Permalink: Design goals\" href=\"#design-goals\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere are myriads of \u003ca href=\"https://json.org\" rel=\"nofollow\"\u003eJSON\u003c/a\u003e libraries out there, and each may even have its reason to exist. Our class had these design goals:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eIntuitive syntax\u003c/strong\u003e. In languages such as Python, JSON feels like a first class data type. We used all the operator magic of modern C++ to achieve the same feeling in your code. Check out the \u003ca href=\"#examples\"\u003eexamples below\u003c/a\u003e and you'll know what I mean.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eTrivial integration\u003c/strong\u003e. Our whole code consists of a single header file \u003ca href=\"https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp\"\u003e\u003ccode\u003ejson.hpp\u003c/code\u003e\u003c/a\u003e. That's it. No library, no subproject, no dependencies, no complex build system. The class is written in vanilla C++11. All in all, everything should require no adjustment of your compiler flags or project settings. The library is also included in all popular \u003ca href=\"https://json.nlohmann.me/integration/package_managers/\" rel=\"nofollow\"\u003epackage managers\u003c/a\u003e.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eSerious testing\u003c/strong\u003e. Our code is heavily \u003ca href=\"https://github.com/nlohmann/json/tree/develop/tests/src\"\u003eunit-tested\u003c/a\u003e and covers \u003ca href=\"https://coveralls.io/r/nlohmann/json\" rel=\"nofollow\"\u003e100%\u003c/a\u003e of the code, including all exceptional behavior. Furthermore, we checked with \u003ca href=\"https://valgrind.org\" rel=\"nofollow\"\u003eValgrind\u003c/a\u003e and the \u003ca href=\"https://clang.llvm.org/docs/index.html\" rel=\"nofollow\"\u003eClang Sanitizers\u003c/a\u003e that there are no memory leaks. \u003ca href=\"https://github.com/google/oss-fuzz/tree/master/projects/json\"\u003eGoogle OSS-Fuzz\u003c/a\u003e additionally runs fuzz tests against all parsers 24/7, effectively executing billions of tests so far. To maintain high quality, the project is following the \u003ca href=\"https://bestpractices.coreinfrastructure.org/projects/289\" rel=\"nofollow\"\u003eCore Infrastructure Initiative (CII) best practices\u003c/a\u003e. See the \u003ca href=\"https://json.nlohmann.me/community/quality_assurance\" rel=\"nofollow\"\u003equality assurance\u003c/a\u003e overview documentation.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eOther aspects were not so important to us:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eMemory efficiency\u003c/strong\u003e. Each JSON object has an overhead of one pointer (the maximal size of a union) and one enumeration element (1 byte). The default generalization uses the following C++ data types: \u003ccode\u003estd::string\u003c/code\u003e for strings, \u003ccode\u003eint64_t\u003c/code\u003e, \u003ccode\u003euint64_t\u003c/code\u003e or \u003ccode\u003edouble\u003c/code\u003e for numbers, \u003ccode\u003estd::map\u003c/code\u003e for objects, \u003ccode\u003estd::vector\u003c/code\u003e for arrays, and \u003ccode\u003ebool\u003c/code\u003e for Booleans. However, you can template the generalized class \u003ccode\u003ebasic_json\u003c/code\u003e to your needs.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eSpeed\u003c/strong\u003e. There are certainly \u003ca href=\"https://github.com/miloyip/nativejson-benchmark#parsing-time\"\u003efaster JSON libraries\u003c/a\u003e out there. However, if your goal is to speed up your development by adding JSON support with a single header, then this library is the way to go. If you know how to use a \u003ccode\u003estd::vector\u003c/code\u003e or \u003ccode\u003estd::map\u003c/code\u003e, you are already set.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eSee the \u003ca href=\"https://github.com/nlohmann/json/blob/master/.github/CONTRIBUTING.md#please-dont\"\u003econtribution guidelines\u003c/a\u003e for more information.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSponsors\u003c/h2\u003e\u003ca id=\"user-content-sponsors\" class=\"anchor\" aria-label=\"Permalink: Sponsors\" href=\"#sponsors\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou can sponsor this library at \u003ca href=\"https://github.com/sponsors/nlohmann\"\u003eGitHub Sponsors\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e🙋 Priority Sponsor\u003c/h3\u003e\u003ca id=\"user-content-raising_hand-priority-sponsor\" class=\"anchor\" aria-label=\"Permalink: :raising_hand: Priority Sponsor\" href=\"#raising_hand-priority-sponsor\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/codeclown\"\u003eMartti Laine\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/phrrngtn\"\u003ePaul Harrington\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e🏷️ Named Sponsors\u003c/h3\u003e\u003ca id=\"user-content-label-named-sponsors\" class=\"anchor\" aria-label=\"Permalink: :label: Named Sponsors\" href=\"#label-named-sponsors\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/reFX-Mike\"\u003eMichael Hartmann\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/sthagen\"\u003eStefan Hagen\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/homer6\"\u003eSteve Sperandeo\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/eljefedelrodeodeljefe\"\u003eRobert Jefe Lindstädt\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ciroque\"\u003eSteve Wagner\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/LionNatsu\"\u003eLion Yang\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFurther support\u003c/h3\u003e\u003ca id=\"user-content-further-support\" class=\"anchor\" aria-label=\"Permalink: Further support\" href=\"#further-support\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe development of the library is further supported by JetBrains by providing free access to their IDE tools.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://jb.gg/OpenSourceSupport\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/10b97e557d8d32622250903852c1b2db59c5d29d431bc3b2a0e55301219150b7/68747470733a2f2f7265736f75726365732e6a6574627261696e732e636f6d2f73746f726167652f70726f64756374732f636f6d70616e792f6272616e642f6c6f676f732f6a6574627261696e732e737667\" alt=\"JetBrains logo.\" data-canonical-src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThanks everyone!\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSupport\u003c/h2\u003e\u003ca id=\"user-content-support\" class=\"anchor\" aria-label=\"Permalink: Support\" href=\"#support\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e❓ If you have a \u003cstrong\u003equestion\u003c/strong\u003e, please check if it is already answered in the \u003ca href=\"https://json.nlohmann.me/home/faq/\" rel=\"nofollow\"\u003e\u003cstrong\u003eFAQ\u003c/strong\u003e\u003c/a\u003e or the \u003ca href=\"https://github.com/nlohmann/json/discussions/categories/q-a\"\u003e\u003cstrong\u003eQ\u0026amp;A\u003c/strong\u003e\u003c/a\u003e section. If not, please \u003ca href=\"https://github.com/nlohmann/json/discussions/new\"\u003e\u003cstrong\u003eask a new question\u003c/strong\u003e\u003c/a\u003e there.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e📚 If you want to \u003cstrong\u003elearn more\u003c/strong\u003e about how to use the library, check out the rest of the \u003ca href=\"#examples\"\u003e\u003cstrong\u003eREADME\u003c/strong\u003e\u003c/a\u003e, have a look at \u003ca href=\"https://github.com/nlohmann/json/tree/develop/docs/mkdocs/docs/examples\"\u003e\u003cstrong\u003ecode examples\u003c/strong\u003e\u003c/a\u003e, or browse through the \u003ca href=\"https://json.nlohmann.me\" rel=\"nofollow\"\u003e\u003cstrong\u003ehelp pages\u003c/strong\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e🚧 If you want to understand the \u003cstrong\u003eAPI\u003c/strong\u003e better, check out the \u003ca href=\"https://json.nlohmann.me/api/basic_json/\" rel=\"nofollow\"\u003e\u003cstrong\u003eAPI Reference\u003c/strong\u003e\u003c/a\u003e or have a look at the \u003ca href=\"#quick-reference\"\u003equick reference\u003c/a\u003e below.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e🐛 If you found a \u003cstrong\u003ebug\u003c/strong\u003e, please check the \u003ca href=\"https://json.nlohmann.me/home/faq/\" rel=\"nofollow\"\u003e\u003cstrong\u003eFAQ\u003c/strong\u003e\u003c/a\u003e if it is a known issue or the result of a design decision. Please also have a look at the \u003ca href=\"https://github.com/nlohmann/json/issues\"\u003e\u003cstrong\u003eissue list\u003c/strong\u003e\u003c/a\u003e before you \u003ca href=\"https://github.com/nlohmann/json/issues/new/choose\"\u003e\u003cstrong\u003ecreate a new issue\u003c/strong\u003e\u003c/a\u003e. Please provide as much information as possible to help us understand and reproduce your issue.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThere is also a \u003ca href=\"https://github.com/Kapeli/Dash-User-Contributions/tree/master/docsets/JSON_for_Modern_C%2B%2B\"\u003e\u003cstrong\u003edocset\u003c/strong\u003e\u003c/a\u003e for the documentation browsers \u003ca href=\"https://kapeli.com/dash\" rel=\"nofollow\"\u003eDash\u003c/a\u003e, \u003ca href=\"https://velocity.silverlakesoftware.com\" rel=\"nofollow\"\u003eVelocity\u003c/a\u003e, and \u003ca href=\"https://zealdocs.org\" rel=\"nofollow\"\u003eZeal\u003c/a\u003e that contains the full \u003ca href=\"https://json.nlohmann.me\" rel=\"nofollow\"\u003edocumentation\u003c/a\u003e as offline resource.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eQuick reference\u003c/h2\u003e\u003ca id=\"user-content-quick-reference\" class=\"anchor\" aria-label=\"Permalink: Quick reference\" href=\"#quick-reference\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003cstrong\u003eConstructors\u003c/strong\u003e \u003ca href=\"https://json.nlohmann.me/api/basic_json/basic_json\" rel=\"nofollow\"\u003ebasic_json\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/array\" rel=\"nofollow\"\u003earray\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/binary\" rel=\"nofollow\"\u003ebinary\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/object\" rel=\"nofollow\"\u003eobject\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eObject inspection\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/type\" rel=\"nofollow\"\u003etype\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator_value_t\" rel=\"nofollow\"\u003eoperator value_t\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/type_name\" rel=\"nofollow\"\u003etype_name\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_primitive\" rel=\"nofollow\"\u003eis_primitive\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_structured\" rel=\"nofollow\"\u003eis_structured\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_null\" rel=\"nofollow\"\u003eis_null\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_boolean\" rel=\"nofollow\"\u003eis_boolean\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_number\" rel=\"nofollow\"\u003eis_number\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_number_integer\" rel=\"nofollow\"\u003eis_number_integer\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_number_unsigned\" rel=\"nofollow\"\u003eis_number_unsigned\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_number_float\" rel=\"nofollow\"\u003eis_number_float\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_object\" rel=\"nofollow\"\u003eis_object\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_array\" rel=\"nofollow\"\u003eis_array\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_string\" rel=\"nofollow\"\u003eis_string\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_binary\" rel=\"nofollow\"\u003eis_binary\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/is_discarded\" rel=\"nofollow\"\u003eis_discarded\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eValue access\u003c/strong\u003e; \u003ca href=\"https://json.nlohmann.me/api/basic_json/get\" rel=\"nofollow\"\u003eget\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/get_to\" rel=\"nofollow\"\u003eget_to\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/get_ptr\" rel=\"nofollow\"\u003eget_ptr\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/get_ref\" rel=\"nofollow\"\u003eget_ref\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator_ValueType\" rel=\"nofollow\"\u003eoperator ValueType\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/get_binary\" rel=\"nofollow\"\u003eget_binary\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eElement access\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/at\" rel=\"nofollow\"\u003eat\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator%5B%5D\" rel=\"nofollow\"\u003eoperator[]\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/value\" rel=\"nofollow\"\u003evalue\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/front\" rel=\"nofollow\"\u003efront\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/back\" rel=\"nofollow\"\u003eback\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eLookup\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/find\" rel=\"nofollow\"\u003efind\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/count\" rel=\"nofollow\"\u003ecount\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/contains\" rel=\"nofollow\"\u003econtains\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eIterators\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/begin\" rel=\"nofollow\"\u003ebegin\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/cbegin\" rel=\"nofollow\"\u003ecbegin\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/end\" rel=\"nofollow\"\u003eend\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/cend\" rel=\"nofollow\"\u003ecend\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/rbegin\" rel=\"nofollow\"\u003erbegin\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/rend\" rel=\"nofollow\"\u003erend\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/crbegin\" rel=\"nofollow\"\u003ecrbegin\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/crend\" rel=\"nofollow\"\u003ecrend\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/items\" rel=\"nofollow\"\u003eitems\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eCapacity\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/empty\" rel=\"nofollow\"\u003eempty\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/size\" rel=\"nofollow\"\u003esize\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/max_size\" rel=\"nofollow\"\u003emax_size\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eModifiers\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/clear\" rel=\"nofollow\"\u003eclear\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/push_back\" rel=\"nofollow\"\u003epush_back\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator+=\" rel=\"nofollow\"\u003eoperator+=\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/emplace_back\" rel=\"nofollow\"\u003eemplace_back\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/emplace\" rel=\"nofollow\"\u003eemplace\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/erase\" rel=\"nofollow\"\u003eerase\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/insert\" rel=\"nofollow\"\u003einsert\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/update\" rel=\"nofollow\"\u003eupdate\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/swap\" rel=\"nofollow\"\u003eswap\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eLexicographical comparison operators\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator_eq\" rel=\"nofollow\"\u003eoperator==\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator_ne\" rel=\"nofollow\"\u003eoperator!=\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator_lt\" rel=\"nofollow\"\u003eoperator\u0026lt;\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator_gt\" rel=\"nofollow\"\u003eoperator\u0026gt;\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator_le\" rel=\"nofollow\"\u003eoperator\u0026lt;=\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator_ge\" rel=\"nofollow\"\u003eoperator\u0026gt;=\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator_spaceship\" rel=\"nofollow\"\u003eoperator\u0026lt;=\u0026gt;\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eSerialization / Dumping\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/dump\" rel=\"nofollow\"\u003edump\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eDeserialization / Parsing\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/parse\" rel=\"nofollow\"\u003eparse\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/accept\" rel=\"nofollow\"\u003eaccept\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/sax_parse\" rel=\"nofollow\"\u003esax_parse\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eJSON Pointer functions\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/flatten\" rel=\"nofollow\"\u003eflatten\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/unflatten\" rel=\"nofollow\"\u003eunflatten\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eJSON Patch functions\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/patch\" rel=\"nofollow\"\u003epatch\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/patch_inplace\" rel=\"nofollow\"\u003epatch_inplace\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/diff\" rel=\"nofollow\"\u003ediff\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/merge_patch\" rel=\"nofollow\"\u003emerge_patch\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eStatic functions\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/meta\" rel=\"nofollow\"\u003emeta\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/get_allocator\" rel=\"nofollow\"\u003eget_allocator\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eBinary formats\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/from_bjdata\" rel=\"nofollow\"\u003efrom_bjdata\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/from_bson\" rel=\"nofollow\"\u003efrom_bson\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/from_cbor\" rel=\"nofollow\"\u003efrom_cbor\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/from_msgpack\" rel=\"nofollow\"\u003efrom_msgpack\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/from_ubjson\" rel=\"nofollow\"\u003efrom_ubjson\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/to_bjdata\" rel=\"nofollow\"\u003eto_bjdata\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/to_bson\" rel=\"nofollow\"\u003eto_bson\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/to_cbor\" rel=\"nofollow\"\u003eto_cbor\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/to_msgpack\" rel=\"nofollow\"\u003eto_msgpack\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/to_ubjson\" rel=\"nofollow\"\u003eto_ubjson\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eNon-member functions\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/operator_ltlt/\" rel=\"nofollow\"\u003eoperator\u0026lt;\u0026lt;\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/operator_gtgt/\" rel=\"nofollow\"\u003eoperator\u0026gt;\u0026gt;\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/to_string\" rel=\"nofollow\"\u003eto_string\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eLiterals\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/operator_literal_json\" rel=\"nofollow\"\u003eoperator\"\"_json\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eHelper classes\u003c/strong\u003e: \u003ca href=\"https://json.nlohmann.me/api/basic_json/std_hash\" rel=\"nofollow\"\u003estd::hash\u0026lt;basic_json\u0026gt;\u003c/a\u003e, \u003ca href=\"https://json.nlohmann.me/api/basic_json/std_swap\" rel=\"nofollow\"\u003estd::swap\u0026lt;basic_json\u0026gt;\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://json.nlohmann.me/api/basic_json/\" rel=\"nofollow\"\u003e\u003cstrong\u003eFull API documentation\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eExamples\u003c/h2\u003e\u003ca id=\"user-content-examples\" class=\"anchor\" aria-label=\"Permalink: Examples\" href=\"#examples\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eHere are some examples to give you an idea how to use the class.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eBeside the examples below, you may want to:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e→ Check the \u003ca href=\"https://json.nlohmann.me/\" rel=\"nofollow\"\u003edocumentation\u003c/a\u003e\u003cbr\u003e\n→ Browse the \u003ca href=\"https://github.com/nlohmann/json/tree/develop/docs/mkdocs/docs/examples\"\u003estandalone example files\u003c/a\u003e\u003cbr\u003e\n→ Read the full \u003ca href=\"https://json.nlohmann.me/api/basic_json/\" rel=\"nofollow\"\u003eAPI Documentation\u003c/a\u003e with self-contained examples for every function\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eRead JSON from a file\u003c/h3\u003e\u003ca id=\"user-content-read-json-from-a-file\" class=\"anchor\" aria-label=\"Permalink: Read JSON from a file\" href=\"#read-json-from-a-file\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003ejson\u003c/code\u003e class provides an API for manipulating a JSON value. To create a \u003ccode\u003ejson\u003c/code\u003e object by reading a JSON file:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"#include \u0026lt;fstream\u0026gt;\n#include \u0026lt;nlohmann/json.hpp\u0026gt;\nusing json = nlohmann::json;\n\n// ...\n\nstd::ifstream f(\u0026quot;example.json\u0026quot;);\njson data = json::parse(f);\"\u003e\u003cpre\u003e#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003efstream\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e\n#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003enlohmann/json.hpp\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e json = nlohmann::json;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e ...\u003c/span\u003e\n\nstd::ifstream \u003cspan class=\"pl-en\"\u003ef\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eexample.json\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\njson data = json::parse(f);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCreating \u003ccode\u003ejson\u003c/code\u003e objects from JSON literals\u003c/h3\u003e\u003ca id=\"user-content-creating-json-objects-from-json-literals\" class=\"anchor\" aria-label=\"Permalink: Creating json objects from JSON literals\" href=\"#creating-json-objects-from-json-literals\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAssume you want to create hard-code this literal JSON value in a file, as a \u003ccode\u003ejson\u003c/code\u003e object:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-json notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"{\n \u0026quot;pi\u0026quot;: 3.141,\n \u0026quot;happy\u0026quot;: true\n}\"\u003e\u003cpre\u003e{\n \u003cspan class=\"pl-ent\"\u003e\"pi\"\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003e3.141\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"happy\"\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere are various options:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// Using (raw) string literals and json::parse\njson ex1 = json::parse(R\u0026quot;(\n {\n \u0026quot;pi\u0026quot;: 3.141,\n \u0026quot;happy\u0026quot;: true\n }\n)\u0026quot;);\n\n// Using user-defined (raw) string literals\nusing namespace nlohmann::literals;\njson ex2 = R\u0026quot;(\n {\n \u0026quot;pi\u0026quot;: 3.141,\n \u0026quot;happy\u0026quot;: true\n }\n)\u0026quot;_json;\n\n// Using initializer lists\njson ex3 = {\n {\u0026quot;happy\u0026quot;, true},\n {\u0026quot;pi\u0026quot;, 3.141},\n};\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Using (raw) string literals and json::parse\u003c/span\u003e\njson ex1 = json::parse(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eR\"(\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e {\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"pi\": 3.141,\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"happy\": true\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e }\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e)\"\u003c/span\u003e\u003c/span\u003e);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Using user-defined (raw) string literals\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e \u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003enlohmann\u003c/span\u003e::literals\u003cspan class=\"pl-k\"\u003e;\u003c/span\u003e\njson ex2 = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eR\"(\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e {\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"pi\": 3.141,\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"happy\": true\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e }\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e)\"\u003c/span\u003e\u003c/span\u003e_json;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Using initializer lists\u003c/span\u003e\njson ex3 = {\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ehappy\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e},\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003epi\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e3.141\u003c/span\u003e},\n};\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eJSON as first-class data type\u003c/h3\u003e\u003ca id=\"user-content-json-as-first-class-data-type\" class=\"anchor\" aria-label=\"Permalink: JSON as first-class data type\" href=\"#json-as-first-class-data-type\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eHere are some examples to give you an idea how to use the class.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAssume you want to create the JSON object\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-json notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"{\n \u0026quot;pi\u0026quot;: 3.141,\n \u0026quot;happy\u0026quot;: true,\n \u0026quot;name\u0026quot;: \u0026quot;Niels\u0026quot;,\n \u0026quot;nothing\u0026quot;: null,\n \u0026quot;answer\u0026quot;: {\n \u0026quot;everything\u0026quot;: 42\n },\n \u0026quot;list\u0026quot;: [1, 0, 2],\n \u0026quot;object\u0026quot;: {\n \u0026quot;currency\u0026quot;: \u0026quot;USD\u0026quot;,\n \u0026quot;value\u0026quot;: 42.99\n }\n}\"\u003e\u003cpre\u003e{\n \u003cspan class=\"pl-ent\"\u003e\"pi\"\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003e3.141\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"happy\"\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"name\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eNiels\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"nothing\"\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003enull\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"answer\"\u003c/span\u003e: {\n \u003cspan class=\"pl-ent\"\u003e\"everything\"\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003e42\u003c/span\u003e\n },\n \u003cspan class=\"pl-ent\"\u003e\"list\"\u003c/span\u003e: [\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e],\n \u003cspan class=\"pl-ent\"\u003e\"object\"\u003c/span\u003e: {\n \u003cspan class=\"pl-ent\"\u003e\"currency\"\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eUSD\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e,\n \u003cspan class=\"pl-ent\"\u003e\"value\"\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003e42.99\u003c/span\u003e\n }\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWith this library, you could write:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// create an empty structure (null)\njson j;\n\n// add a number that is stored as double (note the implicit conversion of j to an object)\nj[\u0026quot;pi\u0026quot;] = 3.141;\n\n// add a Boolean that is stored as bool\nj[\u0026quot;happy\u0026quot;] = true;\n\n// add a string that is stored as std::string\nj[\u0026quot;name\u0026quot;] = \u0026quot;Niels\u0026quot;;\n\n// add another null object by passing nullptr\nj[\u0026quot;nothing\u0026quot;] = nullptr;\n\n// add an object inside the object\nj[\u0026quot;answer\u0026quot;][\u0026quot;everything\u0026quot;] = 42;\n\n// add an array that is stored as std::vector (using an initializer list)\nj[\u0026quot;list\u0026quot;] = { 1, 0, 2 };\n\n// add another object (using an initializer list of pairs)\nj[\u0026quot;object\u0026quot;] = { {\u0026quot;currency\u0026quot;, \u0026quot;USD\u0026quot;}, {\u0026quot;value\u0026quot;, 42.99} };\n\n// instead, you could also write (which looks very similar to the JSON above)\njson j2 = {\n {\u0026quot;pi\u0026quot;, 3.141},\n {\u0026quot;happy\u0026quot;, true},\n {\u0026quot;name\u0026quot;, \u0026quot;Niels\u0026quot;},\n {\u0026quot;nothing\u0026quot;, nullptr},\n {\u0026quot;answer\u0026quot;, {\n {\u0026quot;everything\u0026quot;, 42}\n }},\n {\u0026quot;list\u0026quot;, {1, 0, 2}},\n {\u0026quot;object\u0026quot;, {\n {\u0026quot;currency\u0026quot;, \u0026quot;USD\u0026quot;},\n {\u0026quot;value\u0026quot;, 42.99}\n }}\n};\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e create an empty structure (null)\u003c/span\u003e\njson j;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e add a number that is stored as double (note the implicit conversion of j to an object)\u003c/span\u003e\nj[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003epi\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = \u003cspan class=\"pl-c1\"\u003e3.141\u003c/span\u003e;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e add a Boolean that is stored as bool\u003c/span\u003e\nj[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ehappy\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e add a string that is stored as std::string\u003c/span\u003e\nj[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ename\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eNiels\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e add another null object by passing nullptr\u003c/span\u003e\nj[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003enothing\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = \u003cspan class=\"pl-c1\"\u003enullptr\u003c/span\u003e;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e add an object inside the object\u003c/span\u003e\nj[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eanswer\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e][\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eeverything\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = \u003cspan class=\"pl-c1\"\u003e42\u003c/span\u003e;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e add an array that is stored as std::vector (using an initializer list)\u003c/span\u003e\nj[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003elist\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = { \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e };\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e add another object (using an initializer list of pairs)\u003c/span\u003e\nj[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eobject\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = { {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ecurrency\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eUSD\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003evalue\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e42.99\u003c/span\u003e} };\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e instead, you could also write (which looks very similar to the JSON above)\u003c/span\u003e\njson j2 = {\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003epi\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e3.141\u003c/span\u003e},\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ehappy\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e},\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ename\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eNiels\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e},\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003enothing\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003enullptr\u003c/span\u003e},\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eanswer\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, {\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eeverything\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e42\u003c/span\u003e}\n }},\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003elist\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, {\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e}},\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eobject\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, {\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ecurrency\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eUSD\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e},\n {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003evalue\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e42.99\u003c/span\u003e}\n }}\n};\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eNote that in all these cases, you never need to \"tell\" the compiler which JSON value type you want to use. If you want to be explicit or express some edge cases, the functions \u003ca href=\"https://json.nlohmann.me/api/basic_json/array/\" rel=\"nofollow\"\u003e\u003ccode\u003ejson::array()\u003c/code\u003e\u003c/a\u003e and \u003ca href=\"https://json.nlohmann.me/api/basic_json/object/\" rel=\"nofollow\"\u003e\u003ccode\u003ejson::object()\u003c/code\u003e\u003c/a\u003e will help:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// a way to express the empty array []\njson empty_array_explicit = json::array();\n\n// ways to express the empty object {}\njson empty_object_implicit = json({});\njson empty_object_explicit = json::object();\n\n// a way to express an _array_ of key/value pairs [[\u0026quot;currency\u0026quot;, \u0026quot;USD\u0026quot;], [\u0026quot;value\u0026quot;, 42.99]]\njson array_not_object = json::array({ {\u0026quot;currency\u0026quot;, \u0026quot;USD\u0026quot;}, {\u0026quot;value\u0026quot;, 42.99} });\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e a way to express the empty array []\u003c/span\u003e\njson empty_array_explicit = json::array();\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e ways to express the empty object {}\u003c/span\u003e\njson empty_object_implicit = json({});\njson empty_object_explicit = json::object();\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e a way to express an _array_ of key/value pairs [[\"currency\", \"USD\"], [\"value\", 42.99]]\u003c/span\u003e\njson array_not_object = json::array({ {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ecurrency\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eUSD\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003evalue\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e42.99\u003c/span\u003e} });\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSerialization / Deserialization\u003c/h3\u003e\u003ca id=\"user-content-serialization--deserialization\" class=\"anchor\" aria-label=\"Permalink: Serialization / Deserialization\" href=\"#serialization--deserialization\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTo/from strings\u003c/h4\u003e\u003ca id=\"user-content-tofrom-strings\" class=\"anchor\" aria-label=\"Permalink: To/from strings\" href=\"#tofrom-strings\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou can create a JSON value (deserialization) by appending \u003ccode\u003e_json\u003c/code\u003e to a string literal:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// create object from string literal\njson j = \u0026quot;{ \\\u0026quot;happy\\\u0026quot;: true, \\\u0026quot;pi\\\u0026quot;: 3.141 }\u0026quot;_json;\n\n// or even nicer with a raw string literal\nauto j2 = R\u0026quot;(\n {\n \u0026quot;happy\u0026quot;: true,\n \u0026quot;pi\u0026quot;: 3.141\n }\n)\u0026quot;_json;\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e create object from string literal\u003c/span\u003e\njson j = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e{ \u003cspan class=\"pl-cce\"\u003e\\\"\u003c/span\u003ehappy\u003cspan class=\"pl-cce\"\u003e\\\"\u003c/span\u003e: true, \u003cspan class=\"pl-cce\"\u003e\\\"\u003c/span\u003epi\u003cspan class=\"pl-cce\"\u003e\\\"\u003c/span\u003e: 3.141 }\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e_json;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e or even nicer with a raw string literal\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e j2 = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eR\"(\u003c/span\u003e\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e {\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"happy\": true,\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"pi\": 3.141\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e }\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e)\"\u003c/span\u003e\u003c/span\u003e_json;\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eNote that without appending the \u003ccode\u003e_json\u003c/code\u003e suffix, the passed string literal is not parsed, but just used as JSON string\nvalue. That is, \u003ccode\u003ejson j = \"{ \\\"happy\\\": true, \\\"pi\\\": 3.141 }\"\u003c/code\u003e would just store the string\n\u003ccode\u003e\"{ \"happy\": true, \"pi\": 3.141 }\"\u003c/code\u003e rather than parsing the actual object.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe string literal should be brought into scope with \u003ccode\u003eusing namespace nlohmann::literals;\u003c/code\u003e\n(see \u003ca href=\"https://json.nlohmann.me/api/operator_literal_json/\" rel=\"nofollow\"\u003e\u003ccode\u003ejson::parse()\u003c/code\u003e\u003c/a\u003e).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe above example can also be expressed explicitly using \u003ca href=\"https://json.nlohmann.me/api/basic_json/parse/\" rel=\"nofollow\"\u003e\u003ccode\u003ejson::parse()\u003c/code\u003e\u003c/a\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// parse explicitly\nauto j3 = json::parse(R\u0026quot;({\u0026quot;happy\u0026quot;: true, \u0026quot;pi\u0026quot;: 3.141})\u0026quot;);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e parse explicitly\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e j3 = json::parse(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eR\"(\u003c/span\u003e{\"happy\": true, \"pi\": 3.141}\u003cspan class=\"pl-pds\"\u003e)\"\u003c/span\u003e\u003c/span\u003e);\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou can also get a string representation of a JSON value (serialize):\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// explicit conversion to string\nstd::string s = j.dump(); // {\u0026quot;happy\u0026quot;:true,\u0026quot;pi\u0026quot;:3.141}\n\n// serialization with pretty printing\n// pass in the amount of spaces to indent\nstd::cout \u0026lt;\u0026lt; j.dump(4) \u0026lt;\u0026lt; std::endl;\n// {\n// \u0026quot;happy\u0026quot;: true,\n// \u0026quot;pi\u0026quot;: 3.141\n// }\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e explicit conversion to string\u003c/span\u003e\nstd::string s = j.dump(); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e {\"happy\":true,\"pi\":3.141}\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e serialization with pretty printing\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e pass in the amount of spaces to indent\u003c/span\u003e\nstd::cout \u0026lt;\u0026lt; j.dump(\u003cspan class=\"pl-c1\"\u003e4\u003c/span\u003e) \u0026lt;\u0026lt; std::endl;\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e {\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e \"happy\": true,\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e \"pi\": 3.141\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e }\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eNote the difference between serialization and assignment:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// store a string in a JSON value\njson j_string = \u0026quot;this is a string\u0026quot;;\n\n// retrieve the string value\nauto cpp_string = j_string.template get\u0026lt;std::string\u0026gt;();\n// retrieve the string value (alternative when a variable already exists)\nstd::string cpp_string2;\nj_string.get_to(cpp_string2);\n\n// retrieve the serialized value (explicit JSON serialization)\nstd::string serialized_string = j_string.dump();\n\n// output of original string\nstd::cout \u0026lt;\u0026lt; cpp_string \u0026lt;\u0026lt; \u0026quot; == \u0026quot; \u0026lt;\u0026lt; cpp_string2 \u0026lt;\u0026lt; \u0026quot; == \u0026quot; \u0026lt;\u0026lt; j_string.template get\u0026lt;std::string\u0026gt;() \u0026lt;\u0026lt; '\\n';\n// output of serialized value\nstd::cout \u0026lt;\u0026lt; j_string \u0026lt;\u0026lt; \u0026quot; == \u0026quot; \u0026lt;\u0026lt; serialized_string \u0026lt;\u0026lt; std::endl;\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e store a string in a JSON value\u003c/span\u003e\njson j_string = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ethis is a string\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e retrieve the string value\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e cpp_string = j_string.\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003eget\u0026lt;std::string\u0026gt;();\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e retrieve the string value (alternative when a variable already exists)\u003c/span\u003e\nstd::string cpp_string2;\nj_string.get_to(cpp_string2);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e retrieve the serialized value (explicit JSON serialization)\u003c/span\u003e\nstd::string serialized_string = j_string.dump();\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e output of original string\u003c/span\u003e\nstd::cout \u0026lt;\u0026lt; cpp_string \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e == \u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u0026lt;\u0026lt; cpp_string2 \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e == \u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u0026lt;\u0026lt; j_string.\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003eget\u0026lt;std::string\u0026gt;() \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003cspan class=\"pl-cce\"\u003e\\n\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e;\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e output of serialized value\u003c/span\u003e\nstd::cout \u0026lt;\u0026lt; j_string \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e == \u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u0026lt;\u0026lt; serialized_string \u0026lt;\u0026lt; std::endl;\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://json.nlohmann.me/api/basic_json/dump/\" rel=\"nofollow\"\u003e\u003ccode\u003e.dump()\u003c/code\u003e\u003c/a\u003e returns the originally stored string value.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eNote the library only supports UTF-8. When you store strings with different encodings in the library, calling \u003ca href=\"https://json.nlohmann.me/api/basic_json/dump/\" rel=\"nofollow\"\u003e\u003ccode\u003edump()\u003c/code\u003e\u003c/a\u003e may throw an exception unless \u003ccode\u003ejson::error_handler_t::replace\u003c/code\u003e or \u003ccode\u003ejson::error_handler_t::ignore\u003c/code\u003e are used as error handlers.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eTo/from streams (e.g. files, string streams)\u003c/h4\u003e\u003ca id=\"user-content-tofrom-streams-eg-files-string-streams\" class=\"anchor\" aria-label=\"Permalink: To/from streams (e.g. files, string streams)\" href=\"#tofrom-streams-eg-files-string-streams\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou can also use streams to serialize and deserialize:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// deserialize from standard input\njson j;\nstd::cin \u0026gt;\u0026gt; j;\n\n// serialize to standard output\nstd::cout \u0026lt;\u0026lt; j;\n\n// the setw manipulator was overloaded to set the indentation for pretty printing\nstd::cout \u0026lt;\u0026lt; std::setw(4) \u0026lt;\u0026lt; j \u0026lt;\u0026lt; std::endl;\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e deserialize from standard input\u003c/span\u003e\njson j;\nstd::cin \u0026gt;\u0026gt; j;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e serialize to standard output\u003c/span\u003e\nstd::cout \u0026lt;\u0026lt; j;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e the setw manipulator was overloaded to set the indentation for pretty printing\u003c/span\u003e\nstd::cout \u0026lt;\u0026lt; std::setw(\u003cspan class=\"pl-c1\"\u003e4\u003c/span\u003e) \u0026lt;\u0026lt; j \u0026lt;\u0026lt; std::endl;\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThese operators work for any subclasses of \u003ccode\u003estd::istream\u003c/code\u003e or \u003ccode\u003estd::ostream\u003c/code\u003e. Here is the same example with files:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// read a JSON file\nstd::ifstream i(\u0026quot;file.json\u0026quot;);\njson j;\ni \u0026gt;\u0026gt; j;\n\n// write prettified JSON to another file\nstd::ofstream o(\u0026quot;pretty.json\u0026quot;);\no \u0026lt;\u0026lt; std::setw(4) \u0026lt;\u0026lt; j \u0026lt;\u0026lt; std::endl;\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e read a JSON file\u003c/span\u003e\nstd::ifstream \u003cspan class=\"pl-en\"\u003ei\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efile.json\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\njson j;\ni \u0026gt;\u0026gt; j;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e write prettified JSON to another file\u003c/span\u003e\nstd::ofstream \u003cspan class=\"pl-en\"\u003eo\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003epretty.json\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\no \u0026lt;\u0026lt; std::setw(\u003cspan class=\"pl-c1\"\u003e4\u003c/span\u003e) \u0026lt;\u0026lt; j \u0026lt;\u0026lt; std::endl;\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003ePlease note that setting the exception bit for \u003ccode\u003efailbit\u003c/code\u003e is inappropriate for this use case. It will result in program termination due to the \u003ccode\u003enoexcept\u003c/code\u003e specifier in use.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eRead from iterator range\u003c/h4\u003e\u003ca id=\"user-content-read-from-iterator-range\" class=\"anchor\" aria-label=\"Permalink: Read from iterator range\" href=\"#read-from-iterator-range\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou can also parse JSON from an iterator range; that is, from any container accessible by iterators whose \u003ccode\u003evalue_type\u003c/code\u003e is an integral type of 1, 2 or 4 bytes, which will be interpreted as UTF-8, UTF-16 and UTF-32 respectively. For instance, a \u003ccode\u003estd::vector\u0026lt;std::uint8_t\u0026gt;\u003c/code\u003e, or a \u003ccode\u003estd::list\u0026lt;std::uint16_t\u0026gt;\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"std::vector\u0026lt;std::uint8_t\u0026gt; v = {'t', 'r', 'u', 'e'};\njson j = json::parse(v.begin(), v.end());\"\u003e\u003cpre\u003estd::vector\u0026lt;std::\u003cspan class=\"pl-c1\"\u003euint8_t\u003c/span\u003e\u0026gt; v = {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003et\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003er\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003eu\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003ee\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e};\njson j = json::parse(v.begin(), v.end());\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou may leave the iterators for the range [begin, end):\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"std::vector\u0026lt;std::uint8_t\u0026gt; v = {'t', 'r', 'u', 'e'};\njson j = json::parse(v);\"\u003e\u003cpre\u003estd::vector\u0026lt;std::\u003cspan class=\"pl-c1\"\u003euint8_t\u003c/span\u003e\u0026gt; v = {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003et\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003er\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003eu\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003ee\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e};\njson j = json::parse(v);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCustom data source\u003c/h4\u003e\u003ca id=\"user-content-custom-data-source\" class=\"anchor\" aria-label=\"Permalink: Custom data source\" href=\"#custom-data-source\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSince the parse function accepts arbitrary iterator ranges, you can provide your own data sources by implementing the \u003ccode\u003eLegacyInputIterator\u003c/code\u003e concept.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"struct MyContainer {\n void advance();\n const char\u0026amp; get_current();\n};\n\nstruct MyIterator {\n using difference_type = std::ptrdiff_t;\n using value_type = char;\n using pointer = const char*;\n using reference = const char\u0026amp;;\n using iterator_category = std::input_iterator_tag;\n\n MyIterator\u0026amp; operator++() {\n target-\u0026gt;advance();\n return *this;\n }\n\n bool operator!=(const MyIterator\u0026amp; rhs) const {\n return rhs.target != target;\n }\n\n reference operator*() const {\n return target-\u0026gt;get_current();\n }\n\n MyContainer* target = nullptr;\n};\n\nMyIterator begin(MyContainer\u0026amp; tgt) {\n return MyIterator{\u0026amp;tgt};\n}\n\nMyIterator end(const MyContainer\u0026amp;) {\n return {};\n}\n\nvoid foo() {\n MyContainer c;\n json j = json::parse(c);\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eMyContainer\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eadvance\u003c/span\u003e();\n \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e\u0026amp; \u003cspan class=\"pl-en\"\u003eget_current\u003c/span\u003e();\n};\n\n\u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eMyIterator\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e difference_type = std::\u003cspan class=\"pl-c1\"\u003eptrdiff_t\u003c/span\u003e;\n \u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e value_type = \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e;\n \u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e pointer = \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e*;\n \u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e reference = \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e\u0026amp;;\n \u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e iterator_category = std::input_iterator_tag;\n\n MyIterator\u0026amp; \u003cspan class=\"pl-k\"\u003eoperator\u003c/span\u003e++() {\n target-\u0026gt;\u003cspan class=\"pl-c1\"\u003eadvance\u003c/span\u003e();\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e *\u003cspan class=\"pl-c1\"\u003ethis\u003c/span\u003e;\n }\n\n \u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eoperator\u003c/span\u003e!=(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e MyIterator\u0026amp; rhs) \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e rhs.\u003cspan class=\"pl-smi\"\u003etarget\u003c/span\u003e != target;\n }\n\n reference \u003cspan class=\"pl-k\"\u003eoperator\u003c/span\u003e*() \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e target-\u0026gt;\u003cspan class=\"pl-c1\"\u003eget_current\u003c/span\u003e();\n }\n\n MyContainer* target = \u003cspan class=\"pl-c1\"\u003enullptr\u003c/span\u003e;\n};\n\nMyIterator \u003cspan class=\"pl-en\"\u003ebegin\u003c/span\u003e(MyContainer\u0026amp; tgt) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e MyIterator{\u0026amp;tgt};\n}\n\nMyIterator \u003cspan class=\"pl-en\"\u003eend\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e MyContainer\u0026amp;) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e {};\n}\n\n\u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003efoo\u003c/span\u003e() {\n MyContainer c;\n json j = \u003cspan class=\"pl-c1\"\u003ejson::parse\u003c/span\u003e(c);\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSAX interface\u003c/h4\u003e\u003ca id=\"user-content-sax-interface\" class=\"anchor\" aria-label=\"Permalink: SAX interface\" href=\"#sax-interface\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe library uses a SAX-like interface with the following functions:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// called when null is parsed\nbool null();\n\n// called when a boolean is parsed; value is passed\nbool boolean(bool val);\n\n// called when a signed or unsigned integer number is parsed; value is passed\nbool number_integer(number_integer_t val);\nbool number_unsigned(number_unsigned_t val);\n\n// called when a floating-point number is parsed; value and original string is passed\nbool number_float(number_float_t val, const string_t\u0026amp; s);\n\n// called when a string is parsed; value is passed and can be safely moved away\nbool string(string_t\u0026amp; val);\n// called when a binary value is parsed; value is passed and can be safely moved away\nbool binary(binary_t\u0026amp; val);\n\n// called when an object or array begins or ends, resp. The number of elements is passed (or -1 if not known)\nbool start_object(std::size_t elements);\nbool end_object();\nbool start_array(std::size_t elements);\nbool end_array();\n// called when an object key is parsed; value is passed and can be safely moved away\nbool key(string_t\u0026amp; val);\n\n// called when a parse error occurs; byte position, the last token, and an exception is passed\nbool parse_error(std::size_t position, const std::string\u0026amp; last_token, const detail::exception\u0026amp; ex);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e called when null is parsed\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003enull\u003c/span\u003e();\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e called when a boolean is parsed; value is passed\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eboolean\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e val);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e called when a signed or unsigned integer number is parsed; value is passed\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003enumber_integer\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003enumber_integer_t\u003c/span\u003e val);\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003enumber_unsigned\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003enumber_unsigned_t\u003c/span\u003e val);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e called when a floating-point number is parsed; value and original string is passed\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003enumber_float\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003enumber_float_t\u003c/span\u003e val, \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003estring_t\u003c/span\u003e\u0026amp; s);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e called when a string is parsed; value is passed and can be safely moved away\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003estring\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003estring_t\u003c/span\u003e\u0026amp; val);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e called when a binary value is parsed; value is passed and can be safely moved away\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ebinary\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003ebinary_t\u003c/span\u003e\u0026amp; val);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e called when an object or array begins or ends, resp. The number of elements is passed (or -1 if not known)\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003estart_object\u003c/span\u003e(std::\u003cspan class=\"pl-c1\"\u003esize_t\u003c/span\u003e elements);\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eend_object\u003c/span\u003e();\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003estart_array\u003c/span\u003e(std::\u003cspan class=\"pl-c1\"\u003esize_t\u003c/span\u003e elements);\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eend_array\u003c/span\u003e();\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e called when an object key is parsed; value is passed and can be safely moved away\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ekey\u003c/span\u003e(\u003cspan class=\"pl-c1\"\u003estring_t\u003c/span\u003e\u0026amp; val);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e called when a parse error occurs; byte position, the last token, and an exception is passed\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eparse_error\u003c/span\u003e(std::\u003cspan class=\"pl-c1\"\u003esize_t\u003c/span\u003e position, \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e std::string\u0026amp; last_token, \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e detail::\u003cspan class=\"pl-c1\"\u003eexception\u003c/span\u003e\u0026amp; ex);\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe return value of each function determines whether parsing should proceed.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo implement your own SAX handler, proceed as follows:\u003c/p\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003eImplement the SAX interface in a class. You can use class \u003ccode\u003enlohmann::json_sax\u0026lt;json\u0026gt;\u003c/code\u003e as base class, but you can also use any class where the functions described above are implemented and public.\u003c/li\u003e\n\u003cli\u003eCreate an object of your SAX interface class, e.g. \u003ccode\u003emy_sax\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eCall \u003ccode\u003ebool json::sax_parse(input, \u0026amp;my_sax)\u003c/code\u003e; where the first parameter can be any input like a string or an input stream and the second parameter is a pointer to your SAX interface.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp dir=\"auto\"\u003eNote the \u003ccode\u003esax_parse\u003c/code\u003e function only returns a \u003ccode\u003ebool\u003c/code\u003e indicating the result of the last executed SAX event. It does not return a \u003ccode\u003ejson\u003c/code\u003e value - it is up to you to decide what to do with the SAX events. Furthermore, no exceptions are thrown in case of a parse error - it is up to you what to do with the exception object passed to your \u003ccode\u003eparse_error\u003c/code\u003e implementation. Internally, the SAX interface is used for the DOM parser (class \u003ccode\u003ejson_sax_dom_parser\u003c/code\u003e) as well as the acceptor (\u003ccode\u003ejson_sax_acceptor\u003c/code\u003e), see file \u003ca href=\"https://github.com/nlohmann/json/blob/develop/include/nlohmann/detail/input/json_sax.hpp\"\u003e\u003ccode\u003ejson_sax.hpp\u003c/code\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSTL-like access\u003c/h3\u003e\u003ca id=\"user-content-stl-like-access\" class=\"anchor\" aria-label=\"Permalink: STL-like access\" href=\"#stl-like-access\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWe designed the JSON class to behave just like an STL container. In fact, it satisfies the \u003ca href=\"https://en.cppreference.com/w/cpp/named_req/ReversibleContainer\" rel=\"nofollow\"\u003e\u003cstrong\u003eReversibleContainer\u003c/strong\u003e\u003c/a\u003e requirement.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// create an array using push_back\njson j;\nj.push_back(\u0026quot;foo\u0026quot;);\nj.push_back(1);\nj.push_back(true);\n\n// also use emplace_back\nj.emplace_back(1.78);\n\n// iterate the array\nfor (json::iterator it = j.begin(); it != j.end(); ++it) {\n std::cout \u0026lt;\u0026lt; *it \u0026lt;\u0026lt; '\\n';\n}\n\n// range-based for\nfor (auto\u0026amp; element : j) {\n std::cout \u0026lt;\u0026lt; element \u0026lt;\u0026lt; '\\n';\n}\n\n// getter/setter\nconst auto tmp = j[0].template get\u0026lt;std::string\u0026gt;();\nj[1] = 42;\nbool foo = j.at(2);\n\n// comparison\nj == R\u0026quot;([\u0026quot;foo\u0026quot;, 1, true, 1.78])\u0026quot;_json; // true\n\n// other stuff\nj.size(); // 4 entries\nj.empty(); // false\nj.type(); // json::value_t::array\nj.clear(); // the array is empty again\n\n// convenience type checkers\nj.is_null();\nj.is_boolean();\nj.is_number();\nj.is_object();\nj.is_array();\nj.is_string();\n\n// create an object\njson o;\no[\u0026quot;foo\u0026quot;] = 23;\no[\u0026quot;bar\u0026quot;] = false;\no[\u0026quot;baz\u0026quot;] = 3.141;\n\n// also use emplace\no.emplace(\u0026quot;weather\u0026quot;, \u0026quot;sunny\u0026quot;);\n\n// special iterator member functions for objects\nfor (json::iterator it = o.begin(); it != o.end(); ++it) {\n std::cout \u0026lt;\u0026lt; it.key() \u0026lt;\u0026lt; \u0026quot; : \u0026quot; \u0026lt;\u0026lt; it.value() \u0026lt;\u0026lt; \u0026quot;\\n\u0026quot;;\n}\n\n// the same code as range for\nfor (auto\u0026amp; el : o.items()) {\n std::cout \u0026lt;\u0026lt; el.key() \u0026lt;\u0026lt; \u0026quot; : \u0026quot; \u0026lt;\u0026lt; el.value() \u0026lt;\u0026lt; \u0026quot;\\n\u0026quot;;\n}\n\n// even easier with structured bindings (C++17)\nfor (auto\u0026amp; [key, value] : o.items()) {\n std::cout \u0026lt;\u0026lt; key \u0026lt;\u0026lt; \u0026quot; : \u0026quot; \u0026lt;\u0026lt; value \u0026lt;\u0026lt; \u0026quot;\\n\u0026quot;;\n}\n\n// find an entry\nif (o.contains(\u0026quot;foo\u0026quot;)) {\n // there is an entry with key \u0026quot;foo\u0026quot;\n}\n\n// or via find and an iterator\nif (o.find(\u0026quot;foo\u0026quot;) != o.end()) {\n // there is an entry with key \u0026quot;foo\u0026quot;\n}\n\n// or simpler using count()\nint foo_present = o.count(\u0026quot;foo\u0026quot;); // 1\nint fob_present = o.count(\u0026quot;fob\u0026quot;); // 0\n\n// delete an entry\no.erase(\u0026quot;foo\u0026quot;);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e create an array using push_back\u003c/span\u003e\njson j;\nj.push_back(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efoo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\nj.push_back(\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e);\nj.push_back(\u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e also use emplace_back\u003c/span\u003e\nj.emplace_back(\u003cspan class=\"pl-c1\"\u003e1.78\u003c/span\u003e);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e iterate the array\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003efor\u003c/span\u003e (json::iterator it = j.begin(); it != j.end(); ++it) {\n std::cout \u0026lt;\u0026lt; *it \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003cspan class=\"pl-cce\"\u003e\\n\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e;\n}\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e range-based for\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003efor\u003c/span\u003e (\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e\u0026amp; element : j) {\n std::cout \u0026lt;\u0026lt; element \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003cspan class=\"pl-cce\"\u003e\\n\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e;\n}\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e getter/setter\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e tmp = j[\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e].\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003eget\u0026lt;std::string\u0026gt;();\nj[\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e] = \u003cspan class=\"pl-c1\"\u003e42\u003c/span\u003e;\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e foo = j.at(\u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e comparison\u003c/span\u003e\nj == \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eR\"(\u003c/span\u003e[\"foo\", 1, true, 1.78]\u003cspan class=\"pl-pds\"\u003e)\"\u003c/span\u003e\u003c/span\u003e_json; \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e true\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e other stuff\u003c/span\u003e\nj.size(); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 4 entries\u003c/span\u003e\nj.empty(); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e false\u003c/span\u003e\nj.type(); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e json::value_t::array\u003c/span\u003e\nj.clear(); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e the array is empty again\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e convenience type checkers\u003c/span\u003e\nj.is_null();\nj.is_boolean();\nj.is_number();\nj.is_object();\nj.is_array();\nj.is_string();\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e create an object\u003c/span\u003e\njson o;\no[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efoo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = \u003cspan class=\"pl-c1\"\u003e23\u003c/span\u003e;\no[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ebar\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = \u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e;\no[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ebaz\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = \u003cspan class=\"pl-c1\"\u003e3.141\u003c/span\u003e;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e also use emplace\u003c/span\u003e\no.emplace(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eweather\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003esunny\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e special iterator member functions for objects\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003efor\u003c/span\u003e (json::iterator it = o.begin(); it != o.end(); ++it) {\n std::cout \u0026lt;\u0026lt; it.\u003cspan class=\"pl-c1\"\u003ekey\u003c/span\u003e() \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e : \u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u0026lt;\u0026lt; it.\u003cspan class=\"pl-c1\"\u003evalue\u003c/span\u003e() \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"pl-cce\"\u003e\\n\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n}\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e the same code as range for\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003efor\u003c/span\u003e (\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e\u0026amp; el : o.items()) {\n std::cout \u0026lt;\u0026lt; el.\u003cspan class=\"pl-c1\"\u003ekey\u003c/span\u003e() \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e : \u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u0026lt;\u0026lt; el.\u003cspan class=\"pl-c1\"\u003evalue\u003c/span\u003e() \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"pl-cce\"\u003e\\n\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n}\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e even easier with structured bindings (C++17)\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003efor\u003c/span\u003e (\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e\u0026amp; [key, value] : o.items()) {\n std::cout \u0026lt;\u0026lt; key \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e : \u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u0026lt;\u0026lt; value \u0026lt;\u0026lt; \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"pl-cce\"\u003e\\n\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n}\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e find an entry\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (o.contains(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efoo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e)) {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e there is an entry with key \"foo\"\u003c/span\u003e\n}\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e or via find and an iterator\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (o.find(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efoo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e) != o.end()) {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e there is an entry with key \"foo\"\u003c/span\u003e\n}\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e or simpler using count()\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e foo_present = o.count(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efoo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 1\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e fob_present = o.count(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efob\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 0\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e delete an entry\u003c/span\u003e\no.erase(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efoo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eConversion from STL containers\u003c/h3\u003e\u003ca id=\"user-content-conversion-from-stl-containers\" class=\"anchor\" aria-label=\"Permalink: Conversion from STL containers\" href=\"#conversion-from-stl-containers\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAny sequence container (\u003ccode\u003estd::array\u003c/code\u003e, \u003ccode\u003estd::vector\u003c/code\u003e, \u003ccode\u003estd::deque\u003c/code\u003e, \u003ccode\u003estd::forward_list\u003c/code\u003e, \u003ccode\u003estd::list\u003c/code\u003e) whose values can be used to construct JSON values (e.g., integers, floating point numbers, Booleans, string types, or again STL containers described in this section) can be used to create a JSON array. The same holds for similar associative containers (\u003ccode\u003estd::set\u003c/code\u003e, \u003ccode\u003estd::multiset\u003c/code\u003e, \u003ccode\u003estd::unordered_set\u003c/code\u003e, \u003ccode\u003estd::unordered_multiset\u003c/code\u003e), but in these cases the order of the elements of the array depends on how the elements are ordered in the respective STL container.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"std::vector\u0026lt;int\u0026gt; c_vector {1, 2, 3, 4};\njson j_vec(c_vector);\n// [1, 2, 3, 4]\n\nstd::deque\u0026lt;double\u0026gt; c_deque {1.2, 2.3, 3.4, 5.6};\njson j_deque(c_deque);\n// [1.2, 2.3, 3.4, 5.6]\n\nstd::list\u0026lt;bool\u0026gt; c_list {true, true, false, true};\njson j_list(c_list);\n// [true, true, false, true]\n\nstd::forward_list\u0026lt;int64_t\u0026gt; c_flist {12345678909876, 23456789098765, 34567890987654, 45678909876543};\njson j_flist(c_flist);\n// [12345678909876, 23456789098765, 34567890987654, 45678909876543]\n\nstd::array\u0026lt;unsigned long, 4\u0026gt; c_array {{1, 2, 3, 4}};\njson j_array(c_array);\n// [1, 2, 3, 4]\n\nstd::set\u0026lt;std::string\u0026gt; c_set {\u0026quot;one\u0026quot;, \u0026quot;two\u0026quot;, \u0026quot;three\u0026quot;, \u0026quot;four\u0026quot;, \u0026quot;one\u0026quot;};\njson j_set(c_set); // only one entry for \u0026quot;one\u0026quot; is used\n// [\u0026quot;four\u0026quot;, \u0026quot;one\u0026quot;, \u0026quot;three\u0026quot;, \u0026quot;two\u0026quot;]\n\nstd::unordered_set\u0026lt;std::string\u0026gt; c_uset {\u0026quot;one\u0026quot;, \u0026quot;two\u0026quot;, \u0026quot;three\u0026quot;, \u0026quot;four\u0026quot;, \u0026quot;one\u0026quot;};\njson j_uset(c_uset); // only one entry for \u0026quot;one\u0026quot; is used\n// maybe [\u0026quot;two\u0026quot;, \u0026quot;three\u0026quot;, \u0026quot;four\u0026quot;, \u0026quot;one\u0026quot;]\n\nstd::multiset\u0026lt;std::string\u0026gt; c_mset {\u0026quot;one\u0026quot;, \u0026quot;two\u0026quot;, \u0026quot;one\u0026quot;, \u0026quot;four\u0026quot;};\njson j_mset(c_mset); // both entries for \u0026quot;one\u0026quot; are used\n// maybe [\u0026quot;one\u0026quot;, \u0026quot;two\u0026quot;, \u0026quot;one\u0026quot;, \u0026quot;four\u0026quot;]\n\nstd::unordered_multiset\u0026lt;std::string\u0026gt; c_umset {\u0026quot;one\u0026quot;, \u0026quot;two\u0026quot;, \u0026quot;one\u0026quot;, \u0026quot;four\u0026quot;};\njson j_umset(c_umset); // both entries for \u0026quot;one\u0026quot; are used\n// maybe [\u0026quot;one\u0026quot;, \u0026quot;two\u0026quot;, \u0026quot;one\u0026quot;, \u0026quot;four\u0026quot;]\"\u003e\u003cpre\u003estd::vector\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; c_vector {\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e3\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e4\u003c/span\u003e};\njson \u003cspan class=\"pl-en\"\u003ej_vec\u003c/span\u003e(c_vector);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e [1, 2, 3, 4]\u003c/span\u003e\n\nstd::deque\u0026lt;\u003cspan class=\"pl-k\"\u003edouble\u003c/span\u003e\u0026gt; c_deque {\u003cspan class=\"pl-c1\"\u003e1.2\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2.3\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e3.4\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e5.6\u003c/span\u003e};\njson \u003cspan class=\"pl-en\"\u003ej_deque\u003c/span\u003e(c_deque);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e [1.2, 2.3, 3.4, 5.6]\u003c/span\u003e\n\nstd::list\u0026lt;\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e\u0026gt; c_list {\u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e};\njson \u003cspan class=\"pl-en\"\u003ej_list\u003c/span\u003e(c_list);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e [true, true, false, true]\u003c/span\u003e\n\nstd::forward_list\u0026lt;\u003cspan class=\"pl-c1\"\u003eint64_t\u003c/span\u003e\u0026gt; c_flist {\u003cspan class=\"pl-c1\"\u003e12345678909876\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e23456789098765\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e34567890987654\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e45678909876543\u003c/span\u003e};\njson \u003cspan class=\"pl-en\"\u003ej_flist\u003c/span\u003e(c_flist);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e [12345678909876, 23456789098765, 34567890987654, 45678909876543]\u003c/span\u003e\n\nstd::array\u0026lt;\u003cspan class=\"pl-k\"\u003eunsigned\u003c/span\u003e \u003cspan class=\"pl-k\"\u003elong\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e4\u003c/span\u003e\u0026gt; c_array {{\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e3\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e4\u003c/span\u003e}};\njson \u003cspan class=\"pl-en\"\u003ej_array\u003c/span\u003e(c_array);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e [1, 2, 3, 4]\u003c/span\u003e\n\nstd::set\u0026lt;std::string\u0026gt; c_set {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etwo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ethree\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efour\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e};\njson \u003cspan class=\"pl-en\"\u003ej_set\u003c/span\u003e(c_set); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e only one entry for \"one\" is used\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e [\"four\", \"one\", \"three\", \"two\"]\u003c/span\u003e\n\nstd::unordered_set\u0026lt;std::string\u0026gt; c_uset {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etwo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ethree\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efour\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e};\njson \u003cspan class=\"pl-en\"\u003ej_uset\u003c/span\u003e(c_uset); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e only one entry for \"one\" is used\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e maybe [\"two\", \"three\", \"four\", \"one\"]\u003c/span\u003e\n\nstd::multiset\u0026lt;std::string\u0026gt; c_mset {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etwo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efour\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e};\njson \u003cspan class=\"pl-en\"\u003ej_mset\u003c/span\u003e(c_mset); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e both entries for \"one\" are used\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e maybe [\"one\", \"two\", \"one\", \"four\"]\u003c/span\u003e\n\nstd::unordered_multiset\u0026lt;std::string\u0026gt; c_umset {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etwo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003efour\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e};\njson \u003cspan class=\"pl-en\"\u003ej_umset\u003c/span\u003e(c_umset); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e both entries for \"one\" are used\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e maybe [\"one\", \"two\", \"one\", \"four\"]\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eLikewise, any associative key-value containers (\u003ccode\u003estd::map\u003c/code\u003e, \u003ccode\u003estd::multimap\u003c/code\u003e, \u003ccode\u003estd::unordered_map\u003c/code\u003e, \u003ccode\u003estd::unordered_multimap\u003c/code\u003e) whose keys can construct an \u003ccode\u003estd::string\u003c/code\u003e and whose values can be used to construct JSON values (see examples above) can be used to create a JSON object. Note that in case of multimaps only one key is used in the JSON object and the value depends on the internal order of the STL container.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"std::map\u0026lt;std::string, int\u0026gt; c_map { {\u0026quot;one\u0026quot;, 1}, {\u0026quot;two\u0026quot;, 2}, {\u0026quot;three\u0026quot;, 3} };\njson j_map(c_map);\n// {\u0026quot;one\u0026quot;: 1, \u0026quot;three\u0026quot;: 3, \u0026quot;two\u0026quot;: 2 }\n\nstd::unordered_map\u0026lt;const char*, double\u0026gt; c_umap { {\u0026quot;one\u0026quot;, 1.2}, {\u0026quot;two\u0026quot;, 2.3}, {\u0026quot;three\u0026quot;, 3.4} };\njson j_umap(c_umap);\n// {\u0026quot;one\u0026quot;: 1.2, \u0026quot;two\u0026quot;: 2.3, \u0026quot;three\u0026quot;: 3.4}\n\nstd::multimap\u0026lt;std::string, bool\u0026gt; c_mmap { {\u0026quot;one\u0026quot;, true}, {\u0026quot;two\u0026quot;, true}, {\u0026quot;three\u0026quot;, false}, {\u0026quot;three\u0026quot;, true} };\njson j_mmap(c_mmap); // only one entry for key \u0026quot;three\u0026quot; is used\n// maybe {\u0026quot;one\u0026quot;: true, \u0026quot;two\u0026quot;: true, \u0026quot;three\u0026quot;: true}\n\nstd::unordered_multimap\u0026lt;std::string, bool\u0026gt; c_ummap { {\u0026quot;one\u0026quot;, true}, {\u0026quot;two\u0026quot;, true}, {\u0026quot;three\u0026quot;, false}, {\u0026quot;three\u0026quot;, true} };\njson j_ummap(c_ummap); // only one entry for key \u0026quot;three\u0026quot; is used\n// maybe {\u0026quot;one\u0026quot;: true, \u0026quot;two\u0026quot;: true, \u0026quot;three\u0026quot;: true}\"\u003e\u003cpre\u003estd::map\u0026lt;std::string, \u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt; c_map { {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etwo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ethree\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e3\u003c/span\u003e} };\njson \u003cspan class=\"pl-en\"\u003ej_map\u003c/span\u003e(c_map);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e {\"one\": 1, \"three\": 3, \"two\": 2 }\u003c/span\u003e\n\nstd::unordered_map\u0026lt;\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e \u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e*, \u003cspan class=\"pl-k\"\u003edouble\u003c/span\u003e\u0026gt; c_umap { {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e1.2\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etwo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e2.3\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ethree\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e3.4\u003c/span\u003e} };\njson \u003cspan class=\"pl-en\"\u003ej_umap\u003c/span\u003e(c_umap);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e {\"one\": 1.2, \"two\": 2.3, \"three\": 3.4}\u003c/span\u003e\n\nstd::multimap\u0026lt;std::string, \u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e\u0026gt; c_mmap { {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etwo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ethree\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ethree\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e} };\njson \u003cspan class=\"pl-en\"\u003ej_mmap\u003c/span\u003e(c_mmap); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e only one entry for key \"three\" is used\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e maybe {\"one\": true, \"two\": true, \"three\": true}\u003c/span\u003e\n\nstd::unordered_multimap\u0026lt;std::string, \u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e\u0026gt; c_ummap { {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eone\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003etwo\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ethree\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003efalse\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ethree\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e} };\njson \u003cspan class=\"pl-en\"\u003ej_ummap\u003c/span\u003e(c_ummap); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e only one entry for key \"three\" is used\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e maybe {\"one\": true, \"two\": true, \"three\": true}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eJSON Pointer and JSON Patch\u003c/h3\u003e\u003ca id=\"user-content-json-pointer-and-json-patch\" class=\"anchor\" aria-label=\"Permalink: JSON Pointer and JSON Patch\" href=\"#json-pointer-and-json-patch\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe library supports \u003cstrong\u003eJSON Pointer\u003c/strong\u003e (\u003ca href=\"https://tools.ietf.org/html/rfc6901\" rel=\"nofollow\"\u003eRFC 6901\u003c/a\u003e) as alternative means to address structured values. On top of this, \u003cstrong\u003eJSON Patch\u003c/strong\u003e (\u003ca href=\"https://tools.ietf.org/html/rfc6902\" rel=\"nofollow\"\u003eRFC 6902\u003c/a\u003e) allows describing differences between two JSON values - effectively allowing patch and diff operations known from Unix.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// a JSON value\njson j_original = R\u0026quot;({\n \u0026quot;baz\u0026quot;: [\u0026quot;one\u0026quot;, \u0026quot;two\u0026quot;, \u0026quot;three\u0026quot;],\n \u0026quot;foo\u0026quot;: \u0026quot;bar\u0026quot;\n})\u0026quot;_json;\n\n// access members with a JSON pointer (RFC 6901)\nj_original[\u0026quot;/baz/1\u0026quot;_json_pointer];\n// \u0026quot;two\u0026quot;\n\n// a JSON patch (RFC 6902)\njson j_patch = R\u0026quot;([\n { \u0026quot;op\u0026quot;: \u0026quot;replace\u0026quot;, \u0026quot;path\u0026quot;: \u0026quot;/baz\u0026quot;, \u0026quot;value\u0026quot;: \u0026quot;boo\u0026quot; },\n { \u0026quot;op\u0026quot;: \u0026quot;add\u0026quot;, \u0026quot;path\u0026quot;: \u0026quot;/hello\u0026quot;, \u0026quot;value\u0026quot;: [\u0026quot;world\u0026quot;] },\n { \u0026quot;op\u0026quot;: \u0026quot;remove\u0026quot;, \u0026quot;path\u0026quot;: \u0026quot;/foo\u0026quot;}\n])\u0026quot;_json;\n\n// apply the patch\njson j_result = j_original.patch(j_patch);\n// {\n// \u0026quot;baz\u0026quot;: \u0026quot;boo\u0026quot;,\n// \u0026quot;hello\u0026quot;: [\u0026quot;world\u0026quot;]\n// }\n\n// calculate a JSON patch from two JSON values\njson::diff(j_result, j_original);\n// [\n// { \u0026quot;op\u0026quot;:\u0026quot; replace\u0026quot;, \u0026quot;path\u0026quot;: \u0026quot;/baz\u0026quot;, \u0026quot;value\u0026quot;: [\u0026quot;one\u0026quot;, \u0026quot;two\u0026quot;, \u0026quot;three\u0026quot;] },\n// { \u0026quot;op\u0026quot;: \u0026quot;remove\u0026quot;,\u0026quot;path\u0026quot;: \u0026quot;/hello\u0026quot; },\n// { \u0026quot;op\u0026quot;: \u0026quot;add\u0026quot;, \u0026quot;path\u0026quot;: \u0026quot;/foo\u0026quot;, \u0026quot;value\u0026quot;: \u0026quot;bar\u0026quot; }\n// ]\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e a JSON value\u003c/span\u003e\njson j_original = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eR\"(\u003c/span\u003e{\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"baz\": [\"one\", \"two\", \"three\"],\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"foo\": \"bar\"\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e}\u003cspan class=\"pl-pds\"\u003e)\"\u003c/span\u003e\u003c/span\u003e_json;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e access members with a JSON pointer (RFC 6901)\u003c/span\u003e\nj_original[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e/baz/1\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e_json_pointer];\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e \"two\"\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e a JSON patch (RFC 6902)\u003c/span\u003e\njson j_patch = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eR\"(\u003c/span\u003e[\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e { \"op\": \"replace\", \"path\": \"/baz\", \"value\": \"boo\" },\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e { \"op\": \"add\", \"path\": \"/hello\", \"value\": [\"world\"] },\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e { \"op\": \"remove\", \"path\": \"/foo\"}\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e]\u003cspan class=\"pl-pds\"\u003e)\"\u003c/span\u003e\u003c/span\u003e_json;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e apply the patch\u003c/span\u003e\njson j_result = j_original.patch(j_patch);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e {\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e \"baz\": \"boo\",\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e \"hello\": [\"world\"]\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e }\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e calculate a JSON patch from two JSON values\u003c/span\u003e\n\u003cspan class=\"pl-en\"\u003ejson::diff\u003c/span\u003e(j_result, j_original);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e [\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e { \"op\":\" replace\", \"path\": \"/baz\", \"value\": [\"one\", \"two\", \"three\"] },\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e { \"op\": \"remove\",\"path\": \"/hello\" },\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e { \"op\": \"add\", \"path\": \"/foo\", \"value\": \"bar\" }\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e ]\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eJSON Merge Patch\u003c/h3\u003e\u003ca id=\"user-content-json-merge-patch\" class=\"anchor\" aria-label=\"Permalink: JSON Merge Patch\" href=\"#json-merge-patch\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe library supports \u003cstrong\u003eJSON Merge Patch\u003c/strong\u003e (\u003ca href=\"https://tools.ietf.org/html/rfc7386\" rel=\"nofollow\"\u003eRFC 7386\u003c/a\u003e) as a patch format. Instead of using JSON Pointer (see above) to specify values to be manipulated, it describes the changes using a syntax that closely mimics the document being modified.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// a JSON value\njson j_document = R\u0026quot;({\n \u0026quot;a\u0026quot;: \u0026quot;b\u0026quot;,\n \u0026quot;c\u0026quot;: {\n \u0026quot;d\u0026quot;: \u0026quot;e\u0026quot;,\n \u0026quot;f\u0026quot;: \u0026quot;g\u0026quot;\n }\n})\u0026quot;_json;\n\n// a patch\njson j_patch = R\u0026quot;({\n \u0026quot;a\u0026quot;:\u0026quot;z\u0026quot;,\n \u0026quot;c\u0026quot;: {\n \u0026quot;f\u0026quot;: null\n }\n})\u0026quot;_json;\n\n// apply the patch\nj_document.merge_patch(j_patch);\n// {\n// \u0026quot;a\u0026quot;: \u0026quot;z\u0026quot;,\n// \u0026quot;c\u0026quot;: {\n// \u0026quot;d\u0026quot;: \u0026quot;e\u0026quot;\n// }\n// }\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e a JSON value\u003c/span\u003e\njson j_document = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eR\"(\u003c/span\u003e{\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"a\": \"b\",\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"c\": {\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"d\": \"e\",\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"f\": \"g\"\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e }\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e}\u003cspan class=\"pl-pds\"\u003e)\"\u003c/span\u003e\u003c/span\u003e_json;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e a patch\u003c/span\u003e\njson j_patch = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eR\"(\u003c/span\u003e{\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"a\":\"z\",\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"c\": {\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e \"f\": null\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e }\u003c/span\u003e\n\u003cspan class=\"pl-s\"\u003e}\u003cspan class=\"pl-pds\"\u003e)\"\u003c/span\u003e\u003c/span\u003e_json;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e apply the patch\u003c/span\u003e\nj_document.merge_patch(j_patch);\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e {\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e \"a\": \"z\",\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e \"c\": {\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e \"d\": \"e\"\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e }\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e }\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eImplicit conversions\u003c/h3\u003e\u003ca id=\"user-content-implicit-conversions\" class=\"anchor\" aria-label=\"Permalink: Implicit conversions\" href=\"#implicit-conversions\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSupported types can be implicitly converted to JSON values.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIt is recommended to \u003cstrong\u003eNOT USE\u003c/strong\u003e implicit conversions \u003cstrong\u003eFROM\u003c/strong\u003e a JSON value.\nYou can find more details about this recommendation \u003ca href=\"https://www.github.com/nlohmann/json/issues/958\"\u003ehere\u003c/a\u003e.\nYou can switch off implicit conversions by defining \u003ccode\u003eJSON_USE_IMPLICIT_CONVERSIONS\u003c/code\u003e to \u003ccode\u003e0\u003c/code\u003e before including the \u003ccode\u003ejson.hpp\u003c/code\u003e header. When using CMake, you can also achieve this by setting the option \u003ccode\u003eJSON_ImplicitConversions\u003c/code\u003e to \u003ccode\u003eOFF\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// strings\nstd::string s1 = \u0026quot;Hello, world!\u0026quot;;\njson js = s1;\nauto s2 = js.template get\u0026lt;std::string\u0026gt;();\n// NOT RECOMMENDED\nstd::string s3 = js;\nstd::string s4;\ns4 = js;\n\n// Booleans\nbool b1 = true;\njson jb = b1;\nauto b2 = jb.template get\u0026lt;bool\u0026gt;();\n// NOT RECOMMENDED\nbool b3 = jb;\nbool b4;\nb4 = jb;\n\n// numbers\nint i = 42;\njson jn = i;\nauto f = jn.template get\u0026lt;double\u0026gt;();\n// NOT RECOMMENDED\ndouble f2 = jb;\ndouble f3;\nf3 = jb;\n\n// etc.\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e strings\u003c/span\u003e\nstd::string s1 = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eHello, world!\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\njson js = s1;\n\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e s2 = js.\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003eget\u0026lt;std::string\u0026gt;();\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e NOT RECOMMENDED\u003c/span\u003e\nstd::string s3 = js;\nstd::string s4;\ns4 = js;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Booleans\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e b1 = \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e;\njson jb = b1;\n\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e b2 = jb.\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003eget\u0026lt;\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e\u0026gt;();\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e NOT RECOMMENDED\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e b3 = jb;\n\u003cspan class=\"pl-k\"\u003ebool\u003c/span\u003e b4;\nb4 = jb;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e numbers\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e i = \u003cspan class=\"pl-c1\"\u003e42\u003c/span\u003e;\njson jn = i;\n\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e f = jn.\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003eget\u0026lt;\u003cspan class=\"pl-k\"\u003edouble\u003c/span\u003e\u0026gt;();\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e NOT RECOMMENDED\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003edouble\u003c/span\u003e f2 = jb;\n\u003cspan class=\"pl-k\"\u003edouble\u003c/span\u003e f3;\nf3 = jb;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e etc.\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eNote that \u003ccode\u003echar\u003c/code\u003e types are not automatically converted to JSON strings, but to integer numbers. A conversion to a string must be specified explicitly:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"char ch = 'A'; // ASCII value 65\njson j_default = ch; // stores integer number 65\njson j_string = std::string(1, ch); // stores string \u0026quot;A\u0026quot;\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003echar\u003c/span\u003e ch = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003eA\u003cspan class=\"pl-pds\"\u003e'\u003c/span\u003e\u003c/span\u003e; \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e ASCII value 65\u003c/span\u003e\njson j_default = ch; \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e stores integer number 65\u003c/span\u003e\njson j_string = std::string(\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e, ch); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e stores string \"A\"\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eArbitrary types conversions\u003c/h3\u003e\u003ca id=\"user-content-arbitrary-types-conversions\" class=\"anchor\" aria-label=\"Permalink: Arbitrary types conversions\" href=\"#arbitrary-types-conversions\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eEvery type can be serialized in JSON, not just STL containers and scalar types. Usually, you would do something along those lines:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"namespace ns {\n // a simple struct to model a person\n struct person {\n std::string name;\n std::string address;\n int age;\n };\n}\n\nns::person p = {\u0026quot;Ned Flanders\u0026quot;, \u0026quot;744 Evergreen Terrace\u0026quot;, 60};\n\n// convert to JSON: copy each value into the JSON object\njson j;\nj[\u0026quot;name\u0026quot;] = p.name;\nj[\u0026quot;address\u0026quot;] = p.address;\nj[\u0026quot;age\u0026quot;] = p.age;\n\n// ...\n\n// convert from JSON: copy each value from the JSON object\nns::person p {\n j[\u0026quot;name\u0026quot;].template get\u0026lt;std::string\u0026gt;(),\n j[\u0026quot;address\u0026quot;].template get\u0026lt;std::string\u0026gt;(),\n j[\u0026quot;age\u0026quot;].template get\u0026lt;int\u0026gt;()\n};\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ens\u003c/span\u003e {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e a simple struct to model a person\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eperson\u003c/span\u003e {\n std::string name;\n std::string address;\n \u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e age;\n };\n}\n\nns::person p = {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eNed Flanders\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e744 Evergreen Terrace\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e60\u003c/span\u003e};\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e convert to JSON: copy each value into the JSON object\u003c/span\u003e\njson j;\nj[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ename\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = p.name;\nj[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eaddress\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = p.address;\nj[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eage\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e] = p.age;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e ...\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e convert from JSON: copy each value from the JSON object\u003c/span\u003e\nns::person p {\n j[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ename\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e].\u003cspan class=\"pl-k\"\u003etemplate\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eget\u003c/span\u003e\u0026lt;std::string\u0026gt;(),\n j[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eaddress\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e].\u003cspan class=\"pl-k\"\u003etemplate\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eget\u003c/span\u003e\u0026lt;std::string\u0026gt;(),\n j[\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eage\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e].\u003cspan class=\"pl-k\"\u003etemplate\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eget\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt;()\n};\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIt works, but that's quite a lot of boilerplate... Fortunately, there's a better way:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// create a person\nns::person p {\u0026quot;Ned Flanders\u0026quot;, \u0026quot;744 Evergreen Terrace\u0026quot;, 60};\n\n// conversion: person -\u0026gt; json\njson j = p;\n\nstd::cout \u0026lt;\u0026lt; j \u0026lt;\u0026lt; std::endl;\n// {\u0026quot;address\u0026quot;:\u0026quot;744 Evergreen Terrace\u0026quot;,\u0026quot;age\u0026quot;:60,\u0026quot;name\u0026quot;:\u0026quot;Ned Flanders\u0026quot;}\n\n// conversion: json -\u0026gt; person\nauto p2 = j.template get\u0026lt;ns::person\u0026gt;();\n\n// that's it\nassert(p == p2);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e create a person\u003c/span\u003e\nns::person p {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eNed Flanders\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e744 Evergreen Terrace\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e60\u003c/span\u003e};\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e conversion: person -\u0026gt; json\u003c/span\u003e\njson j = p;\n\nstd::cout \u0026lt;\u0026lt; j \u0026lt;\u0026lt; std::endl;\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e {\"address\":\"744 Evergreen Terrace\",\"age\":60,\"name\":\"Ned Flanders\"}\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e conversion: json -\u0026gt; person\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e p2 = j.\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003eget\u0026lt;ns::person\u0026gt;();\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e that's it\u003c/span\u003e\n\u003cspan class=\"pl-en\"\u003eassert\u003c/span\u003e(p == p2);\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBasic usage\u003c/h4\u003e\u003ca id=\"user-content-basic-usage\" class=\"anchor\" aria-label=\"Permalink: Basic usage\" href=\"#basic-usage\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo make this work with one of your types, you only need to provide two functions:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"using json = nlohmann::json;\n\nnamespace ns {\n void to_json(json\u0026amp; j, const person\u0026amp; p) {\n j = json{{\u0026quot;name\u0026quot;, p.name}, {\u0026quot;address\u0026quot;, p.address}, {\u0026quot;age\u0026quot;, p.age}};\n }\n\n void from_json(const json\u0026amp; j, person\u0026amp; p) {\n j.at(\u0026quot;name\u0026quot;).get_to(p.name);\n j.at(\u0026quot;address\u0026quot;).get_to(p.address);\n j.at(\u0026quot;age\u0026quot;).get_to(p.age);\n }\n} // namespace ns\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e json = nlohmann::json;\n\n\u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ens\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eto_json\u003c/span\u003e(json\u0026amp; j, \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e person\u0026amp; p) {\n j = json{{\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ename\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, p.\u003cspan class=\"pl-smi\"\u003ename\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eaddress\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, p.\u003cspan class=\"pl-smi\"\u003eaddress\u003c/span\u003e}, {\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eage\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e, p.\u003cspan class=\"pl-smi\"\u003eage\u003c/span\u003e}};\n }\n\n \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003efrom_json\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e json\u0026amp; j, person\u0026amp; p) {\n j.\u003cspan class=\"pl-c1\"\u003eat\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ename\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e).\u003cspan class=\"pl-c1\"\u003eget_to\u003c/span\u003e(p.\u003cspan class=\"pl-smi\"\u003ename\u003c/span\u003e);\n j.\u003cspan class=\"pl-c1\"\u003eat\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eaddress\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e).\u003cspan class=\"pl-c1\"\u003eget_to\u003c/span\u003e(p.\u003cspan class=\"pl-smi\"\u003eaddress\u003c/span\u003e);\n j.\u003cspan class=\"pl-c1\"\u003eat\u003c/span\u003e(\u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eage\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e).\u003cspan class=\"pl-c1\"\u003eget_to\u003c/span\u003e(p.\u003cspan class=\"pl-smi\"\u003eage\u003c/span\u003e);\n }\n} \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e namespace ns\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThat's all! When calling the \u003ccode\u003ejson\u003c/code\u003e constructor with your type, your custom \u003ccode\u003eto_json\u003c/code\u003e method will be automatically called.\nLikewise, when calling \u003ccode\u003etemplate get\u0026lt;your_type\u0026gt;()\u003c/code\u003e or \u003ccode\u003eget_to(your_type\u0026amp;)\u003c/code\u003e, the \u003ccode\u003efrom_json\u003c/code\u003e method will be called.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eSome important things:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eThose methods \u003cstrong\u003eMUST\u003c/strong\u003e be in your type's namespace (which can be the global namespace), or the library will not be able to locate them (in this example, they are in namespace \u003ccode\u003ens\u003c/code\u003e, where \u003ccode\u003eperson\u003c/code\u003e is defined).\u003c/li\u003e\n\u003cli\u003eThose methods \u003cstrong\u003eMUST\u003c/strong\u003e be available (e.g., proper headers must be included) everywhere you use these conversions. Look at \u003ca href=\"https://github.com/nlohmann/json/issues/1108\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/1108/hovercard\"\u003eissue 1108\u003c/a\u003e for errors that may occur otherwise.\u003c/li\u003e\n\u003cli\u003eWhen using \u003ccode\u003etemplate get\u0026lt;your_type\u0026gt;()\u003c/code\u003e, \u003ccode\u003eyour_type\u003c/code\u003e \u003cstrong\u003eMUST\u003c/strong\u003e be \u003ca href=\"https://en.cppreference.com/w/cpp/named_req/DefaultConstructible\" rel=\"nofollow\"\u003eDefaultConstructible\u003c/a\u003e. (There is a way to bypass this requirement described later.)\u003c/li\u003e\n\u003cli\u003eIn function \u003ccode\u003efrom_json\u003c/code\u003e, use function \u003ca href=\"https://json.nlohmann.me/api/basic_json/at/\" rel=\"nofollow\"\u003e\u003ccode\u003eat()\u003c/code\u003e\u003c/a\u003e to access the object values rather than \u003ccode\u003eoperator[]\u003c/code\u003e. In case a key does not exist, \u003ccode\u003eat\u003c/code\u003e throws an exception that you can handle, whereas \u003ccode\u003eoperator[]\u003c/code\u003e exhibits undefined behavior.\u003c/li\u003e\n\u003cli\u003eYou do not need to add serializers or deserializers for STL types like \u003ccode\u003estd::vector\u003c/code\u003e: the library already implements these.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSimplify your life with macros\u003c/h4\u003e\u003ca id=\"user-content-simplify-your-life-with-macros\" class=\"anchor\" aria-label=\"Permalink: Simplify your life with macros\" href=\"#simplify-your-life-with-macros\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you just want to serialize/deserialize some structs, the \u003ccode\u003eto_json\u003c/code\u003e/\u003ccode\u003efrom_json\u003c/code\u003e functions can be a lot of boilerplate. There are \u003ca href=\"https://json.nlohmann.me/features/arbitrary_types/#simplify-your-life-with-macros\" rel=\"nofollow\"\u003e\u003cstrong\u003eseveral macros\u003c/strong\u003e\u003c/a\u003e to make your life easier as long as you (1) want to use a JSON object as serialization and (2) want to use the member variable names as object keys in that object.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eWhich macro to choose depends on whether private member variables need to be accessed, a deserialization is needed, missing values should yield an error or should be replaced by default values, and if derived classes are used. See \u003ca href=\"https://json.nlohmann.me/api/macros/#serializationdeserialization-macros\" rel=\"nofollow\"\u003ethis overview to choose the right one for your use case\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch5 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eExample usage of macros\u003c/h5\u003e\u003ca id=\"user-content-example-usage-of-macros\" class=\"anchor\" aria-label=\"Permalink: Example usage of macros\" href=\"#example-usage-of-macros\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eto_json\u003c/code\u003e/\u003ccode\u003efrom_json\u003c/code\u003e functions for the \u003ccode\u003eperson\u003c/code\u003e struct above can be created with \u003ca href=\"https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/\" rel=\"nofollow\"\u003e\u003ccode\u003eNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE\u003c/code\u003e\u003c/a\u003e. In all macros, the first parameter is the name of the class/struct, and all remaining parameters name the members.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"namespace ns {\n NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(person, name, address, age)\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ens\u003c/span\u003e {\n \u003cspan class=\"pl-en\"\u003eNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE\u003c/span\u003e(person, name, address, age)\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eHere is another example with private members, where \u003ca href=\"https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/\" rel=\"nofollow\"\u003e\u003ccode\u003eNLOHMANN_DEFINE_TYPE_INTRUSIVE\u003c/code\u003e\u003c/a\u003e is needed:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"namespace ns {\n class address {\n private:\n std::string street;\n int housenumber;\n int postcode;\n \n public:\n NLOHMANN_DEFINE_TYPE_INTRUSIVE(address, street, housenumber, postcode)\n };\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ens\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003eclass\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eaddress\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003eprivate:\u003c/span\u003e\n std::string street;\n \u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e housenumber;\n \u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e postcode;\n \n \u003cspan class=\"pl-k\"\u003epublic:\u003c/span\u003e\n \u003cspan class=\"pl-en\"\u003eNLOHMANN_DEFINE_TYPE_INTRUSIVE\u003c/span\u003e(address, street, housenumber, postcode)\n };\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eHow do I convert third-party types?\u003c/h4\u003e\u003ca id=\"user-content-how-do-i-convert-third-party-types\" class=\"anchor\" aria-label=\"Permalink: How do I convert third-party types?\" href=\"#how-do-i-convert-third-party-types\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis requires a bit more advanced technique. But first, let's see how this conversion mechanism works:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe library uses \u003cstrong\u003eJSON Serializers\u003c/strong\u003e to convert types to json.\nThe default serializer for \u003ccode\u003enlohmann::json\u003c/code\u003e is \u003ccode\u003enlohmann::adl_serializer\u003c/code\u003e (ADL means \u003ca href=\"https://en.cppreference.com/w/cpp/language/adl\" rel=\"nofollow\"\u003eArgument-Dependent Lookup\u003c/a\u003e).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIt is implemented like this (simplified):\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"template \u0026lt;typename T\u0026gt;\nstruct adl_serializer {\n static void to_json(json\u0026amp; j, const T\u0026amp; value) {\n // calls the \u0026quot;to_json\u0026quot; method in T's namespace\n }\n\n static void from_json(const json\u0026amp; j, T\u0026amp; value) {\n // same thing, but with the \u0026quot;from_json\u0026quot; method\n }\n};\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003e\u0026lt;\u003cspan class=\"pl-k\"\u003etypename\u003c/span\u003e T\u0026gt;\n\u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eadl_serializer\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eto_json\u003c/span\u003e(json\u0026amp; j, \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e T\u0026amp; value) {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e calls the \"to_json\" method in T's namespace\u003c/span\u003e\n }\n\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003efrom_json\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e json\u0026amp; j, T\u0026amp; value) {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e same thing, but with the \"from_json\" method\u003c/span\u003e\n }\n};\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis serializer works fine when you have control over the type's namespace. However, what about \u003ccode\u003eboost::optional\u003c/code\u003e or \u003ccode\u003estd::filesystem::path\u003c/code\u003e (C++17)? Hijacking the \u003ccode\u003eboost\u003c/code\u003e namespace is pretty bad, and it's illegal to add something other than template specializations to \u003ccode\u003estd\u003c/code\u003e...\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo solve this, you need to add a specialization of \u003ccode\u003eadl_serializer\u003c/code\u003e to the \u003ccode\u003enlohmann\u003c/code\u003e namespace, here's an example:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// partial specialization (full specialization works too)\nnamespace nlohmann {\n template \u0026lt;typename T\u0026gt;\n struct adl_serializer\u0026lt;boost::optional\u0026lt;T\u0026gt;\u0026gt; {\n static void to_json(json\u0026amp; j, const boost::optional\u0026lt;T\u0026gt;\u0026amp; opt) {\n if (opt == boost::none) {\n j = nullptr;\n } else {\n j = *opt; // this will call adl_serializer\u0026lt;T\u0026gt;::to_json which will\n // find the free function to_json in T's namespace!\n }\n }\n\n static void from_json(const json\u0026amp; j, boost::optional\u0026lt;T\u0026gt;\u0026amp; opt) {\n if (j.is_null()) {\n opt = boost::none;\n } else {\n opt = j.template get\u0026lt;T\u0026gt;(); // same as above, but with\n // adl_serializer\u0026lt;T\u0026gt;::from_json\n }\n }\n };\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e partial specialization (full specialization works too)\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003enlohmann\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003e\u0026lt;\u003cspan class=\"pl-k\"\u003etypename\u003c/span\u003e T\u0026gt;\n \u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eadl_serializer\u003c/span\u003e\u0026lt;boost::optional\u0026lt;T\u0026gt;\u0026gt; {\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eto_json\u003c/span\u003e(json\u0026amp; j, \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e boost::optional\u0026lt;T\u0026gt;\u0026amp; opt) {\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (opt == boost::none) {\n j = \u003cspan class=\"pl-c1\"\u003enullptr\u003c/span\u003e;\n } \u003cspan class=\"pl-k\"\u003eelse\u003c/span\u003e {\n j = *opt; \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e this will call adl_serializer\u0026lt;T\u0026gt;::to_json which will\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e find the free function to_json in T's namespace!\u003c/span\u003e\n }\n }\n\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003efrom_json\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e json\u0026amp; j, boost::optional\u0026lt;T\u0026gt;\u0026amp; opt) {\n \u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (j.\u003cspan class=\"pl-c1\"\u003eis_null\u003c/span\u003e()) {\n opt = boost::none;\n } \u003cspan class=\"pl-k\"\u003eelse\u003c/span\u003e {\n opt = j.\u003cspan class=\"pl-k\"\u003etemplate\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eget\u003c/span\u003e\u0026lt;T\u0026gt;(); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e same as above, but with\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e adl_serializer\u0026lt;T\u0026gt;::from_json\u003c/span\u003e\n }\n }\n };\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eHow can I use \u003ccode\u003eget()\u003c/code\u003e for non-default constructible/non-copyable types?\u003c/h4\u003e\u003ca id=\"user-content-how-can-i-use-get-for-non-default-constructiblenon-copyable-types\" class=\"anchor\" aria-label=\"Permalink: How can I use get() for non-default constructible/non-copyable types?\" href=\"#how-can-i-use-get-for-non-default-constructiblenon-copyable-types\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere is a way, if your type is \u003ca href=\"https://en.cppreference.com/w/cpp/named_req/MoveConstructible\" rel=\"nofollow\"\u003eMoveConstructible\u003c/a\u003e. You will need to specialize the \u003ccode\u003eadl_serializer\u003c/code\u003e as well, but with a special \u003ccode\u003efrom_json\u003c/code\u003e overload:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"struct move_only_type {\n move_only_type() = delete;\n move_only_type(int ii): i(ii) {}\n move_only_type(const move_only_type\u0026amp;) = delete;\n move_only_type(move_only_type\u0026amp;\u0026amp;) = default;\n\n int i;\n};\n\nnamespace nlohmann {\n template \u0026lt;\u0026gt;\n struct adl_serializer\u0026lt;move_only_type\u0026gt; {\n // note: the return type is no longer 'void', and the method only takes\n // one argument\n static move_only_type from_json(const json\u0026amp; j) {\n return {j.template get\u0026lt;int\u0026gt;()};\n }\n\n // Here's the catch! You must provide a to_json method! Otherwise, you\n // will not be able to convert move_only_type to json, since you fully\n // specialized adl_serializer on that type\n static void to_json(json\u0026amp; j, move_only_type t) {\n j = t.i;\n }\n };\n}\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-en\"\u003emove_only_type\u003c/span\u003e {\n \u003cspan class=\"pl-en\"\u003emove_only_type\u003c/span\u003e() = \u003cspan class=\"pl-k\"\u003edelete\u003c/span\u003e;\n \u003cspan class=\"pl-en\"\u003emove_only_type\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e ii): i(ii) {}\n \u003cspan class=\"pl-en\"\u003emove_only_type\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e move_only_type\u0026amp;) = \u003cspan class=\"pl-k\"\u003edelete\u003c/span\u003e;\n \u003cspan class=\"pl-en\"\u003emove_only_type\u003c/span\u003e(move_only_type\u0026amp;\u0026amp;) = \u003cspan class=\"pl-k\"\u003edefault\u003c/span\u003e;\n\n \u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e i;\n};\n\n\u003cspan class=\"pl-k\"\u003enamespace\u003c/span\u003e \u003cspan class=\"pl-en\"\u003enlohmann\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003e\u0026lt;\u0026gt;\n \u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eadl_serializer\u003c/span\u003e\u0026lt;move_only_type\u0026gt; {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e note: the return type is no longer 'void', and the method only takes\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e one argument\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e move_only_type \u003cspan class=\"pl-en\"\u003efrom_json\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e json\u0026amp; j) {\n \u003cspan class=\"pl-k\"\u003ereturn\u003c/span\u003e {j.\u003cspan class=\"pl-k\"\u003etemplate\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eget\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-k\"\u003eint\u003c/span\u003e\u0026gt;()};\n }\n\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e Here's the catch! You must provide a to_json method! Otherwise, you\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e will not be able to convert move_only_type to json, since you fully\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e specialized adl_serializer on that type\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eto_json\u003c/span\u003e(json\u0026amp; j, move_only_type t) {\n j = t.\u003cspan class=\"pl-smi\"\u003ei\u003c/span\u003e;\n }\n };\n}\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCan I write my own serializer? (Advanced use)\u003c/h4\u003e\u003ca id=\"user-content-can-i-write-my-own-serializer-advanced-use\" class=\"anchor\" aria-label=\"Permalink: Can I write my own serializer? (Advanced use)\" href=\"#can-i-write-my-own-serializer-advanced-use\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYes. You might want to take a look at \u003ca href=\"https://github.com/nlohmann/json/blob/develop/tests/src/unit-udt.cpp\"\u003e\u003ccode\u003eunit-udt.cpp\u003c/code\u003e\u003c/a\u003e in the test suite, to see a few examples.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you write your own serializer, you'll need to do a few things:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003euse a different \u003ccode\u003ebasic_json\u003c/code\u003e alias than \u003ccode\u003enlohmann::json\u003c/code\u003e (the last template parameter of \u003ccode\u003ebasic_json\u003c/code\u003e is the \u003ccode\u003eJSONSerializer\u003c/code\u003e)\u003c/li\u003e\n\u003cli\u003euse your \u003ccode\u003ebasic_json\u003c/code\u003e alias (or a template parameter) in all your \u003ccode\u003eto_json\u003c/code\u003e/\u003ccode\u003efrom_json\u003c/code\u003e methods\u003c/li\u003e\n\u003cli\u003euse \u003ccode\u003enlohmann::to_json\u003c/code\u003e and \u003ccode\u003enlohmann::from_json\u003c/code\u003e when you need ADL\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eHere is an example, without simplifications, that only accepts types with a size \u0026lt;= 32, and uses ADL.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// You should use void as a second template argument\n// if you don't need compile-time checks on T\ntemplate\u0026lt;typename T, typename SFINAE = typename std::enable_if\u0026lt;sizeof(T) \u0026lt;= 32\u0026gt;::type\u0026gt;\nstruct less_than_32_serializer {\n template \u0026lt;typename BasicJsonType\u0026gt;\n static void to_json(BasicJsonType\u0026amp; j, T value) {\n // we want to use ADL, and call the correct to_json overload\n using nlohmann::to_json; // this method is called by adl_serializer,\n // this is where the magic happens\n to_json(j, value);\n }\n\n template \u0026lt;typename BasicJsonType\u0026gt;\n static void from_json(const BasicJsonType\u0026amp; j, T\u0026amp; value) {\n // same thing here\n using nlohmann::from_json;\n from_json(j, value);\n }\n};\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e You should use void as a second template argument\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e if you don't need compile-time checks on T\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003etemplate\u003c/span\u003e\u0026lt;\u003cspan class=\"pl-k\"\u003etypename\u003c/span\u003e T, \u003cspan class=\"pl-k\"\u003etypename\u003c/span\u003e SFINAE = \u003cspan class=\"pl-k\"\u003etypename\u003c/span\u003e std::enable_if\u0026lt;\u003cspan class=\"pl-k\"\u003esizeof\u003c/span\u003e(T) \u0026lt;= \u003cspan class=\"pl-c1\"\u003e32\u003c/span\u003e\u0026gt;::type\u0026gt;\n\u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eless_than_32_serializer\u003c/span\u003e {\n \u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003e\u0026lt;\u003cspan class=\"pl-k\"\u003etypename\u003c/span\u003e BasicJsonType\u0026gt;\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eto_json\u003c/span\u003e(BasicJsonType\u0026amp; j, T value) {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e we want to use ADL, and call the correct to_json overload\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e nlohmann::to_json; \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e this method is called by adl_serializer,\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e this is where the magic happens\u003c/span\u003e\n \u003cspan class=\"pl-c1\"\u003eto_json\u003c/span\u003e(j, value);\n }\n\n \u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003e\u0026lt;\u003cspan class=\"pl-k\"\u003etypename\u003c/span\u003e BasicJsonType\u0026gt;\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003efrom_json\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e BasicJsonType\u0026amp; j, T\u0026amp; value) {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e same thing here\u003c/span\u003e\n \u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e nlohmann::from_json;\n \u003cspan class=\"pl-c1\"\u003efrom_json\u003c/span\u003e(j, value);\n }\n};\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBe \u003cstrong\u003every\u003c/strong\u003e careful when reimplementing your serializer, you can stack overflow if you don't pay attention:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"template \u0026lt;typename T, void\u0026gt;\nstruct bad_serializer\n{\n template \u0026lt;typename BasicJsonType\u0026gt;\n static void to_json(BasicJsonType\u0026amp; j, const T\u0026amp; value) {\n // this calls BasicJsonType::json_serializer\u0026lt;T\u0026gt;::to_json(j, value)\n // if BasicJsonType::json_serializer == bad_serializer ... oops!\n j = value;\n }\n\n template \u0026lt;typename BasicJsonType\u0026gt;\n static void to_json(const BasicJsonType\u0026amp; j, T\u0026amp; value) {\n // this calls BasicJsonType::json_serializer\u0026lt;T\u0026gt;::from_json(j, value)\n // if BasicJsonType::json_serializer == bad_serializer ... oops!\n value = j.template get\u0026lt;T\u0026gt;(); // oops!\n }\n};\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003e\u0026lt;\u003cspan class=\"pl-k\"\u003etypename\u003c/span\u003e T, \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e\u0026gt;\n\u003cspan class=\"pl-k\"\u003estruct\u003c/span\u003e \u003cspan class=\"pl-en\"\u003ebad_serializer\u003c/span\u003e\n{\n \u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003e\u0026lt;\u003cspan class=\"pl-k\"\u003etypename\u003c/span\u003e BasicJsonType\u0026gt;\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eto_json\u003c/span\u003e(BasicJsonType\u0026amp; j, \u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e T\u0026amp; value) {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e this calls BasicJsonType::json_serializer\u0026lt;T\u0026gt;::to_json(j, value)\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e if BasicJsonType::json_serializer == bad_serializer ... oops!\u003c/span\u003e\n j = value;\n }\n\n \u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003e\u0026lt;\u003cspan class=\"pl-k\"\u003etypename\u003c/span\u003e BasicJsonType\u0026gt;\n \u003cspan class=\"pl-k\"\u003estatic\u003c/span\u003e \u003cspan class=\"pl-k\"\u003evoid\u003c/span\u003e \u003cspan class=\"pl-en\"\u003eto_json\u003c/span\u003e(\u003cspan class=\"pl-k\"\u003econst\u003c/span\u003e BasicJsonType\u0026amp; j, T\u0026amp; value) {\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e this calls BasicJsonType::json_serializer\u0026lt;T\u0026gt;::from_json(j, value)\u003c/span\u003e\n \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e if BasicJsonType::json_serializer == bad_serializer ... oops!\u003c/span\u003e\n value = j.\u003cspan class=\"pl-k\"\u003etemplate\u003c/span\u003e \u003cspan class=\"pl-smi\"\u003eget\u003c/span\u003e\u0026lt;T\u0026gt;(); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e oops!\u003c/span\u003e\n }\n};\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSpecializing enum conversion\u003c/h3\u003e\u003ca id=\"user-content-specializing-enum-conversion\" class=\"anchor\" aria-label=\"Permalink: Specializing enum conversion\" href=\"#specializing-enum-conversion\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBy default, enum values are serialized to JSON as integers. In some cases this could result in undesired behavior. If an enum is modified or re-ordered after data has been serialized to JSON, the later de-serialized JSON data may be undefined or a different enum value than was originally intended.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIt is possible to more precisely specify how a given enum is mapped to and from JSON as shown below:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// example enum type declaration\nenum TaskState {\n TS_STOPPED,\n TS_RUNNING,\n TS_COMPLETED,\n TS_INVALID=-1,\n};\n\n// map TaskState values to JSON as strings\nNLOHMANN_JSON_SERIALIZE_ENUM( TaskState, {\n {TS_INVALID, nullptr},\n {TS_STOPPED, \u0026quot;stopped\u0026quot;},\n {TS_RUNNING, \u0026quot;running\u0026quot;},\n {TS_COMPLETED, \u0026quot;completed\u0026quot;},\n})\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e example enum type declaration\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eenum\u003c/span\u003e TaskState {\n TS_STOPPED,\n TS_RUNNING,\n TS_COMPLETED,\n TS_INVALID=-\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e,\n};\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e map TaskState values to JSON as strings\u003c/span\u003e\n\u003cspan class=\"pl-en\"\u003eNLOHMANN_JSON_SERIALIZE_ENUM\u003c/span\u003e( TaskState, {\n {TS_INVALID, \u003cspan class=\"pl-c1\"\u003enullptr\u003c/span\u003e},\n {TS_STOPPED, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003estopped\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e},\n {TS_RUNNING, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003erunning\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e},\n {TS_COMPLETED, \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ecompleted\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e},\n})\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003eNLOHMANN_JSON_SERIALIZE_ENUM()\u003c/code\u003e macro declares a set of \u003ccode\u003eto_json()\u003c/code\u003e / \u003ccode\u003efrom_json()\u003c/code\u003e functions for type \u003ccode\u003eTaskState\u003c/code\u003e while avoiding repetition and boilerplate serialization code.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eUsage:\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// enum to JSON as string\njson j = TS_STOPPED;\nassert(j == \u0026quot;stopped\u0026quot;);\n\n// json string to enum\njson j3 = \u0026quot;running\u0026quot;;\nassert(j3.template get\u0026lt;TaskState\u0026gt;() == TS_RUNNING);\n\n// undefined json value to enum (where the first map entry above is the default)\njson jPi = 3.14;\nassert(jPi.template get\u0026lt;TaskState\u0026gt;() == TS_INVALID);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e enum to JSON as string\u003c/span\u003e\njson j = TS_STOPPED;\n\u003cspan class=\"pl-en\"\u003eassert\u003c/span\u003e(j == \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003estopped\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e json string to enum\u003c/span\u003e\njson j3 = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003erunning\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e;\n\u003cspan class=\"pl-en\"\u003eassert\u003c/span\u003e(j3.\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003eget\u0026lt;TaskState\u0026gt;() == TS_RUNNING);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e undefined json value to enum (where the first map entry above is the default)\u003c/span\u003e\njson jPi = \u003cspan class=\"pl-c1\"\u003e3.14\u003c/span\u003e;\n\u003cspan class=\"pl-en\"\u003eassert\u003c/span\u003e(jPi.\u003cspan class=\"pl-k\"\u003etemplate \u003c/span\u003eget\u0026lt;TaskState\u0026gt;() == TS_INVALID);\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eJust as in \u003ca href=\"#arbitrary-types-conversions\"\u003eArbitrary Type Conversions\u003c/a\u003e above,\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ccode\u003eNLOHMANN_JSON_SERIALIZE_ENUM()\u003c/code\u003e MUST be declared in your enum type's namespace (which can be the global namespace), or the library will not be able to locate it, and it will default to integer serialization.\u003c/li\u003e\n\u003cli\u003eIt MUST be available (e.g., proper headers must be included) everywhere you use the conversions.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eOther Important points:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eWhen using \u003ccode\u003etemplate get\u0026lt;ENUM_TYPE\u0026gt;()\u003c/code\u003e, undefined JSON values will default to the first pair specified in your map. Select this default pair carefully.\u003c/li\u003e\n\u003cli\u003eIf an enum or JSON value is specified more than once in your map, the first matching occurrence from the top of the map will be returned when converting to or from JSON.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBinary formats (BSON, CBOR, MessagePack, UBJSON, and BJData)\u003c/h3\u003e\u003ca id=\"user-content-binary-formats-bson-cbor-messagepack-ubjson-and-bjdata\" class=\"anchor\" aria-label=\"Permalink: Binary formats (BSON, CBOR, MessagePack, UBJSON, and BJData)\" href=\"#binary-formats-bson-cbor-messagepack-ubjson-and-bjdata\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThough JSON is a ubiquitous data format, it is not a very compact format suitable for data exchange, for instance over a network. Hence, the library supports \u003ca href=\"https://bsonspec.org\" rel=\"nofollow\"\u003eBSON\u003c/a\u003e (Binary JSON), \u003ca href=\"https://cbor.io\" rel=\"nofollow\"\u003eCBOR\u003c/a\u003e (Concise Binary Object Representation), \u003ca href=\"https://msgpack.org\" rel=\"nofollow\"\u003eMessagePack\u003c/a\u003e, \u003ca href=\"https://ubjson.org\" rel=\"nofollow\"\u003eUBJSON\u003c/a\u003e (Universal Binary JSON Specification) and \u003ca href=\"https://neurojson.org/bjdata\" rel=\"nofollow\"\u003eBJData\u003c/a\u003e (Binary JData) to efficiently encode JSON values to byte vectors and to decode such vectors.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// create a JSON value\njson j = R\u0026quot;({\u0026quot;compact\u0026quot;: true, \u0026quot;schema\u0026quot;: 0})\u0026quot;_json;\n\n// serialize to BSON\nstd::vector\u0026lt;std::uint8_t\u0026gt; v_bson = json::to_bson(j);\n\n// 0x1B, 0x00, 0x00, 0x00, 0x08, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0x00, 0x01, 0x10, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n\n// roundtrip\njson j_from_bson = json::from_bson(v_bson);\n\n// serialize to CBOR\nstd::vector\u0026lt;std::uint8_t\u0026gt; v_cbor = json::to_cbor(j);\n\n// 0xA2, 0x67, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0xF5, 0x66, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00\n\n// roundtrip\njson j_from_cbor = json::from_cbor(v_cbor);\n\n// serialize to MessagePack\nstd::vector\u0026lt;std::uint8_t\u0026gt; v_msgpack = json::to_msgpack(j);\n\n// 0x82, 0xA7, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0xC3, 0xA6, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00\n\n// roundtrip\njson j_from_msgpack = json::from_msgpack(v_msgpack);\n\n// serialize to UBJSON\nstd::vector\u0026lt;std::uint8_t\u0026gt; v_ubjson = json::to_ubjson(j);\n\n// 0x7B, 0x69, 0x07, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0x54, 0x69, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x69, 0x00, 0x7D\n\n// roundtrip\njson j_from_ubjson = json::from_ubjson(v_ubjson);\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e create a JSON value\u003c/span\u003e\njson j = \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003eR\"(\u003c/span\u003e{\"compact\": true, \"schema\": 0}\u003cspan class=\"pl-pds\"\u003e)\"\u003c/span\u003e\u003c/span\u003e_json;\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e serialize to BSON\u003c/span\u003e\nstd::vector\u0026lt;std::\u003cspan class=\"pl-c1\"\u003euint8_t\u003c/span\u003e\u0026gt; v_bson = json::to_bson(j);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 0x1B, 0x00, 0x00, 0x00, 0x08, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0x00, 0x01, 0x10, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e roundtrip\u003c/span\u003e\njson j_from_bson = json::from_bson(v_bson);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e serialize to CBOR\u003c/span\u003e\nstd::vector\u0026lt;std::\u003cspan class=\"pl-c1\"\u003euint8_t\u003c/span\u003e\u0026gt; v_cbor = json::to_cbor(j);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 0xA2, 0x67, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0xF5, 0x66, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e roundtrip\u003c/span\u003e\njson j_from_cbor = json::from_cbor(v_cbor);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e serialize to MessagePack\u003c/span\u003e\nstd::vector\u0026lt;std::\u003cspan class=\"pl-c1\"\u003euint8_t\u003c/span\u003e\u0026gt; v_msgpack = json::to_msgpack(j);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 0x82, 0xA7, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0xC3, 0xA6, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e roundtrip\u003c/span\u003e\njson j_from_msgpack = json::from_msgpack(v_msgpack);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e serialize to UBJSON\u003c/span\u003e\nstd::vector\u0026lt;std::\u003cspan class=\"pl-c1\"\u003euint8_t\u003c/span\u003e\u0026gt; v_ubjson = json::to_ubjson(j);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 0x7B, 0x69, 0x07, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0x54, 0x69, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x69, 0x00, 0x7D\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e roundtrip\u003c/span\u003e\njson j_from_ubjson = json::from_ubjson(v_ubjson);\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe library also supports binary types from BSON, CBOR (byte strings), and MessagePack (bin, ext, fixext). They are stored by default as \u003ccode\u003estd::vector\u0026lt;std::uint8_t\u0026gt;\u003c/code\u003e to be processed outside the library.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"// CBOR byte string with payload 0xCAFE\nstd::vector\u0026lt;std::uint8_t\u0026gt; v = {0x42, 0xCA, 0xFE};\n\n// read value\njson j = json::from_cbor(v);\n\n// the JSON value has type binary\nj.is_binary(); // true\n\n// get reference to stored binary value\nauto\u0026amp; binary = j.get_binary();\n\n// the binary value has no subtype (CBOR has no binary subtypes)\nbinary.has_subtype(); // false\n\n// access std::vector\u0026lt;std::uint8_t\u0026gt; member functions\nbinary.size(); // 2\nbinary[0]; // 0xCA\nbinary[1]; // 0xFE\n\n// set subtype to 0x10\nbinary.set_subtype(0x10);\n\n// serialize to MessagePack\nauto cbor = json::to_msgpack(j); // 0xD5 (fixext2), 0x10, 0xCA, 0xFE\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e CBOR byte string with payload 0xCAFE\u003c/span\u003e\nstd::vector\u0026lt;std::\u003cspan class=\"pl-c1\"\u003euint8_t\u003c/span\u003e\u0026gt; v = {\u003cspan class=\"pl-c1\"\u003e0x42\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e0xCA\u003c/span\u003e, \u003cspan class=\"pl-c1\"\u003e0xFE\u003c/span\u003e};\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e read value\u003c/span\u003e\njson j = json::from_cbor(v);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e the JSON value has type binary\u003c/span\u003e\nj.is_binary(); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e true\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e get reference to stored binary value\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e\u0026amp; binary = j.get_binary();\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e the binary value has no subtype (CBOR has no binary subtypes)\u003c/span\u003e\nbinary.has_subtype(); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e false\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e access std::vector\u0026lt;std::uint8_t\u0026gt; member functions\u003c/span\u003e\nbinary.size(); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 2\u003c/span\u003e\nbinary[\u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e]; \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 0xCA\u003c/span\u003e\nbinary[\u003cspan class=\"pl-c1\"\u003e1\u003c/span\u003e]; \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 0xFE\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e set subtype to 0x10\u003c/span\u003e\nbinary.set_subtype(\u003cspan class=\"pl-c1\"\u003e0x10\u003c/span\u003e);\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e serialize to MessagePack\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eauto\u003c/span\u003e cbor = json::to_msgpack(j); \u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e 0xD5 (fixext2), 0x10, 0xCA, 0xFE\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCustomers\u003c/h2\u003e\u003ca id=\"user-content-customers\" class=\"anchor\" aria-label=\"Permalink: Customers\" href=\"#customers\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe library is used in multiple projects, applications, operating systems, etc. The list below is not exhaustive, but the result of an internet search. If you know further customers of the library, please let me know, see \u003ca href=\"#contact\"\u003econtact\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://json.nlohmann.me/home/customers/\" rel=\"nofollow\"\u003e\u003cimg src=\"/nlohmann/json/raw/develop/docs/mkdocs/docs/images/customers.png\" alt=\"logos of customers using the library\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSupported compilers\u003c/h2\u003e\u003ca id=\"user-content-supported-compilers\" class=\"anchor\" aria-label=\"Permalink: Supported compilers\" href=\"#supported-compilers\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThough it's 2025 already, the support for C++11 is still a bit sparse. Currently, the following compilers are known to work:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eGCC 4.8 - 14.2 (and possibly later)\u003c/li\u003e\n\u003cli\u003eClang 3.4 - 20.0 (and possibly later)\u003c/li\u003e\n\u003cli\u003eApple Clang 9.1 - 16.0 (and possibly later)\u003c/li\u003e\n\u003cli\u003eIntel C++ Compiler 17.0.2 (and possibly later)\u003c/li\u003e\n\u003cli\u003eNvidia CUDA Compiler 11.0.221 (and possibly later)\u003c/li\u003e\n\u003cli\u003eMicrosoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later)\u003c/li\u003e\n\u003cli\u003eMicrosoft Visual C++ 2017 / Build Tools 15.5.180.51428 (and possibly later)\u003c/li\u003e\n\u003cli\u003eMicrosoft Visual C++ 2019 / Build Tools 16.3.1+1def00d3d (and possibly later)\u003c/li\u003e\n\u003cli\u003eMicrosoft Visual C++ 2022 / Build Tools 19.30.30709.0 (and possibly later)\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eI would be happy to learn about other compilers/versions.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ePlease note:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eGCC 4.8 has a bug \u003ca href=\"https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57824\" rel=\"nofollow\"\u003e57824\u003c/a\u003e: multiline raw strings cannot be the arguments to macros. Don't use multiline raw strings directly in macros with this compiler.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eAndroid defaults to using very old compilers and C++ libraries. To fix this, add the following to your \u003ccode\u003eApplication.mk\u003c/code\u003e. This will switch to the LLVM C++ library, the Clang compiler, and enable C++11 and other features disabled by default.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-makefile notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"APP_STL := c++_shared\nNDK_TOOLCHAIN_VERSION := clang3.6\nAPP_CPPFLAGS += -frtti -fexceptions\"\u003e\u003cpre\u003e\u003cspan class=\"pl-smi\"\u003eAPP_STL\u003c/span\u003e := c++_shared\n\u003cspan class=\"pl-smi\"\u003eNDK_TOOLCHAIN_VERSION\u003c/span\u003e := clang3.6\n\u003cspan class=\"pl-smi\"\u003eAPP_CPPFLAGS\u003c/span\u003e += -frtti -fexceptions\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe code compiles successfully with \u003ca href=\"https://developer.android.com/ndk/index.html?hl=ml\" rel=\"nofollow\"\u003eAndroid NDK\u003c/a\u003e, Revision 9 - 11 (and possibly later) and \u003ca href=\"https://www.crystax.net/en/android/ndk\" rel=\"nofollow\"\u003eCrystaX's Android NDK\u003c/a\u003e version 10.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eFor GCC running on MinGW or Android SDK, the error \u003ccode\u003e'to_string' is not a member of 'std'\u003c/code\u003e (or similarly, for \u003ccode\u003estrtod\u003c/code\u003e or \u003ccode\u003estrtof\u003c/code\u003e) may occur. Note this is not an issue with the code, but rather with the compiler itself. On Android, see above to build with a newer environment. For MinGW, please refer to \u003ca href=\"https://tehsausage.com/mingw-to-string\" rel=\"nofollow\"\u003ethis site\u003c/a\u003e and \u003ca href=\"https://github.com/nlohmann/json/issues/136\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/136/hovercard\"\u003ethis discussion\u003c/a\u003e for information on how to fix this bug. For Android NDK using \u003ccode\u003eAPP_STL := gnustl_static\u003c/code\u003e, please refer to \u003ca href=\"https://github.com/nlohmann/json/issues/219\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/219/hovercard\"\u003ethis discussion\u003c/a\u003e.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eUnsupported versions of GCC and Clang are rejected by \u003ccode\u003e#error\u003c/code\u003e directives. This can be switched off by defining \u003ccode\u003eJSON_SKIP_UNSUPPORTED_COMPILER_CHECK\u003c/code\u003e. Note that you can expect no support in this case.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eSee the page \u003ca href=\"https://json.nlohmann.me/community/quality_assurance\" rel=\"nofollow\"\u003equality assurance\u003c/a\u003e on the compilers used to check the library in the CI.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eIntegration\u003c/h2\u003e\u003ca id=\"user-content-integration\" class=\"anchor\" aria-label=\"Permalink: Integration\" href=\"#integration\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp\"\u003e\u003ccode\u003ejson.hpp\u003c/code\u003e\u003c/a\u003e is the single required file in \u003ccode\u003esingle_include/nlohmann\u003c/code\u003e or \u003ca href=\"https://github.com/nlohmann/json/releases\"\u003ereleased here\u003c/a\u003e. You need to add\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-c++ notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"#include \u0026lt;nlohmann/json.hpp\u0026gt;\n\n// for convenience\nusing json = nlohmann::json;\"\u003e\u003cpre\u003e#\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\u0026lt;\u003c/span\u003enlohmann/json.hpp\u003cspan class=\"pl-pds\"\u003e\u0026gt;\u003c/span\u003e\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e//\u003c/span\u003e for convenience\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eusing\u003c/span\u003e json = nlohmann::json;\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eto the files you want to process JSON and set the necessary switches to enable C++11 (e.g., \u003ccode\u003e-std=c++11\u003c/code\u003e for GCC and Clang).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eYou can further use file \u003ca href=\"https://github.com/nlohmann/json/blob/develop/include/nlohmann/json_fwd.hpp\"\u003e\u003ccode\u003einclude/nlohmann/json_fwd.hpp\u003c/code\u003e\u003c/a\u003e for forward-declarations. The installation of json_fwd.hpp (as part of cmake's install step), can be achieved by setting \u003ccode\u003e-DJSON_MultipleHeaders=ON\u003c/code\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCMake\u003c/h3\u003e\u003ca id=\"user-content-cmake\" class=\"anchor\" aria-label=\"Permalink: CMake\" href=\"#cmake\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou can also use the \u003ccode\u003enlohmann_json::nlohmann_json\u003c/code\u003e interface target in CMake. This target populates the appropriate usage requirements for \u003ccode\u003eINTERFACE_INCLUDE_DIRECTORIES\u003c/code\u003e to point to the appropriate include directories and \u003ccode\u003eINTERFACE_COMPILE_FEATURES\u003c/code\u003e for the necessary C++11 flags.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eExternal\u003c/h4\u003e\u003ca id=\"user-content-external\" class=\"anchor\" aria-label=\"Permalink: External\" href=\"#external\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo use this library from a CMake project, you can locate it directly with \u003ccode\u003efind_package()\u003c/code\u003e and use the namespaced imported target from the generated package configuration:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cmake notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# CMakeLists.txt\nfind_package(nlohmann_json 3.11.3 REQUIRED)\n...\nadd_library(foo ...)\n...\ntarget_link_libraries(foo PRIVATE nlohmann_json::nlohmann_json)\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e# CMakeLists.txt\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003efind_package\u003c/span\u003e(nlohmann_json 3.11.3 REQUIRED)\n...\n\u003cspan class=\"pl-k\"\u003eadd_library\u003c/span\u003e(foo ...)\n...\n\u003cspan class=\"pl-k\"\u003etarget_link_libraries\u003c/span\u003e(foo \u003cspan class=\"pl-e\"\u003ePRIVATE\u003c/span\u003e nlohmann_json::nlohmann_json)\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe package configuration file, \u003ccode\u003enlohmann_jsonConfig.cmake\u003c/code\u003e, can be used either from an install tree or directly out of the build tree.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eEmbedded\u003c/h4\u003e\u003ca id=\"user-content-embedded\" class=\"anchor\" aria-label=\"Permalink: Embedded\" href=\"#embedded\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo embed the library directly into an existing CMake project, place the entire source tree in a subdirectory and call \u003ccode\u003eadd_subdirectory()\u003c/code\u003e in your \u003ccode\u003eCMakeLists.txt\u003c/code\u003e file:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cmake notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# Typically you don't care so much for a third party library's tests to be\n# run from your own project's code.\nset(JSON_BuildTests OFF CACHE INTERNAL \u0026quot;\u0026quot;)\n\n# If you only include this third party in PRIVATE source files, you do not\n# need to install it when your main project gets installed.\n# set(JSON_Install OFF CACHE INTERNAL \u0026quot;\u0026quot;)\n\n# Don't use include(nlohmann_json/CMakeLists.txt) since that carries with it\n# unintended consequences that will break the build. It's generally\n# discouraged (although not necessarily well documented as such) to use\n# include(...) for pulling in other CMake projects anyways.\nadd_subdirectory(nlohmann_json)\n...\nadd_library(foo ...)\n...\ntarget_link_libraries(foo PRIVATE nlohmann_json::nlohmann_json)\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e# Typically you don't care so much for a third party library's tests to be\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e# run from your own project's code.\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eset\u003c/span\u003e(JSON_BuildTests \u003cspan class=\"pl-k\"\u003eOFF\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eCACHE\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eINTERNAL\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\"\"\u003c/span\u003e)\n\n\u003cspan class=\"pl-c\"\u003e# If you only include this third party in PRIVATE source files, you do not\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e# need to install it when your main project gets installed.\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e# set(JSON_Install OFF CACHE INTERNAL \"\")\u003c/span\u003e\n\n\u003cspan class=\"pl-c\"\u003e# Don't use include(nlohmann_json/CMakeLists.txt) since that carries with it\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e# unintended consequences that will break the build. It's generally\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e# discouraged (although not necessarily well documented as such) to use\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e# include(...) for pulling in other CMake projects anyways.\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eadd_subdirectory\u003c/span\u003e(nlohmann_json)\n...\n\u003cspan class=\"pl-k\"\u003eadd_library\u003c/span\u003e(foo ...)\n...\n\u003cspan class=\"pl-k\"\u003etarget_link_libraries\u003c/span\u003e(foo \u003cspan class=\"pl-e\"\u003ePRIVATE\u003c/span\u003e nlohmann_json::nlohmann_json)\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch5 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eEmbedded (FetchContent)\u003c/h5\u003e\u003ca id=\"user-content-embedded-fetchcontent\" class=\"anchor\" aria-label=\"Permalink: Embedded (FetchContent)\" href=\"#embedded-fetchcontent\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSince CMake v3.11,\n\u003ca href=\"https://cmake.org/cmake/help/v3.11/module/FetchContent.html\" rel=\"nofollow\"\u003eFetchContent\u003c/a\u003e can\nbe used to automatically download a release as a dependency at configure time.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eExample:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cmake notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"include(FetchContent)\n\nFetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)\nFetchContent_MakeAvailable(json)\n\ntarget_link_libraries(foo PRIVATE nlohmann_json::nlohmann_json)\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003einclude\u003c/span\u003e(FetchContent)\n\nFetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)\nFetchContent_MakeAvailable(json)\n\n\u003cspan class=\"pl-k\"\u003etarget_link_libraries\u003c/span\u003e(foo \u003cspan class=\"pl-e\"\u003ePRIVATE\u003c/span\u003e nlohmann_json::nlohmann_json)\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eNote\u003c/strong\u003e: It is recommended to use the URL approach described above which is supported as of version 3.10.0. See\n\u003ca href=\"https://json.nlohmann.me/integration/cmake/#fetchcontent\" rel=\"nofollow\"\u003ehttps://json.nlohmann.me/integration/cmake/#fetchcontent\u003c/a\u003e for more information.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch4 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSupporting Both\u003c/h4\u003e\u003ca id=\"user-content-supporting-both\" class=\"anchor\" aria-label=\"Permalink: Supporting Both\" href=\"#supporting-both\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo allow your project to support either an externally supplied or an embedded JSON library, you can use a pattern akin to the following:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-cmake notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# Top level CMakeLists.txt\nproject(FOO)\n...\noption(FOO_USE_EXTERNAL_JSON \u0026quot;Use an external JSON library\u0026quot; OFF)\n...\nadd_subdirectory(thirdparty)\n...\nadd_library(foo ...)\n...\n# Note that the namespaced target will always be available regardless of the\n# import method\ntarget_link_libraries(foo PRIVATE nlohmann_json::nlohmann_json)\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e# Top level CMakeLists.txt\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eproject\u003c/span\u003e(FOO)\n...\n\u003cspan class=\"pl-k\"\u003eoption\u003c/span\u003e(FOO_USE_EXTERNAL_JSON \u003cspan class=\"pl-s\"\u003e\"Use an external JSON library\"\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eOFF\u003c/span\u003e)\n...\n\u003cspan class=\"pl-k\"\u003eadd_subdirectory\u003c/span\u003e(thirdparty)\n...\n\u003cspan class=\"pl-k\"\u003eadd_library\u003c/span\u003e(foo ...)\n...\n\u003cspan class=\"pl-c\"\u003e# Note that the namespaced target will always be available regardless of the\u003c/span\u003e\n\u003cspan class=\"pl-c\"\u003e# import method\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003etarget_link_libraries\u003c/span\u003e(foo \u003cspan class=\"pl-e\"\u003ePRIVATE\u003c/span\u003e nlohmann_json::nlohmann_json)\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-cmake notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# thirdparty/CMakeLists.txt\n...\nif(FOO_USE_EXTERNAL_JSON)\n find_package(nlohmann_json 3.11.3 REQUIRED)\nelse()\n set(JSON_BuildTests OFF CACHE INTERNAL \u0026quot;\u0026quot;)\n add_subdirectory(nlohmann_json)\nendif()\n...\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e# thirdparty/CMakeLists.txt\u003c/span\u003e\n...\n\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e(FOO_USE_EXTERNAL_JSON)\n\u003cspan class=\"pl-k\"\u003e find_package\u003c/span\u003e(nlohmann_json 3.11.3 REQUIRED)\n\u003cspan class=\"pl-k\"\u003eelse\u003c/span\u003e()\n\u003cspan class=\"pl-k\"\u003e set\u003c/span\u003e(JSON_BuildTests \u003cspan class=\"pl-k\"\u003eOFF\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eCACHE\u003c/span\u003e \u003cspan class=\"pl-k\"\u003eINTERNAL\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\"\"\u003c/span\u003e)\n\u003cspan class=\"pl-k\"\u003e add_subdirectory\u003c/span\u003e(nlohmann_json)\n\u003cspan class=\"pl-k\"\u003eendif\u003c/span\u003e()\n...\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003ethirdparty/nlohmann_json\u003c/code\u003e is then a complete copy of this source tree.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003ePackage Managers\u003c/h3\u003e\u003ca id=\"user-content-package-managers\" class=\"anchor\" aria-label=\"Permalink: Package Managers\" href=\"#package-managers\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eUse your favorite \u003ca href=\"https://json.nlohmann.me/integration/package_managers/\" rel=\"nofollow\"\u003e\u003cstrong\u003epackage manager\u003c/strong\u003e\u003c/a\u003e to use the library.\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/homebrew.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/homebrew.svg\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#homebrew\" rel=\"nofollow\"\u003e\u003cstrong\u003eHomebrew\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann-json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/meson.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/meson.svg\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#meson\" rel=\"nofollow\"\u003e\u003cstrong\u003eMeson\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann_json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/bazel.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/bazel.svg\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#bazel\" rel=\"nofollow\"\u003e\u003cstrong\u003eBazel\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann_json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/conan.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/conan.svg\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#conan\" rel=\"nofollow\"\u003e\u003cstrong\u003eConan\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann_json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/spack.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/spack.svg\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#spack\" rel=\"nofollow\"\u003e\u003cstrong\u003eSpack\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann-json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://json.nlohmann.me/integration/package_managers/#hunter\" rel=\"nofollow\"\u003e\u003cstrong\u003eHunter\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann_json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/vcpkg.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/vcpkg.png\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#vcpkg\" rel=\"nofollow\"\u003e\u003cstrong\u003evcpkg\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann-json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://json.nlohmann.me/integration/package_managers/#cget\" rel=\"nofollow\"\u003e\u003cstrong\u003ecget\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann/json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/swift.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/swift.svg\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#swift-package-manager\" rel=\"nofollow\"\u003e\u003cstrong\u003eSwift Package Manager\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann/json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/nuget.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/nuget.svg\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#nuget\" rel=\"nofollow\"\u003e\u003cstrong\u003eNuget\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann.json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/conda.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/conda.svg\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#conda\" rel=\"nofollow\"\u003e\u003cstrong\u003eConda\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann_json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/macports.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/macports.svg\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#macports\" rel=\"nofollow\"\u003e\u003cstrong\u003eMacPorts\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann-json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/CPM.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/CPM.png\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#cpmcmake\" rel=\"nofollow\"\u003e\u003cstrong\u003ecpm.cmake\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003egh:nlohmann/json\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/xmake.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/xmake.svg\" height=\"20\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://json.nlohmann.me/integration/package_managers/#xmake\" rel=\"nofollow\"\u003e\u003cstrong\u003exmake\u003c/strong\u003e\u003c/a\u003e \u003ccode\u003enlohmann_json\u003c/code\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eThe library is part of many package managers. See the \u003ca href=\"https://json.nlohmann.me/integration/package_managers/\" rel=\"nofollow\"\u003e\u003cstrong\u003edocumentation\u003c/strong\u003e\u003c/a\u003e for detailed descriptions and examples.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003ePkg-config\u003c/h3\u003e\u003ca id=\"user-content-pkg-config\" class=\"anchor\" aria-label=\"Permalink: Pkg-config\" href=\"#pkg-config\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you are using bare Makefiles, you can use \u003ccode\u003epkg-config\u003c/code\u003e to generate the include flags that point to where the library is installed:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"pkg-config nlohmann_json --cflags\"\u003e\u003cpre\u003epkg-config nlohmann_json --cflags\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLicense\u003c/h2\u003e\u003ca id=\"user-content-license\" class=\"anchor\" aria-label=\"Permalink: License\" href=\"#license\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/3c95aefc8ac8a790cee5e2b2f113e902214bd779102fbdf70d6f9bb8c0e64f7b/68747470733a2f2f3134393735333432352e76322e707265737361626c6563646e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323030392f30362f4f5349417070726f7665645f313030583132352e706e67\"\u003e\u003cimg align=\"right\" src=\"https://camo.githubusercontent.com/3c95aefc8ac8a790cee5e2b2f113e902214bd779102fbdf70d6f9bb8c0e64f7b/68747470733a2f2f3134393735333432352e76322e707265737361626c6563646e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323030392f30362f4f5349417070726f7665645f313030583132352e706e67\" alt=\"OSI approved license\" data-canonical-src=\"https://149753425.v2.pressablecdn.com/wp-content/uploads/2009/06/OSIApproved_100X125.png\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe class is licensed under the \u003ca href=\"https://opensource.org/licenses/MIT\" rel=\"nofollow\"\u003eMIT License\u003c/a\u003e:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eCopyright © 2013-2025 \u003ca href=\"https://nlohmann.me\" rel=\"nofollow\"\u003eNiels Lohmann\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ePermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\u003c/p\u003e\n\u003chr\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eThe class contains the UTF-8 Decoder from Bjoern Hoehrmann which is licensed under the \u003ca href=\"https://opensource.org/licenses/MIT\" rel=\"nofollow\"\u003eMIT License\u003c/a\u003e (see above). Copyright © 2008-2009 \u003ca href=\"https://bjoern.hoehrmann.de/\" rel=\"nofollow\"\u003eBjörn Hoehrmann\u003c/a\u003e \u003ca href=\"mailto:bjoern@hoehrmann.de\"\u003ebjoern@hoehrmann.de\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003eThe class contains a slightly modified version of the Grisu2 algorithm from Florian Loitsch which is licensed under the \u003ca href=\"https://opensource.org/licenses/MIT\" rel=\"nofollow\"\u003eMIT License\u003c/a\u003e (see above). Copyright © 2009 \u003ca href=\"https://florian.loitsch.com/\" rel=\"nofollow\"\u003eFlorian Loitsch\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003eThe class contains a copy of \u003ca href=\"https://nemequ.github.io/hedley/\" rel=\"nofollow\"\u003eHedley\u003c/a\u003e from Evan Nemerson which is licensed as \u003ca href=\"https://creativecommons.org/publicdomain/zero/1.0/\" rel=\"nofollow\"\u003eCC0-1.0\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003eThe class contains parts of \u003ca href=\"https://github.com/abseil/abseil-cpp\"\u003eGoogle Abseil\u003c/a\u003e which is licensed under the \u003ca href=\"https://opensource.org/licenses/Apache-2.0\" rel=\"nofollow\"\u003eApache 2.0 License\u003c/a\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/0322a6e969eb058bb34792e6868b94aaf2899130ced4238aa7f4e545f0222d64/68747470733a2f2f6769742e667366652e6f72672f72657573652f72657573652d63692f7261772f6272616e63682f6d61737465722f72657573652d686f72697a6f6e74616c2e706e67\"\u003e\u003cimg align=\"right\" src=\"https://camo.githubusercontent.com/0322a6e969eb058bb34792e6868b94aaf2899130ced4238aa7f4e545f0222d64/68747470733a2f2f6769742e667366652e6f72672f72657573652f72657573652d63692f7261772f6272616e63682f6d61737465722f72657573652d686f72697a6f6e74616c2e706e67\" alt=\"REUSE Software\" data-canonical-src=\"https://git.fsfe.org/reuse/reuse-ci/raw/branch/master/reuse-horizontal.png\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe library is compliant to version 3.3 of the \u003ca href=\"https://reuse.software\" rel=\"nofollow\"\u003e\u003cstrong\u003eREUSE specification\u003c/strong\u003e\u003c/a\u003e:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eEvery source file contains an SPDX copyright header.\u003c/li\u003e\n\u003cli\u003eThe full text of all licenses used in the repository can be found in the \u003ccode\u003eLICENSES\u003c/code\u003e folder.\u003c/li\u003e\n\u003cli\u003eFile \u003ccode\u003e.reuse/dep5\u003c/code\u003e contains an overview of all files' copyrights and licenses.\u003c/li\u003e\n\u003cli\u003eRun \u003ccode\u003epipx run reuse lint\u003c/code\u003e to verify the project's REUSE compliance and \u003ccode\u003epipx run reuse spdx\u003c/code\u003e to generate a SPDX SBOM.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eContact\u003c/h2\u003e\u003ca id=\"user-content-contact\" class=\"anchor\" aria-label=\"Permalink: Contact\" href=\"#contact\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf you have questions regarding the library, I would like to invite you to \u003ca href=\"https://github.com/nlohmann/json/issues/new/choose\"\u003eopen an issue at GitHub\u003c/a\u003e. Please describe your request, problem, or question as detailed as possible, and also mention the version of the library you are using as well as the version of your compiler and operating system. Opening an issue at GitHub allows other users and contributors to this library to collaborate. For instance, I have little experience with MSVC, and most issues in this regard have been solved by a growing community. If you have a look at the \u003ca href=\"https://github.com/nlohmann/json/issues?q=is%3Aissue+is%3Aclosed\"\u003eclosed issues\u003c/a\u003e, you will see that we react quite timely in most cases.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eOnly if your request would contain confidential information, please \u003ca href=\"mailto:mail@nlohmann.me\"\u003esend me an email\u003c/a\u003e. For encrypted messages, please use \u003ca href=\"https://keybase.io/nlohmann/pgp_keys.asc\" rel=\"nofollow\"\u003ethis key\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSecurity\u003c/h2\u003e\u003ca id=\"user-content-security\" class=\"anchor\" aria-label=\"Permalink: Security\" href=\"#security\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://github.com/nlohmann/json/commits\"\u003eCommits by Niels Lohmann\u003c/a\u003e and \u003ca href=\"https://github.com/nlohmann/json/releases\"\u003ereleases\u003c/a\u003e are signed with this \u003ca href=\"https://keybase.io/nlohmann/pgp_keys.asc?fingerprint=797167ae41c0a6d9232e48457f3cea63ae251b69\" rel=\"nofollow\"\u003ePGP Key\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eThanks\u003c/h2\u003e\u003ca id=\"user-content-thanks\" class=\"anchor\" aria-label=\"Permalink: Thanks\" href=\"#thanks\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eI deeply appreciate the help of the following people.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://raw.githubusercontent.com/nlohmann/json/develop/docs/avatars.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/nlohmann/json/develop/docs/avatars.png\" align=\"right\" alt=\"GitHub avatars of the contributors\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Teemperor\"\u003eTeemperor\u003c/a\u003e implemented CMake support and lcov integration, realized escape and Unicode handling in the string parser, and fixed the JSON serialization.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/elliotgoodrich\"\u003eelliotgoodrich\u003c/a\u003e fixed an issue with double deletion in the iterator classes.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/kirkshoop\"\u003ekirkshoop\u003c/a\u003e made the iterators of the class composable to other libraries.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/wanwc\"\u003ewancw\u003c/a\u003e fixed a bug that hindered the class to compile with Clang.\u003c/li\u003e\n\u003cli\u003eTomas Åblad found a bug in the iterator implementation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jrandall\"\u003eJoshua C. Randall\u003c/a\u003e fixed a bug in the floating-point serialization.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/aburgh\"\u003eAaron Burghardt\u003c/a\u003e implemented code to parse streams incrementally. Furthermore, he greatly improved the parser class by allowing the definition of a filter function to discard undesired elements while parsing.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dkopecek\"\u003eDaniel Kopeček\u003c/a\u003e fixed a bug in the compilation with GCC 5.0.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Florianjw\"\u003eFlorian Weber\u003c/a\u003e fixed a bug in and improved the performance of the comparison operators.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/EricMCornelius\"\u003eEric Cornelius\u003c/a\u003e pointed out a bug in the handling with NaN and infinity values. He also improved the performance of the string escaping.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/likebeta\"\u003e易思龙\u003c/a\u003e implemented a conversion from anonymous enums.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/kepkin\"\u003ekepkin\u003c/a\u003e patiently pushed forward the support for Microsoft Visual studio.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gregmarr\"\u003egregmarr\u003c/a\u003e simplified the implementation of reverse iterators and helped with numerous hints and improvements. In particular, he pushed forward the implementation of user-defined types.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/caiovlp\"\u003eCaio Luppi\u003c/a\u003e fixed a bug in the Unicode handling.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dariomt\"\u003edariomt\u003c/a\u003e fixed some typos in the examples.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/d-frey\"\u003eDaniel Frey\u003c/a\u003e cleaned up some pointers and implemented exception-safe memory allocation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ColinH\"\u003eColin Hirsch\u003c/a\u003e took care of a small namespace issue.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/whoshuu\"\u003eHuu Nguyen\u003c/a\u003e correct a variable name in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/silverweed\"\u003eSilverweed\u003c/a\u003e overloaded \u003ccode\u003eparse()\u003c/code\u003e to accept an rvalue reference.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dariomt\"\u003edariomt\u003c/a\u003e fixed a subtlety in MSVC type support and implemented the \u003ccode\u003eget_ref()\u003c/code\u003e function to get a reference to stored values.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ZahlGraf\"\u003eZahlGraf\u003c/a\u003e added a workaround that allows compilation using Android NDK.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/whackashoe\"\u003ewhackashoe\u003c/a\u003e replaced a function that was marked as unsafe by Visual Studio.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/406345\"\u003e406345\u003c/a\u003e fixed two small warnings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/glenfe\"\u003eGlen Fernandes\u003c/a\u003e noted a potential portability problem in the \u003ccode\u003ehas_mapped_type\u003c/code\u003e function.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/nibroc\"\u003eCorbin Hughes\u003c/a\u003e fixed some typos in the contribution guidelines.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/twelsby\"\u003etwelsby\u003c/a\u003e fixed the array subscript operator, an issue that failed the MSVC build, and floating-point parsing/dumping. He further added support for unsigned integer numbers and implemented better roundtrip support for parsed numbers.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/vog\"\u003eVolker Diels-Grabsch\u003c/a\u003e fixed a link in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/msm-\"\u003emsm-\u003c/a\u003e added support for American Fuzzy Lop.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Annihil\"\u003eAnnihil\u003c/a\u003e fixed an example in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Themercee\"\u003eThemercee\u003c/a\u003e noted a wrong URL in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/lv-zheng\"\u003eLv Zheng\u003c/a\u003e fixed a namespace issue with \u003ccode\u003eint64_t\u003c/code\u003e and \u003ccode\u003euint64_t\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/abc100m\"\u003eabc100m\u003c/a\u003e analyzed the issues with GCC 4.8 and proposed a \u003ca href=\"https://github.com/nlohmann/json/pull/212\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"/nlohmann/json/pull/212/hovercard\"\u003epartial solution\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/zewt\"\u003ezewt\u003c/a\u003e added useful notes to the README file about Android.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/robertmrk\"\u003eRóbert Márki\u003c/a\u003e added a fix to use move iterators and improved the integration via CMake.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ChrisKitching\"\u003eChris Kitching\u003c/a\u003e cleaned up the CMake files.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/06needhamt\"\u003eTom Needham\u003c/a\u003e fixed a subtle bug with MSVC 2015 which was also proposed by \u003ca href=\"https://github.com/Epidal\"\u003eMichael K.\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/thelostt\"\u003eMário Feroldi\u003c/a\u003e fixed a small typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/duncanwerner\"\u003eduncanwerner\u003c/a\u003e found a really embarrassing performance regression in the 2.0.0 release.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dtoma\"\u003eDamien\u003c/a\u003e fixed one of the last conversion warnings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/t-b\"\u003eThomas Braun\u003c/a\u003e fixed a warning in a test case and adjusted MSVC calls in the CI.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/theodelrieu\"\u003eThéo DELRIEU\u003c/a\u003e patiently and constructively oversaw the long way toward \u003ca href=\"https://github.com/nlohmann/json/issues/290\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/290/hovercard\"\u003eiterator-range parsing\u003c/a\u003e. He also implemented the magic behind the serialization/deserialization of user-defined types and split the single header file into smaller chunks.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/5tefan\"\u003eStefan\u003c/a\u003e fixed a minor issue in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/vasild\"\u003eVasil Dimov\u003c/a\u003e fixed the documentation regarding conversions from \u003ccode\u003estd::multiset\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ChristophJud\"\u003eChristophJud\u003c/a\u003e overworked the CMake files to ease project inclusion.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/vpetrigo\"\u003eVladimir Petrigo\u003c/a\u003e made a SFINAE hack more readable and added Visual Studio 17 to the build matrix.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/seeekr\"\u003eDenis Andrejew\u003c/a\u003e fixed a grammar issue in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/palacaze\"\u003ePierre-Antoine Lacaze\u003c/a\u003e found a subtle bug in the \u003ccode\u003edump()\u003c/code\u003e function.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/TurpentineDistillery\"\u003eTurpentineDistillery\u003c/a\u003e pointed to \u003ca href=\"https://en.cppreference.com/w/cpp/locale/locale/classic\" rel=\"nofollow\"\u003e\u003ccode\u003estd::locale::classic()\u003c/code\u003e\u003c/a\u003e to avoid too much locale joggling, found some nice performance improvements in the parser, improved the benchmarking code, and realized locale-independent number parsing and printing.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/cgzones\"\u003ecgzones\u003c/a\u003e had an idea how to fix the Coverity scan.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jaredgrubb\"\u003eJared Grubb\u003c/a\u003e silenced a nasty documentation warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/qwename\"\u003eYixin Zhang\u003c/a\u003e fixed an integer overflow check.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Bosswestfalen\"\u003eBosswestfalen\u003c/a\u003e merged two iterator classes into a smaller one.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Daniel599\"\u003eDaniel599\u003c/a\u003e helped to get Travis execute the tests with Clang's sanitizers.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/vjon\"\u003eJonathan Lee\u003c/a\u003e fixed an example in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gnzlbg\"\u003egnzlbg\u003c/a\u003e supported the implementation of user-defined types.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/qis\"\u003eAlexej Harm\u003c/a\u003e helped to get the user-defined types working with Visual Studio.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jaredgrubb\"\u003eJared Grubb\u003c/a\u003e supported the implementation of user-defined types.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/EnricoBilla\"\u003eEnricoBilla\u003c/a\u003e noted a typo in an example.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/horenmar\"\u003eMartin Hořeňovský\u003c/a\u003e found a way for a 2x speedup for the compilation time of the test suite.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ukhegg\"\u003eukhegg\u003c/a\u003e found proposed an improvement for the examples section.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/rswanson-ihi\"\u003erswanson-ihi\u003c/a\u003e noted a typo in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/stanmihai4\"\u003eMihai Stan\u003c/a\u003e fixed a bug in the comparison with \u003ccode\u003enullptr\u003c/code\u003es.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/tusharpm\"\u003eTushar Maheshwari\u003c/a\u003e added \u003ca href=\"https://github.com/sakra/cotire\"\u003ecotire\u003c/a\u003e support to speed up the compilation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/TedLyngmo\"\u003eTedLyngmo\u003c/a\u003e noted a typo in the README, removed unnecessary bit arithmetic, and fixed some \u003ccode\u003e-Weffc++\u003c/code\u003e warnings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/krzysztofwos\"\u003eKrzysztof Woś\u003c/a\u003e made exceptions more visible.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ftillier\"\u003eftillier\u003c/a\u003e fixed a compiler warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/tinloaf\"\u003etinloaf\u003c/a\u003e made sure all pushed warnings are properly popped.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Fytch\"\u003eFytch\u003c/a\u003e found a bug in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Type1J\"\u003eJay Sistar\u003c/a\u003e implemented a Meson build description.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/HenryRLee\"\u003eHenry Lee\u003c/a\u003e fixed a warning in ICC and improved the iterator implementation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/vthiery\"\u003eVincent Thiery\u003c/a\u003e maintains a package for the Conan package manager.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/koemeet\"\u003eSteffen\u003c/a\u003e fixed a potential issue with MSVC and \u003ccode\u003estd::min\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Chocobo1\"\u003eMike Tzou\u003c/a\u003e fixed some typos.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/amrcode\"\u003eamrcode\u003c/a\u003e noted a misleading documentation about comparison of floats.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/olegendo\"\u003eOleg Endo\u003c/a\u003e reduced the memory consumption by replacing \u003ccode\u003e\u0026lt;iostream\u0026gt;\u003c/code\u003e with \u003ccode\u003e\u0026lt;iosfwd\u0026gt;\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dan-42\"\u003edan-42\u003c/a\u003e cleaned up the CMake files to simplify including/reusing of the library.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/himikof\"\u003eNikita Ofitserov\u003c/a\u003e allowed for moving values from initializer lists.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/wincent\"\u003eGreg Hurrell\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/DmitryKuk\"\u003eDmitry Kukovinets\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/kbthomp1\"\u003ekbthomp1\u003c/a\u003e fixed an issue related to the Intel OSX compiler.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/daixtrose\"\u003eMarkus Werle\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/WebProdPP\"\u003eWebProdPP\u003c/a\u003e fixed a subtle error in a precondition check.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/leha-bot\"\u003eAlex\u003c/a\u003e noted an error in a code sample.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/tdegeus\"\u003eTom de Geus\u003c/a\u003e reported some warnings with ICC and helped to fix them.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/pjkundert\"\u003ePerry Kundert\u003c/a\u003e simplified reading from input streams.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/sonulohani\"\u003eSonu Lohani\u003c/a\u003e fixed a small compilation error.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jseward\"\u003eJamie Seward\u003c/a\u003e fixed all MSVC warnings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/eld00d\"\u003eNate Vargas\u003c/a\u003e added a Doxygen tag file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/pvleuven\"\u003epvleuven\u003c/a\u003e helped to fix a warning in ICC.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/crea7or\"\u003ePavel\u003c/a\u003e helped to fix some warnings in MSVC.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jseward\"\u003eJamie Seward\u003c/a\u003e avoided unnecessary string copies in \u003ccode\u003efind()\u003c/code\u003e and \u003ccode\u003ecount()\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Itja\"\u003eMitja\u003c/a\u003e fixed some typos.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jowr\"\u003eJorrit Wronski\u003c/a\u003e updated the Hunter package links.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/TinyTinni\"\u003eMatthias Möller\u003c/a\u003e added a \u003ccode\u003e.natvis\u003c/code\u003e for the MSVC debug view.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/bogemic\"\u003ebogemic\u003c/a\u003e fixed some C++17 deprecation warnings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/erengy\"\u003eEren Okka\u003c/a\u003e fixed some MSVC warnings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/abolz\"\u003eabolz\u003c/a\u003e integrated the Grisu2 algorithm for proper floating-point formatting, allowing more roundtrip checks to succeed.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Pipeliner\"\u003eVadim Evard\u003c/a\u003e fixed a Markdown issue in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/zerodefect\"\u003ezerodefect\u003c/a\u003e fixed a compiler warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/kaidokert\"\u003eKert\u003c/a\u003e allowed to template the string type in the serialization and added the possibility to override the exceptional behavior.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/mark-99\"\u003emark-99\u003c/a\u003e helped fixing an ICC error.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/patrikhuber\"\u003ePatrik Huber\u003c/a\u003e fixed links in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/johnfb\"\u003ejohnfb\u003c/a\u003e found a bug in the implementation of CBOR's indefinite length strings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/pfultz2\"\u003ePaul Fultz II\u003c/a\u003e added a note on the cget package manager.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/wla80\"\u003eWilson Lin\u003c/a\u003e made the integration section of the README more concise.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ralfbielig\"\u003eRalfBielig\u003c/a\u003e detected and fixed a memory leak in the parser callback.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/agrianius\"\u003eagrianius\u003c/a\u003e allowed to dump JSON to an alternative string type.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ktonon\"\u003eKevin Tonon\u003c/a\u003e overworked the C++11 compiler checks in CMake.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ax3l\"\u003eAxel Huebl\u003c/a\u003e simplified a CMake check and added support for the \u003ca href=\"https://spack.io\" rel=\"nofollow\"\u003eSpack package manager\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/coryan\"\u003eCarlos O'Ryan\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jammehcow\"\u003eJames Upjohn\u003c/a\u003e fixed a version number in the compilers section.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/chuckatkins\"\u003eChuck Atkins\u003c/a\u003e adjusted the CMake files to the CMake packaging guidelines and provided documentation for the CMake integration.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dns13\"\u003eJan Schöppach\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/martin-mfg\"\u003emartin-mfg\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/TinyTinni\"\u003eMatthias Möller\u003c/a\u003e removed the dependency from \u003ccode\u003estd::stringstream\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/agrianius\"\u003eagrianius\u003c/a\u003e added code to use alternative string implementations.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Daniel599\"\u003eDaniel599\u003c/a\u003e allowed to use more algorithms with the \u003ccode\u003eitems()\u003c/code\u003e function.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jrakow\"\u003eJulius Rakow\u003c/a\u003e fixed the Meson include directory and fixed the links to \u003ca href=\"https://cppreference.com\" rel=\"nofollow\"\u003ecppreference.com\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/sonulohani\"\u003eSonu Lohani\u003c/a\u003e fixed the compilation with MSVC 2015 in debug mode.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/grembo\"\u003egrembo\u003c/a\u003e fixed the test suite and re-enabled several test cases.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/simnalamburt\"\u003eHyeon Kim\u003c/a\u003e introduced the macro \u003ccode\u003eJSON_INTERNAL_CATCH\u003c/code\u003e to control the exception handling inside the library.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/thyu\"\u003ethyu\u003c/a\u003e fixed a compiler warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/LEgregius\"\u003eDavid Guthrie\u003c/a\u003e fixed a subtle compilation error with Clang 3.4.2.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dennisfischer\"\u003eDennis Fischer\u003c/a\u003e allowed to call \u003ccode\u003efind_package\u003c/code\u003e without installing the library.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/simnalamburt\"\u003eHyeon Kim\u003c/a\u003e fixed an issue with a double macro definition.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/rivertam\"\u003eBen Berman\u003c/a\u003e made some error messages more understandable.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/zakalibit\"\u003ezakalibit\u003c/a\u003e fixed a compilation problem with the Intel C++ compiler.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/mandreyel\"\u003emandreyel\u003c/a\u003e fixed a compilation problem.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/koponomarenko\"\u003eKostiantyn Ponomarenko\u003c/a\u003e added version and license information to the Meson build file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/henryiii\"\u003eHenry Schreiner\u003c/a\u003e added support for GCC 4.8.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/knilch0r\"\u003eknilch\u003c/a\u003e made sure the test suite does not stall when run in the wrong directory.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/antonioborondo\"\u003eAntonio Borondo\u003c/a\u003e fixed an MSVC 2017 warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dgendreau\"\u003eDan Gendreau\u003c/a\u003e implemented the \u003ccode\u003eNLOHMANN_JSON_SERIALIZE_ENUM\u003c/code\u003e macro to quickly define an enum/JSON mapping.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/efp\"\u003eefp\u003c/a\u003e added line and column information to parse errors.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/julian-becker\"\u003ejulian-becker\u003c/a\u003e added BSON support.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/pratikpc\"\u003ePratik Chowdhury\u003c/a\u003e added support for structured bindings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/davedissian\"\u003eDavid Avedissian\u003c/a\u003e added support for Clang 5.0.1 (PS4 version).\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dumarjo\"\u003eJonathan Dumaresq\u003c/a\u003e implemented an input adapter to read from \u003ccode\u003eFILE*\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/kjpus\"\u003ekjpus\u003c/a\u003e fixed a link in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/manu-chroma\"\u003eManvendra Singh\u003c/a\u003e fixed a typo in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ziggurat29\"\u003eziggurat29\u003c/a\u003e fixed an MSVC warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/SylvainCorlay\"\u003eSylvain Corlay\u003c/a\u003e added code to avoid an issue with MSVC.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/mefyl\"\u003emefyl\u003c/a\u003e fixed a bug when JSON was parsed from an input stream.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/mpoquet\"\u003eMillian Poquet\u003c/a\u003e allowed to install the library via Meson.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/moodboom\"\u003eMichael Behrns-Miller\u003c/a\u003e found an issue with a missing namespace.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/naszta\"\u003eNasztanovics Ferenc\u003c/a\u003e fixed a compilation issue with libc 2.12.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/andreas-schwab\"\u003eAndreas Schwab\u003c/a\u003e fixed the endian conversion.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Mark-Dunning\"\u003eMark-Dunning\u003c/a\u003e fixed a warning in MSVC.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/garethsb-sony\"\u003eGareth Sylvester-Bradley\u003c/a\u003e added \u003ccode\u003eoperator/\u003c/code\u003e for JSON Pointers.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/johnmarkwayve\"\u003eJohn-Mark\u003c/a\u003e noted a missing header.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/xvitaly\"\u003eVitaly Zaitsev\u003c/a\u003e fixed compilation with GCC 9.0.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/stac47\"\u003eLaurent Stacul\u003c/a\u003e fixed compilation with GCC 9.0.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/iwanders\"\u003eIvor Wanders\u003c/a\u003e helped to reduce the CMake requirement to version 3.1.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/njlr\"\u003enjlr\u003c/a\u003e updated the Buckaroo instructions.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/lieff\"\u003eLion\u003c/a\u003e fixed a compilation issue with GCC 7 on CentOS.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/nickaein\"\u003eIsaac Nickaein\u003c/a\u003e improved the integer serialization performance and implemented the \u003ccode\u003econtains()\u003c/code\u003e function.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/past-due\"\u003epast-due\u003c/a\u003e suppressed an unfixable warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/elvisoric\"\u003eElvis Oric\u003c/a\u003e improved Meson support.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Afforix\"\u003eMatěj Plch\u003c/a\u003e fixed an example in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/wythe\"\u003eMark Beckwith\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/scinart\"\u003escinart\u003c/a\u003e fixed bug in the serializer.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/pboettch\"\u003ePatrick Boettcher\u003c/a\u003e implemented \u003ccode\u003epush_back()\u003c/code\u003e and \u003ccode\u003epop_back()\u003c/code\u003e for JSON Pointers.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/nicoddemus\"\u003eBruno Oliveira\u003c/a\u003e added support for Conda.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/skypjack\"\u003eMichele Caini\u003c/a\u003e fixed links in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/hnkb\"\u003eHani\u003c/a\u003e documented how to install the library with NuGet.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/wythe\"\u003eMark Beckwith\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/yann-morin-1998\"\u003eyann-morin-1998\u003c/a\u003e helped to reduce the CMake requirement to version 3.1.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/podsvirov\"\u003eKonstantin Podsvirov\u003c/a\u003e maintains a package for the MSYS2 software distro.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/remyabel\"\u003eremyabel\u003c/a\u003e added GNUInstallDirs to the CMake files.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/taylorhoward92\"\u003eTaylor Howard\u003c/a\u003e fixed a unit test.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Macr0Nerd\"\u003eGabe Ron\u003c/a\u003e implemented the \u003ccode\u003eto_string\u003c/code\u003e method.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/heavywatal\"\u003eWatal M. Iwasaki\u003c/a\u003e fixed a Clang warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/onqtam\"\u003eViktor Kirilov\u003c/a\u003e switched the unit tests from \u003ca href=\"https://github.com/philsquared/Catch\"\u003eCatch\u003c/a\u003e to \u003ca href=\"https://github.com/onqtam/doctest\"\u003edoctest\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ejcjason\"\u003eJuncheng E\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/tete17\"\u003etete17\u003c/a\u003e fixed a bug in the \u003ccode\u003econtains\u003c/code\u003e function.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Xav83\"\u003eXav83\u003c/a\u003e fixed some cppcheck warnings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/0xflotus\"\u003e0xflotus\u003c/a\u003e fixed some typos.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/chris0x44\"\u003eChristian Deneke\u003c/a\u003e added a const version of \u003ccode\u003ejson_pointer::back\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/crazyjul\"\u003eJulien Hamaide\u003c/a\u003e made the \u003ccode\u003eitems()\u003c/code\u003e function work with custom string types.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/nemequ\"\u003eEvan Nemerson\u003c/a\u003e updated fixed a bug in Hedley and updated this library accordingly.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/flopp\"\u003eFlorian Pigorsch\u003c/a\u003e fixed a lot of typos.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/cbegue\"\u003eCamille Bégué\u003c/a\u003e fixed an issue in the conversion from \u003ccode\u003estd::pair\u003c/code\u003e and \u003ccode\u003estd::tuple\u003c/code\u003e to \u003ccode\u003ejson\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/AnthonyVH\"\u003eAnthony VH\u003c/a\u003e fixed a compile error in an enum deserialization.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ua-code-dragon\"\u003eYuriy Vountesmery\u003c/a\u003e noted a subtle bug in a preprocessor check.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dota17\"\u003eChen\u003c/a\u003e fixed numerous issues in the library.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/aokellermann\"\u003eAntony Kellermann\u003c/a\u003e added a CI step for GCC 10.1.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gistrec\"\u003eAlex\u003c/a\u003e fixed an MSVC warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/rvjr\"\u003eRainer\u003c/a\u003e proposed an improvement in the floating-point serialization in CBOR.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/FrancoisChabot\"\u003eFrancois Chabot\u003c/a\u003e made performance improvements in the input adapters.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ArthurSonzogni\"\u003eArthur Sonzogni\u003c/a\u003e documented how the library can be included via \u003ccode\u003eFetchContent\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/rmisev\"\u003eRimas Misevičius\u003c/a\u003e fixed an error message.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/alexandermyasnikov\"\u003eAlexander Myasnikov\u003c/a\u003e fixed some examples and a link in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/uhoreg\"\u003eHubert Chathi\u003c/a\u003e made CMake's version config file architecture-independent.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/OmnipotentEntity\"\u003eOmnipotentEntity\u003c/a\u003e implemented the binary values for CBOR, MessagePack, BSON, and UBJSON.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ArtemSarmini\"\u003eArtemSarmini\u003c/a\u003e fixed a compilation issue with GCC 10 and fixed a leak.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/sea-kg\"\u003eEvgenii Sopov\u003c/a\u003e integrated the library to the wsjcpp package manager.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/linev\"\u003eSergey Linev\u003c/a\u003e fixed a compiler warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/magamig\"\u003eMiguel Magalhães\u003c/a\u003e fixed the year in the copyright.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/garethsb-sony\"\u003eGareth Sylvester-Bradley\u003c/a\u003e fixed a compilation issue with MSVC.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/alex-weej\"\u003eAlexander “weej” Jones\u003c/a\u003e fixed an example in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Coeur\"\u003eAntoine Cœur\u003c/a\u003e fixed some typos in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jothepro\"\u003ejothepro\u003c/a\u003e updated links to the Hunter package.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/kastiglione\"\u003eDave Lee\u003c/a\u003e fixed link in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Klaim\"\u003eJoël Lamotte\u003c/a\u003e added instruction for using Build2's package manager.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/pauljurczak\"\u003ePaul Jurczak\u003c/a\u003e fixed an example in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/sonulohani\"\u003eSonu Lohani\u003c/a\u003e fixed a warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gocarlos\"\u003eCarlos Gomes Martinho\u003c/a\u003e updated the Conan package source.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/podsvirov\"\u003eKonstantin Podsvirov\u003c/a\u003e fixed the MSYS2 package documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Tridacnid\"\u003eTridacnid\u003c/a\u003e improved the CMake tests.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/MBalszun\"\u003eMichael\u003c/a\u003e fixed MSVC warnings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/quentin-dev\"\u003eQuentin Barbarat\u003c/a\u003e fixed an example in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/XyFreak\"\u003eXyFreak\u003c/a\u003e fixed a compiler warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/TotalCaesar659\"\u003eTotalCaesar659\u003c/a\u003e fixed links in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/tanuj208\"\u003eTanuj Garg\u003c/a\u003e improved the fuzzer coverage for UBSAN input.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/AODQ\"\u003eAODQ\u003c/a\u003e fixed a compiler warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jwittbrodt\"\u003ejwittbrodt\u003c/a\u003e made \u003ccode\u003eNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE\u003c/code\u003e inline.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/pfeatherstone\"\u003epfeatherstone\u003c/a\u003e improved the upper bound of arguments of the \u003ccode\u003eNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE\u003c/code\u003e/\u003ccode\u003eNLOHMANN_DEFINE_TYPE_INTRUSIVE\u003c/code\u003e macros.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jprochazk\"\u003eJan Procházka\u003c/a\u003e fixed a bug in the CBOR parser for binary and string values.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/T0b1-iOS\"\u003eT0b1-iOS\u003c/a\u003e fixed a bug in the new hash implementation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/matthewbauer\"\u003eMatthew Bauer\u003c/a\u003e adjusted the CBOR writer to create tags for binary subtypes.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gatopeich\"\u003egatopeich\u003c/a\u003e implemented an ordered map container for \u003ccode\u003enlohmann::ordered_json\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ericonr\"\u003eÉrico Nogueira Rolim\u003c/a\u003e added support for pkg-config.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/KonanM\"\u003eKonanM\u003c/a\u003e proposed an implementation for the \u003ccode\u003eNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE\u003c/code\u003e/\u003ccode\u003eNLOHMANN_DEFINE_TYPE_INTRUSIVE\u003c/code\u003e macros.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gracicot\"\u003eGuillaume Racicot\u003c/a\u003e implemented \u003ccode\u003estring_view\u003c/code\u003e support and allowed C++20 support.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/alexreinking\"\u003eAlex Reinking\u003c/a\u003e improved CMake support for \u003ccode\u003eFetchContent\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ssbssa\"\u003eHannes Domani\u003c/a\u003e provided a GDB pretty printer.\u003c/li\u003e\n\u003cli\u003eLars Wirzenius reviewed the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ongjunjie\"\u003eJun Jie\u003c/a\u003e fixed a compiler path in the CMake scripts.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/rbuch\"\u003eRonak Buch\u003c/a\u003e fixed typos in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/karzhenkov\"\u003eAlexander Karzhenkov\u003c/a\u003e fixed a move constructor and the Travis builds.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/leozz37\"\u003eLeonardo Lima\u003c/a\u003e added CPM.Cmake support.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jbzdarkid\"\u003eJoseph Blackman\u003c/a\u003e fixed a warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/YarikTH\"\u003eYaroslav\u003c/a\u003e updated doctest and implemented unit tests.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/globberwops\"\u003eMartin Stump\u003c/a\u003e fixed a bug in the CMake files.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jasujm\"\u003eJaakko Moisio\u003c/a\u003e fixed a bug in the input adapters.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/bl-ue\"\u003ebl-ue\u003c/a\u003e fixed some Markdown issues in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/wawiesel\"\u003eWilliam A. Wieselquist\u003c/a\u003e fixed an example from the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/abbaswasim\"\u003eabbaswasim\u003c/a\u003e fixed an example from the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/remyjette\"\u003eRemy Jette\u003c/a\u003e fixed a warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/frasermarlow\"\u003eFraser\u003c/a\u003e fixed the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/musicinmybrain\"\u003eBen Beasley\u003c/a\u003e updated doctest.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/doronbehar\"\u003eDoron Behar\u003c/a\u003e fixed pkg-config.pc.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/raduteo\"\u003eraduteo\u003c/a\u003e fixed a warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/theShmoo\"\u003eDavid Pfahler\u003c/a\u003e added the possibility to compile the library without I/O support.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/mortenfyhn\"\u003eMorten Fyhn Amundsen\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jpl-mac\"\u003ejpl-mac\u003c/a\u003e allowed to treat the library as a system header in CMake.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jasmcaus\"\u003eJason Dsouza\u003c/a\u003e fixed the indentation of the CMake file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/offa\"\u003eoffa\u003c/a\u003e added a link to Conan Center to the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/TotalCaesar659\"\u003eTotalCaesar659\u003c/a\u003e updated the links in the documentation to use HTTPS.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/grafail\"\u003eRafail Giavrimis\u003c/a\u003e fixed the Google Benchmark default branch.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ldionne\"\u003eLouis Dionne\u003c/a\u003e fixed a conversion operator.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/justanotheranonymoususer\"\u003ejustanotheranonymoususer\u003c/a\u003e made the examples in the README more consistent.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Finkman\"\u003eFinkman\u003c/a\u003e suppressed some \u003ccode\u003e-Wfloat-equal\u003c/code\u003e warnings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/fhuberts\"\u003eFerry Huberts\u003c/a\u003e fixed \u003ccode\u003e-Wswitch-enum\u003c/code\u003e warnings.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/senyai\"\u003eArseniy Terekhin\u003c/a\u003e made the GDB pretty-printer robust against unset variable names.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/amirmasoudabdol\"\u003eAmir Masoud Abdol\u003c/a\u003e updated the Homebrew command as nlohmann/json is now in homebrew-core.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Hallot\"\u003eHallot\u003c/a\u003e fixed some \u003ccode\u003e-Wextra-semi-stmt warnings\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gcerretani\"\u003eGiovanni Cerretani\u003c/a\u003e fixed \u003ccode\u003e-Wunused\u003c/code\u003e warnings on \u003ccode\u003eJSON_DIAGNOSTICS\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Kapeli\"\u003eBogdan Popescu\u003c/a\u003e hosts the \u003ca href=\"https://github.com/Kapeli/Dash-User-Contributions/tree/master/docsets/JSON_for_Modern_C%2B%2B\"\u003edocset\u003c/a\u003e for offline documentation viewers.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/carlsmedstad\"\u003eCarl Smedstad\u003c/a\u003e fixed an assertion error when using \u003ccode\u003eJSON_DIAGNOSTICS\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/miikka75\"\u003emiikka75\u003c/a\u003e provided an important fix to compile C++17 code with Clang 9.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/kernie\"\u003eMaarten Becker\u003c/a\u003e fixed a warning for shadowed variables.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/axnsan12\"\u003eCristi Vîjdea\u003c/a\u003e fixed typos in the \u003ccode\u003eoperator[]\u003c/code\u003e documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/axic\"\u003eAlex Beregszaszi\u003c/a\u003e fixed spelling mistakes in comments.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/striezel\"\u003eDirk Stolle\u003c/a\u003e fixed typos in documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/daniel-kun\"\u003eDaniel Albuschat\u003c/a\u003e corrected the parameter name in the \u003ccode\u003eparse\u003c/code\u003e documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Prince-Mendiratta\"\u003ePrince Mendiratta\u003c/a\u003e fixed a link to the FAQ.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/falbrechtskirchinger\"\u003eFlorian Albrechtskirchinger\u003c/a\u003e implemented \u003ccode\u003estd::string_view\u003c/code\u003e support for object keys and made dozens of other improvements.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/fangq\"\u003eQianqian Fang\u003c/a\u003e implemented the Binary JData (BJData) format.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/pketelsen\"\u003epketelsen\u003c/a\u003e added macros \u003ccode\u003eNLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT\u003c/code\u003e and \u003ccode\u003eNLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/DarkZeros\"\u003eDarkZeros\u003c/a\u003e adjusted to code to not clash with Arduino defines.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/flagarde\"\u003eflagarde\u003c/a\u003e fixed the output of \u003ccode\u003emeta()\u003c/code\u003e for MSVC.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/gcerretani\"\u003eGiovanni Cerretani\u003c/a\u003e fixed a check for \u003ccode\u003estd::filesystem\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/rex4539\"\u003eDimitris Apostolou\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/fhuberts\"\u003eFerry Huberts\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/heinemml\"\u003eMichael Nosthoff\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jhnlee\"\u003eJungHoon Lee\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/fdiblen\"\u003eFaruk D.\u003c/a\u003e fixed the CITATION.CFF file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/puffetto\"\u003eAndrea Cocito\u003c/a\u003e added a clarification on macro usage to the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/kkarbowiak\"\u003eKrzysiek Karbowiak\u003c/a\u003e refactored the tests to use \u003ccode\u003eCHECK_THROWS_WITH_AS\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/prncoprs\"\u003eChaoqi Zhang\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ivanovmp\"\u003eivanovmp\u003c/a\u003e fixed a whitespace error.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/KsaNL\"\u003eKsaNL\u003c/a\u003e fixed a build error when including \u003ccode\u003e\u0026lt;windows.h\u0026gt;\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Tachi107\"\u003eAndrea Pappacoda\u003c/a\u003e moved \u003ccode\u003e.pc\u003c/code\u003e and \u003ccode\u003e.cmake\u003c/code\u003e files to \u003ccode\u003eshare\u003c/code\u003e directory.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/wolfv\"\u003eWolf Vollprecht\u003c/a\u003e added the \u003ccode\u003epatch_inplace\u003c/code\u003e function.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jez\"\u003eJake Zimmerman\u003c/a\u003e highlighted common usage patterns in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/NN---\"\u003eNN\u003c/a\u003e added the Visual Studio output directory to \u003ccode\u003e.gitignore\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/romainreignier\"\u003eRomain Reignier\u003c/a\u003e improved the performance the vector output adapter.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Mike-Leo-Smith\"\u003eMike\u003c/a\u003e fixed the \u003ccode\u003estd::iterator_traits\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/zxey\"\u003eRichard Hozák\u003c/a\u003e added macro \u003ccode\u003eJSON_NO_ENUM\u003c/code\u003e to disable default enum conversions.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/vakokako\"\u003evakokako\u003c/a\u003e fixed tests when compiling with C++20.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/alexweej\"\u003eAlexander “weej” Jones\u003c/a\u003e fixed an example in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/eli-schwartz\"\u003eEli Schwartz\u003c/a\u003e added more files to the \u003ccode\u003einclude.zip\u003c/code\u003e archive.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/kevinlul\"\u003eKevin Lu\u003c/a\u003e fixed a compilation issue when typedefs with certain names were present.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/luxe\"\u003eTrevor Hickey\u003c/a\u003e improved the description of an example.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/jef\"\u003eJef LeCompte\u003c/a\u003e updated the year in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ahamez\"\u003eAlexandre Hamez\u003c/a\u003e fixed a warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/mbadhan\"\u003eManinderpal Badhan\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/kevin--\"\u003ekevin--\u003c/a\u003e added a note to an example in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/wx257osn2\"\u003eI\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Lord-Kamina\"\u003eGregorio Litenstein\u003c/a\u003e fixed the Clang detection.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/andoma\"\u003eAndreas Smas\u003c/a\u003e added a Doozer badge.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/wancw\"\u003eWanCW\u003c/a\u003e fixed the string conversion with Clang.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/zhaohuaxishi\"\u003ezhaohuaxishi\u003c/a\u003e fixed a Doxygen error.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/emvivre\"\u003eemvivre\u003c/a\u003e removed an invalid parameter from CMake.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Dobiasd\"\u003eTobias Hermann\u003c/a\u003e fixed a link in the README file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/traits\"\u003eMichael\u003c/a\u003e fixed a warning.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ryanjmulder\"\u003eRyan Mulder\u003c/a\u003e added \u003ccode\u003eensure_ascii\u003c/code\u003e to the \u003ccode\u003edump\u003c/code\u003e function.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/murinicanor\"\u003eMuri Nicanor\u003c/a\u003e fixed the \u003ccode\u003esed\u003c/code\u003e discovery in the Makefile.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/dgavedissian\"\u003eDavid Avedissian\u003c/a\u003e implemented SFINAE-friendly \u003ccode\u003eiterator_traits\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/aqnouch\"\u003eAQNOUCH Mohammed\u003c/a\u003e fixed a typo in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/garethsb\"\u003eGareth Sylvester-Bradley\u003c/a\u003e added \u003ccode\u003eoperator/=\u003c/code\u003e and \u003ccode\u003eoperator/\u003c/code\u003e to construct JSON pointers.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/mykter\"\u003eMichael Macnair\u003c/a\u003e added support for afl-fuzz testing.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/berkus\"\u003eBerkus Decker\u003c/a\u003e fixed a typo in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/effolkronium\"\u003eIllia Polishchuk\u003c/a\u003e improved the CMake testing.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/eltociear\"\u003eIkko Ashimine\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/barcode\"\u003eRaphael Grimm\u003c/a\u003e added the possibility to define a custom base class.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/tocic\"\u003etocic\u003c/a\u003e fixed typos in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Vertexwahn\"\u003eVertexwahn\u003c/a\u003e added Bazel build support.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/striezel\"\u003eDirk Stolle\u003c/a\u003e fixed typos in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/DavidKorczynski\"\u003eDavidKorczynski\u003c/a\u003e added a CIFuzz CI GitHub action.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Finkman\"\u003eFinkman\u003c/a\u003e fixed the debug pretty-printer.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/floriansegginger\"\u003eFlorian Segginger\u003c/a\u003e bumped the years in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/haadfida\"\u003ehaadfida\u003c/a\u003e cleaned up the badges of used services.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ArsenArsen\"\u003eArsen Arsenović\u003c/a\u003e fixed a build error.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/theevilone45\"\u003etheevilone45\u003c/a\u003e fixed a typo in a CMake file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/trofi\"\u003eSergei Trofimovich\u003c/a\u003e fixed the custom allocator support.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/joycebrum\"\u003eJoyce\u003c/a\u003e fixed some security issues in the GitHub workflows.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/njakob\"\u003eNicolas Jakob\u003c/a\u003e add vcpkg version badge.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/Tomerkm\"\u003eTomerkm\u003c/a\u003e added tests.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/tusooa\"\u003eNo.\u003c/a\u003e fixed the use of \u003ccode\u003eget\u0026lt;\u0026gt;\u003c/code\u003e calls.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/tarolling\"\u003etaro\u003c/a\u003e fixed a typo in the \u003ccode\u003eCODEOWNERS\u003c/code\u003e file.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/eltociear\"\u003eIkko Eltociear Ashimine\u003c/a\u003e fixed a typo.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/felixonmars\"\u003eFelix Yan\u003c/a\u003e fixed a typo in the README.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/HO-COOH\"\u003eHO-COOH\u003c/a\u003e fixed a parentheses in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/iwanders\"\u003eIvor Wanders\u003c/a\u003e fixed the examples to catch exception by \u003ccode\u003econst\u0026amp;\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/miny1233\"\u003eminy1233\u003c/a\u003e fixed a parentheses in the documentation.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/tomalakgeretkal\"\u003etomalakgeretkal\u003c/a\u003e fixed a compilation error.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ALF-ONE\"\u003ealferov\u003c/a\u003e fixed a compilation error.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/craigscott-crascit\"\u003eCraig Scott\u003c/a\u003e fixed a deprecation warning in CMake.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/ZeronSix\"\u003eVyacheslav Zhdanovskiy\u003c/a\u003e added macros for serialization-only types.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/mwestphal\"\u003eMathieu Westphal\u003c/a\u003e fixed typos.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/scribam\"\u003escribam\u003c/a\u003e fixed the MinGW workflow.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/aleksproger\"\u003eAleksei Sapitskii\u003c/a\u003e added support for Apple's Swift Package Manager.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/bebuch\"\u003eBenjamin Buch\u003c/a\u003e fixed the installation path in CMake.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/colbychaskell\"\u003eColby Haskell\u003c/a\u003e clarified the parse error message in case a file cannot be opened.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp dir=\"auto\"\u003eThanks a lot for helping out! Please \u003ca href=\"mailto:mail@nlohmann.me\"\u003elet me know\u003c/a\u003e if I forgot someone.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUsed third-party tools\u003c/h2\u003e\u003ca id=\"user-content-used-third-party-tools\" class=\"anchor\" aria-label=\"Permalink: Used third-party tools\" href=\"#used-third-party-tools\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe library itself consists of a single header file licensed under the MIT license. However, it is built, tested, documented, and whatnot using a lot of third-party tools and services. Thanks a lot!\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/edlund/amalgamate\"\u003e\u003cstrong\u003eamalgamate.py - Amalgamate C source and header files\u003c/strong\u003e\u003c/a\u003e to create a single header file\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://lcamtuf.coredump.cx/afl/\" rel=\"nofollow\"\u003e\u003cstrong\u003eAmerican fuzzy lop\u003c/strong\u003e\u003c/a\u003e for fuzz testing\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.appveyor.com\" rel=\"nofollow\"\u003e\u003cstrong\u003eAppVeyor\u003c/strong\u003e\u003c/a\u003e for \u003ca href=\"https://ci.appveyor.com/project/nlohmann/json\" rel=\"nofollow\"\u003econtinuous integration\u003c/a\u003e on Windows\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://astyle.sourceforge.net\" rel=\"nofollow\"\u003e\u003cstrong\u003eArtistic Style\u003c/strong\u003e\u003c/a\u003e for automatic source code indentation\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://clang.llvm.org\" rel=\"nofollow\"\u003e\u003cstrong\u003eClang\u003c/strong\u003e\u003c/a\u003e for compilation with code sanitizers\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://cmake.org\" rel=\"nofollow\"\u003e\u003cstrong\u003eCMake\u003c/strong\u003e\u003c/a\u003e for build automation\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.codacy.com\" rel=\"nofollow\"\u003e\u003cstrong\u003eCodacy\u003c/strong\u003e\u003c/a\u003e for further \u003ca href=\"https://app.codacy.com/gh/nlohmann/json/dashboard\" rel=\"nofollow\"\u003ecode analysis\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://coveralls.io\" rel=\"nofollow\"\u003e\u003cstrong\u003eCoveralls\u003c/strong\u003e\u003c/a\u003e to measure \u003ca href=\"https://coveralls.io/github/nlohmann/json\" rel=\"nofollow\"\u003ecode coverage\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://scan.coverity.com\" rel=\"nofollow\"\u003e\u003cstrong\u003eCoverity Scan\u003c/strong\u003e\u003c/a\u003e for \u003ca href=\"https://scan.coverity.com/projects/nlohmann-json\" rel=\"nofollow\"\u003estatic analysis\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://cppcheck.sourceforge.net\" rel=\"nofollow\"\u003e\u003cstrong\u003ecppcheck\u003c/strong\u003e\u003c/a\u003e for static analysis\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/onqtam/doctest\"\u003e\u003cstrong\u003edoctest\u003c/strong\u003e\u003c/a\u003e for the unit tests\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/skywinder/github-changelog-generator\"\u003e\u003cstrong\u003eGitHub Changelog Generator\u003c/strong\u003e\u003c/a\u003e to generate the \u003ca href=\"https://github.com/nlohmann/json/blob/develop/ChangeLog.md\"\u003eChangeLog\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/google/benchmark\"\u003e\u003cstrong\u003eGoogle Benchmark\u003c/strong\u003e\u003c/a\u003e to implement the benchmarks\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://nemequ.github.io/hedley/\" rel=\"nofollow\"\u003e\u003cstrong\u003eHedley\u003c/strong\u003e\u003c/a\u003e to avoid re-inventing several compiler-agnostic feature macros\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/linux-test-project/lcov\"\u003e\u003cstrong\u003elcov\u003c/strong\u003e\u003c/a\u003e to process coverage information and create an HTML view\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://llvm.org/docs/LibFuzzer.html\" rel=\"nofollow\"\u003e\u003cstrong\u003elibFuzzer\u003c/strong\u003e\u003c/a\u003e to implement fuzz testing for OSS-Fuzz\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://squidfunk.github.io/mkdocs-material/\" rel=\"nofollow\"\u003e\u003cstrong\u003eMaterial for MkDocs\u003c/strong\u003e\u003c/a\u003e for the style of the documentation site\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.mkdocs.org\" rel=\"nofollow\"\u003e\u003cstrong\u003eMkDocs\u003c/strong\u003e\u003c/a\u003e for the documentation site\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/google/oss-fuzz\"\u003e\u003cstrong\u003eOSS-Fuzz\u003c/strong\u003e\u003c/a\u003e for continuous fuzz testing of the library (\u003ca href=\"https://github.com/google/oss-fuzz/tree/master/projects/json\"\u003eproject repository\u003c/a\u003e)\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://probot.github.io\" rel=\"nofollow\"\u003e\u003cstrong\u003eProbot\u003c/strong\u003e\u003c/a\u003e for automating maintainer tasks such as closing stale issues, requesting missing information, or detecting toxic comments.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://valgrind.org\" rel=\"nofollow\"\u003e\u003cstrong\u003eValgrind\u003c/strong\u003e\u003c/a\u003e to check for correct memory management\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eNotes\u003c/h2\u003e\u003ca id=\"user-content-notes\" class=\"anchor\" aria-label=\"Permalink: Notes\" href=\"#notes\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eCharacter encoding\u003c/h3\u003e\u003ca id=\"user-content-character-encoding\" class=\"anchor\" aria-label=\"Permalink: Character encoding\" href=\"#character-encoding\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe library supports \u003cstrong\u003eUnicode input\u003c/strong\u003e as follows:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eOnly \u003cstrong\u003eUTF-8\u003c/strong\u003e encoded input is supported which is the default encoding for JSON according to \u003ca href=\"https://tools.ietf.org/html/rfc8259.html#section-8.1\" rel=\"nofollow\"\u003eRFC 8259\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003estd::u16string\u003c/code\u003e and \u003ccode\u003estd::u32string\u003c/code\u003e can be parsed, assuming UTF-16 and UTF-32 encoding, respectively. These encodings are not supported when reading from files or other input containers.\u003c/li\u003e\n\u003cli\u003eOther encodings such as Latin-1 or ISO 8859-1 are \u003cstrong\u003enot\u003c/strong\u003e supported and will yield parse or serialization errors.\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://www.unicode.org/faq/private_use.html#nonchar1\" rel=\"nofollow\"\u003eUnicode noncharacters\u003c/a\u003e will not be replaced by the library.\u003c/li\u003e\n\u003cli\u003eInvalid surrogates (e.g., incomplete pairs such as \u003ccode\u003e\\uDEAD\u003c/code\u003e) will yield parse errors.\u003c/li\u003e\n\u003cli\u003eThe strings stored in the library are UTF-8 encoded. When using the default string type (\u003ccode\u003estd::string\u003c/code\u003e), note that its length/size functions return the number of stored bytes rather than the number of characters or glyphs.\u003c/li\u003e\n\u003cli\u003eWhen you store strings with different encodings in the library, calling \u003ca href=\"https://json.nlohmann.me/api/basic_json/dump/\" rel=\"nofollow\"\u003e\u003ccode\u003edump()\u003c/code\u003e\u003c/a\u003e may throw an exception unless \u003ccode\u003ejson::error_handler_t::replace\u003c/code\u003e or \u003ccode\u003ejson::error_handler_t::ignore\u003c/code\u003e are used as error handlers.\u003c/li\u003e\n\u003cli\u003eTo store wide strings (e.g., \u003ccode\u003estd::wstring\u003c/code\u003e), you need to convert them to a UTF-8 encoded \u003ccode\u003estd::string\u003c/code\u003e before, see \u003ca href=\"https://json.nlohmann.me/home/faq/#wide-string-handling\" rel=\"nofollow\"\u003ean example\u003c/a\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eComments in JSON\u003c/h3\u003e\u003ca id=\"user-content-comments-in-json\" class=\"anchor\" aria-label=\"Permalink: Comments in JSON\" href=\"#comments-in-json\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis library does not support comments by default. It does so for three reasons:\u003c/p\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eComments are not part of the \u003ca href=\"https://tools.ietf.org/html/rfc8259\" rel=\"nofollow\"\u003eJSON specification\u003c/a\u003e. You may argue that \u003ccode\u003e//\u003c/code\u003e or \u003ccode\u003e/* */\u003c/code\u003e are allowed in JavaScript, but JSON is not JavaScript.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eThis was not an oversight: Douglas Crockford \u003ca href=\"https://plus.google.com/118095276221607585885/posts/RK8qyGVaGSr\" rel=\"nofollow\"\u003ewrote on this\u003c/a\u003e in May 2012:\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp dir=\"auto\"\u003eI removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it shouldn't.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eSuppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eIt is dangerous for interoperability if some libraries would add comment support while others don't. Please check \u003ca href=\"https://tools.ietf.org/html/draft-iab-protocol-maintenance-01\" rel=\"nofollow\"\u003eThe Harmful Consequences of the Robustness Principle\u003c/a\u003e on this.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp dir=\"auto\"\u003eHowever, you can pass set parameter \u003ccode\u003eignore_comments\u003c/code\u003e to true in the \u003ccode\u003eparse\u003c/code\u003e function to ignore \u003ccode\u003e//\u003c/code\u003e or \u003ccode\u003e/* */\u003c/code\u003e comments. Comments will then be treated as whitespace.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eOrder of object keys\u003c/h3\u003e\u003ca id=\"user-content-order-of-object-keys\" class=\"anchor\" aria-label=\"Permalink: Order of object keys\" href=\"#order-of-object-keys\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBy default, the library does not preserve the \u003cstrong\u003einsertion order of object elements\u003c/strong\u003e. This is standards-compliant, as the \u003ca href=\"https://tools.ietf.org/html/rfc8259.html\" rel=\"nofollow\"\u003eJSON standard\u003c/a\u003e defines objects as \"an unordered collection of zero or more name/value pairs\".\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you do want to preserve the insertion order, you can try the type \u003ca href=\"https://github.com/nlohmann/json/issues/2179\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/2179/hovercard\"\u003e\u003ccode\u003enlohmann::ordered_json\u003c/code\u003e\u003c/a\u003e. Alternatively, you can use a more sophisticated ordered map like \u003ca href=\"https://github.com/Tessil/ordered-map\"\u003e\u003ccode\u003etsl::ordered_map\u003c/code\u003e\u003c/a\u003e (\u003ca href=\"https://github.com/nlohmann/json/issues/546#issuecomment-304447518\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/546/hovercard\"\u003eintegration\u003c/a\u003e) or \u003ca href=\"https://github.com/nlohmann/fifo_map\"\u003e\u003ccode\u003enlohmann::fifo_map\u003c/code\u003e\u003c/a\u003e (\u003ca href=\"https://github.com/nlohmann/json/issues/485#issuecomment-333652309\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/485/hovercard\"\u003eintegration\u003c/a\u003e).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eSee the \u003ca href=\"https://json.nlohmann.me/features/object_order/\" rel=\"nofollow\"\u003e\u003cstrong\u003edocumentation on object order\u003c/strong\u003e\u003c/a\u003e for more information.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eMemory Release\u003c/h3\u003e\u003ca id=\"user-content-memory-release\" class=\"anchor\" aria-label=\"Permalink: Memory Release\" href=\"#memory-release\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eWe checked with Valgrind and the Address Sanitizer (ASAN) that there are no memory leaks.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf you find that a parsing program with this library does not release memory, please consider the following case, and it may be unrelated to this library.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eYour program is compiled with glibc.\u003c/strong\u003e There is a tunable threshold that glibc uses to decide whether to actually return memory to the system or whether to cache it for later reuse. If in your program you make lots of small allocations and those small allocations are not a contiguous block and are presumably below the threshold, then they will not get returned to the OS.\nHere is a related issue \u003ca href=\"https://github.com/nlohmann/json/issues/1924\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/1924/hovercard\"\u003e#1924\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFurther notes\u003c/h3\u003e\u003ca id=\"user-content-further-notes\" class=\"anchor\" aria-label=\"Permalink: Further notes\" href=\"#further-notes\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eThe code contains numerous debug \u003cstrong\u003eassertions\u003c/strong\u003e which can be switched off by defining the preprocessor macro \u003ccode\u003eNDEBUG\u003c/code\u003e, see the \u003ca href=\"https://en.cppreference.com/w/cpp/error/assert\" rel=\"nofollow\"\u003edocumentation of \u003ccode\u003eassert\u003c/code\u003e\u003c/a\u003e. In particular, note \u003ca href=\"https://json.nlohmann.me/api/basic_json/operator%5B%5D/\" rel=\"nofollow\"\u003e\u003ccode\u003eoperator[]\u003c/code\u003e\u003c/a\u003e implements \u003cstrong\u003eunchecked access\u003c/strong\u003e for const objects: If the given key is not present, the behavior is undefined (think of a dereferenced null pointer) and yields an \u003ca href=\"https://github.com/nlohmann/json/issues/289\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/289/hovercard\"\u003eassertion failure\u003c/a\u003e if assertions are switched on. If you are not sure whether an element in an object exists, use checked access with the \u003ca href=\"https://json.nlohmann.me/api/basic_json/at/\" rel=\"nofollow\"\u003e\u003ccode\u003eat()\u003c/code\u003e function\u003c/a\u003e. Furthermore, you can define \u003ccode\u003eJSON_ASSERT(x)\u003c/code\u003e to replace calls to \u003ccode\u003eassert(x)\u003c/code\u003e. See the \u003ca href=\"https://json.nlohmann.me/features/assertions/\" rel=\"nofollow\"\u003e\u003cstrong\u003edocumentation on runtime assertions\u003c/strong\u003e\u003c/a\u003e for more information.\u003c/li\u003e\n\u003cli\u003eAs the exact number type is not defined in the \u003ca href=\"https://tools.ietf.org/html/rfc8259.html\" rel=\"nofollow\"\u003eJSON specification\u003c/a\u003e, this library tries to choose the best fitting C++ number type automatically. As a result, the type \u003ccode\u003edouble\u003c/code\u003e may be used to store numbers which may yield \u003ca href=\"https://github.com/nlohmann/json/issues/181\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/181/hovercard\"\u003e\u003cstrong\u003efloating-point exceptions\u003c/strong\u003e\u003c/a\u003e in certain rare situations if floating-point exceptions have been unmasked in the calling code. These exceptions are not caused by the library and need to be fixed in the calling code, such as by re-masking the exceptions prior to calling library functions.\u003c/li\u003e\n\u003cli\u003eThe code can be compiled without C++ \u003cstrong\u003eruntime type identification\u003c/strong\u003e features; that is, you can use the \u003ccode\u003e-fno-rtti\u003c/code\u003e compiler flag.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eExceptions\u003c/strong\u003e are used widely within the library. They can, however, be switched off with either using the compiler flag \u003ccode\u003e-fno-exceptions\u003c/code\u003e or by defining the symbol \u003ccode\u003eJSON_NOEXCEPTION\u003c/code\u003e. In this case, exceptions are replaced by \u003ccode\u003eabort()\u003c/code\u003e calls. You can further control this behavior by defining \u003ccode\u003eJSON_THROW_USER\u003c/code\u003e (overriding \u003ccode\u003ethrow\u003c/code\u003e), \u003ccode\u003eJSON_TRY_USER\u003c/code\u003e (overriding \u003ccode\u003etry\u003c/code\u003e), and \u003ccode\u003eJSON_CATCH_USER\u003c/code\u003e (overriding \u003ccode\u003ecatch\u003c/code\u003e). Note that \u003ccode\u003eJSON_THROW_USER\u003c/code\u003e should leave the current scope (e.g., by throwing or aborting), as continuing after it may yield undefined behavior. Note the explanatory \u003ca href=\"https://en.cppreference.com/w/cpp/error/exception/what\" rel=\"nofollow\"\u003e\u003ccode\u003ewhat()\u003c/code\u003e\u003c/a\u003e string of exceptions is not available for MSVC if exceptions are disabled, see \u003ca href=\"https://github.com/nlohmann/json/discussions/2824\" data-hovercard-type=\"discussion\" data-hovercard-url=\"/nlohmann/json/discussions/2824/hovercard\"\u003e#2824\u003c/a\u003e. See the \u003ca href=\"https://json.nlohmann.me/home/exceptions/\" rel=\"nofollow\"\u003e\u003cstrong\u003edocumentation of exceptions\u003c/strong\u003e\u003c/a\u003e for more information.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eExecute unit tests\u003c/h2\u003e\u003ca id=\"user-content-execute-unit-tests\" class=\"anchor\" aria-label=\"Permalink: Execute unit tests\" href=\"#execute-unit-tests\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo compile and run the tests, you need to execute\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"mkdir build\ncd build\ncmake .. -DJSON_BuildTests=On\ncmake --build .\nctest --output-on-failure\"\u003e\u003cpre\u003emkdir build\n\u003cspan class=\"pl-c1\"\u003ecd\u003c/span\u003e build\ncmake .. -DJSON_BuildTests=On\ncmake --build \u003cspan class=\"pl-c1\"\u003e.\u003c/span\u003e\nctest --output-on-failure\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eNote that during the \u003ccode\u003ectest\u003c/code\u003e stage, several JSON test files are downloaded from an \u003ca href=\"https://github.com/nlohmann/json_test_data\"\u003eexternal repository\u003c/a\u003e. If policies forbid downloading artifacts during testing, you can download the files yourself and pass the directory with the test files via \u003ccode\u003e-DJSON_TestDataDirectory=path\u003c/code\u003e to CMake. Then, no Internet connectivity is required. See \u003ca href=\"https://github.com/nlohmann/json/issues/2189\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/2189/hovercard\"\u003eissue #2189\u003c/a\u003e for more information.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIf the test suite is not found, several test suites will fail like this:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"===============================================================================\njson/tests/src/make_test_data_available.hpp:21:\nTEST CASE: check test suite is downloaded\n\njson/tests/src/make_test_data_available.hpp:23: FATAL ERROR: REQUIRE( utils::check_testsuite_downloaded() ) is NOT correct!\n values: REQUIRE( false )\n logged: Test data not found in 'json/cmake-build-debug/json_test_data'.\n Please execute target 'download_test_data' before running this test suite.\n See \u0026lt;https://github.com/nlohmann/json#execute-unit-tests\u0026gt; for more information.\n\n===============================================================================\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e===============================================================================\njson/tests/src/make_test_data_available.hpp:21:\nTEST CASE: check test suite is downloaded\n\njson/tests/src/make_test_data_available.hpp:23: FATAL ERROR: REQUIRE( utils::check_testsuite_downloaded() ) is NOT correct!\n values: REQUIRE( false )\n logged: Test data not found in 'json/cmake-build-debug/json_test_data'.\n Please execute target 'download_test_data' before running this test suite.\n See \u0026lt;https://github.com/nlohmann/json#execute-unit-tests\u0026gt; for more information.\n\n===============================================================================\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIn case you have downloaded the library rather than checked out the code via Git, test \u003ccode\u003ecmake_fetch_content_configure\u003c/code\u003e will fail. Please execute \u003ccode\u003ectest -LE git_required\u003c/code\u003e to skip these tests. See \u003ca href=\"https://github.com/nlohmann/json/issues/2189\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/2189/hovercard\"\u003eissue #2189\u003c/a\u003e for more information.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eSome tests change the installed files and hence make the whole process not reproducible. Please execute \u003ccode\u003ectest -LE not_reproducible\u003c/code\u003e to skip these tests. See \u003ca href=\"https://github.com/nlohmann/json/issues/2324\" data-hovercard-type=\"issue\" data-hovercard-url=\"/nlohmann/json/issues/2324/hovercard\"\u003eissue #2324\u003c/a\u003e for more information. Furthermore, assertions must be switched off to ensure reproducible builds (see \u003ca href=\"https://github.com/nlohmann/json/discussions/4494\" data-hovercard-type=\"discussion\" data-hovercard-url=\"/nlohmann/json/discussions/4494/hovercard\"\u003ediscussion 4494\u003c/a\u003e).\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eNote you need to call \u003ccode\u003ecmake -LE \"not_reproducible|git_required\"\u003c/code\u003e to exclude both labels. See \u003ca href=\"https://github.com/nlohmann/json/issues/2596\" data-hovercard-type=\"discussion\" data-hovercard-url=\"/nlohmann/json/discussions/2596/hovercard\"\u003eissue #2596\u003c/a\u003e for more information.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eAs Intel compilers use unsafe floating point optimization by default, the unit tests may fail. Use flag \u003ca href=\"https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/fp-model-fp.html\" rel=\"nofollow\"\u003e\u003ccode\u003e/fp:precise\u003c/code\u003e\u003c/a\u003e then.\u003c/p\u003e\n\u003c/article\u003e","loaded":true,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":[{"level":2,"text":"Design goals","anchor":"design-goals","htmlText":"Design goals"},{"level":2,"text":"Sponsors","anchor":"sponsors","htmlText":"Sponsors"},{"level":3,"text":":raising_hand: Priority Sponsor","anchor":"raising_hand-priority-sponsor","htmlText":"🙋 Priority Sponsor"},{"level":3,"text":":label: Named Sponsors","anchor":"label-named-sponsors","htmlText":"🏷️ Named Sponsors"},{"level":3,"text":"Further support","anchor":"further-support","htmlText":"Further support"},{"level":2,"text":"Support","anchor":"support","htmlText":"Support"},{"level":2,"text":"Quick reference","anchor":"quick-reference","htmlText":"Quick reference"},{"level":2,"text":"Examples","anchor":"examples","htmlText":"Examples"},{"level":3,"text":"Read JSON from a file","anchor":"read-json-from-a-file","htmlText":"Read JSON from a file"},{"level":3,"text":"Creating json objects from JSON literals","anchor":"creating-json-objects-from-json-literals","htmlText":"Creating json objects from JSON literals"},{"level":3,"text":"JSON as first-class data type","anchor":"json-as-first-class-data-type","htmlText":"JSON as first-class data type"},{"level":3,"text":"Serialization / Deserialization","anchor":"serialization--deserialization","htmlText":"Serialization / Deserialization"},{"level":4,"text":"To/from strings","anchor":"tofrom-strings","htmlText":"To/from strings"},{"level":4,"text":"To/from streams (e.g. files, string streams)","anchor":"tofrom-streams-eg-files-string-streams","htmlText":"To/from streams (e.g. files, string streams)"},{"level":4,"text":"Read from iterator range","anchor":"read-from-iterator-range","htmlText":"Read from iterator range"},{"level":4,"text":"Custom data source","anchor":"custom-data-source","htmlText":"Custom data source"},{"level":4,"text":"SAX interface","anchor":"sax-interface","htmlText":"SAX interface"},{"level":3,"text":"STL-like access","anchor":"stl-like-access","htmlText":"STL-like access"},{"level":3,"text":"Conversion from STL containers","anchor":"conversion-from-stl-containers","htmlText":"Conversion from STL containers"},{"level":3,"text":"JSON Pointer and JSON Patch","anchor":"json-pointer-and-json-patch","htmlText":"JSON Pointer and JSON Patch"},{"level":3,"text":"JSON Merge Patch","anchor":"json-merge-patch","htmlText":"JSON Merge Patch"},{"level":3,"text":"Implicit conversions","anchor":"implicit-conversions","htmlText":"Implicit conversions"},{"level":3,"text":"Arbitrary types conversions","anchor":"arbitrary-types-conversions","htmlText":"Arbitrary types conversions"},{"level":4,"text":"Basic usage","anchor":"basic-usage","htmlText":"Basic usage"},{"level":4,"text":"Simplify your life with macros","anchor":"simplify-your-life-with-macros","htmlText":"Simplify your life with macros"},{"level":5,"text":"Example usage of macros","anchor":"example-usage-of-macros","htmlText":"Example usage of macros"},{"level":4,"text":"How do I convert third-party types?","anchor":"how-do-i-convert-third-party-types","htmlText":"How do I convert third-party types?"},{"level":4,"text":"How can I use get() for non-default constructible/non-copyable types?","anchor":"how-can-i-use-get-for-non-default-constructiblenon-copyable-types","htmlText":"How can I use get() for non-default constructible/non-copyable types?"},{"level":4,"text":"Can I write my own serializer? (Advanced use)","anchor":"can-i-write-my-own-serializer-advanced-use","htmlText":"Can I write my own serializer? (Advanced use)"},{"level":3,"text":"Specializing enum conversion","anchor":"specializing-enum-conversion","htmlText":"Specializing enum conversion"},{"level":3,"text":"Binary formats (BSON, CBOR, MessagePack, UBJSON, and BJData)","anchor":"binary-formats-bson-cbor-messagepack-ubjson-and-bjdata","htmlText":"Binary formats (BSON, CBOR, MessagePack, UBJSON, and BJData)"},{"level":2,"text":"Customers","anchor":"customers","htmlText":"Customers"},{"level":2,"text":"Supported compilers","anchor":"supported-compilers","htmlText":"Supported compilers"},{"level":2,"text":"Integration","anchor":"integration","htmlText":"Integration"},{"level":3,"text":"CMake","anchor":"cmake","htmlText":"CMake"},{"level":4,"text":"External","anchor":"external","htmlText":"External"},{"level":4,"text":"Embedded","anchor":"embedded","htmlText":"Embedded"},{"level":5,"text":"Embedded (FetchContent)","anchor":"embedded-fetchcontent","htmlText":"Embedded (FetchContent)"},{"level":4,"text":"Supporting Both","anchor":"supporting-both","htmlText":"Supporting Both"},{"level":3,"text":"Package Managers","anchor":"package-managers","htmlText":"Package Managers"},{"level":3,"text":"Pkg-config","anchor":"pkg-config","htmlText":"Pkg-config"},{"level":2,"text":"License","anchor":"license","htmlText":"License"},{"level":2,"text":"Contact","anchor":"contact","htmlText":"Contact"},{"level":2,"text":"Security","anchor":"security","htmlText":"Security"},{"level":2,"text":"Thanks","anchor":"thanks","htmlText":"Thanks"},{"level":2,"text":"Used third-party tools","anchor":"used-third-party-tools","htmlText":"Used third-party tools"},{"level":2,"text":"Notes","anchor":"notes","htmlText":"Notes"},{"level":3,"text":"Character encoding","anchor":"character-encoding","htmlText":"Character encoding"},{"level":3,"text":"Comments in JSON","anchor":"comments-in-json","htmlText":"Comments in JSON"},{"level":3,"text":"Order of object keys","anchor":"order-of-object-keys","htmlText":"Order of object keys"},{"level":3,"text":"Memory Release","anchor":"memory-release","htmlText":"Memory Release"},{"level":3,"text":"Further notes","anchor":"further-notes","htmlText":"Further notes"},{"level":2,"text":"Execute unit tests","anchor":"execute-unit-tests","htmlText":"Execute unit tests"}],"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fnlohmann%2Fjson"}},{"displayName":"CODE_OF_CONDUCT.md","repoName":"json","refName":"develop","path":".github/CODE_OF_CONDUCT.md","preferredFileType":"code_of_conduct","tabName":"Code of conduct","richText":null,"loaded":false,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":null,"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fnlohmann%2Fjson"}},{"displayName":"LICENSE.MIT","repoName":"json","refName":"develop","path":"LICENSE.MIT","preferredFileType":"license","tabName":"MIT","richText":null,"loaded":false,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":null,"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fnlohmann%2Fjson"}},{"displayName":"SECURITY.md","repoName":"json","refName":"develop","path":".github/SECURITY.md","preferredFileType":"security","tabName":"Security","richText":null,"loaded":false,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":null,"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fnlohmann%2Fjson"}}],"overviewFilesProcessingTime":0}},"appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-96e76d5fdb2c.js","githubDevUrl":null,"enabled_features":{"copilot_workspace":null,"code_nav_ui_events":false,"overview_shared_code_dropdown_button":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}}</script> <div data-target="react-partial.reactRoot"><style data-styled="true" data-styled-version="5.3.11">.iVEunk{margin-top:16px;margin-bottom:16px;}/*!sc*/ .jzuOtQ{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}/*!sc*/ .bGojzy{margin-bottom:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;row-gap:16px;}/*!sc*/ .iNSVHo{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;padding-bottom:16px;padding-top:8px;}/*!sc*/ .bVgnfw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;gap:8px;}/*!sc*/ @media screen and (max-width:320px){.bVgnfw{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}}/*!sc*/ .CEgMp{position:relative;}/*!sc*/ @media screen and (max-width:380px){.CEgMp .ref-selector-button-text-container{max-width:80px;}}/*!sc*/ @media screen and (max-width:320px){.CEgMp{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}.CEgMp .overview-ref-selector{width:100%;}.CEgMp .overview-ref-selector > span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;}.CEgMp .overview-ref-selector > span > span[data-component="text"]{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}}/*!sc*/ .gMOVLe[data-size="medium"]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-width:0;}/*!sc*/ .gMOVLe[data-size="medium"] svg{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .gMOVLe[data-size="medium"] > span{width:inherit;}/*!sc*/ .gUkoLg{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}/*!sc*/ .bZBlpz{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;}/*!sc*/ .lhTYNA{margin-right:4px;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .ffLUq{font-size:14px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}/*!sc*/ .bmcJak{min-width:0;}/*!sc*/ .fLXEGX{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (max-width:1079px){.fLXEGX{display:none;}}/*!sc*/ .lmSMZJ[data-size="medium"]{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));padding-left:4px;padding-right:4px;}/*!sc*/ .lmSMZJ[data-size="medium"] span[data-component="leadingVisual"]{margin-right:4px !important;}/*!sc*/ .dqfxud{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (min-width:1080px){.dqfxud{display:none;}}/*!sc*/ @media screen and (max-width:543px){.dqfxud{display:none;}}/*!sc*/ .fGwBZA[data-size="medium"][data-no-visuals]{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));}/*!sc*/ .jxTzTd{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding-left:8px;gap:8px;}/*!sc*/ .gqqBXN{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:8px;}/*!sc*/ @media screen and (max-width:543px){.gqqBXN{display:none;}}/*!sc*/ .dzXgxt{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (max-width:1011px){.dzXgxt{display:none;}}/*!sc*/ .iWFGlI{margin-left:8px;margin-right:8px;margin:0;}/*!sc*/ .vcvyP{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-width:160px;}/*!sc*/ .YUPas{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (min-width:1012px){.YUPas{display:none;}}/*!sc*/ .izFOf{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}/*!sc*/ @media screen and (min-width:544px){.izFOf{display:none;}}/*!sc*/ .vIPPs{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:16px;}/*!sc*/ .fdROMU{width:100%;border-collapse:separate;border-spacing:0;border:1px solid;border-color:var(--borderColor-default,var(--color-border-default,#d0d7de));border-radius:6px;table-layout:fixed;overflow:unset;}/*!sc*/ .jGKpsv{height:0px;line-height:0px;}/*!sc*/ .jGKpsv tr{height:0px;font-size:0px;}/*!sc*/ .jdgHnn{padding:16px;color:var(--fgColor-muted,var(--color-fg-muted,#656d76));font-size:12px;text-align:left;height:40px;}/*!sc*/ .jdgHnn th{padding-left:16px;background-color:var(--bgColor-muted,var(--color-canvas-subtle,#f6f8fa));}/*!sc*/ .bQivRW{width:100%;border-top-left-radius:6px;}/*!sc*/ @media screen and (min-width:544px){.bQivRW{display:none;}}/*!sc*/ .ldkMIO{width:40%;border-top-left-radius:6px;}/*!sc*/ @media screen and (max-width:543px){.ldkMIO{display:none;}}/*!sc*/ .jMbWeI{text-align:right;padding-right:16px;width:136px;border-top-right-radius:6px;}/*!sc*/ .gpqjiB{color:var(--fgColor-muted,var(--color-fg-muted,#656d76));font-size:12px;height:40px;}/*!sc*/ .dzCJzi{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:8px;min-width:273px;padding:8px;}/*!sc*/ @media screen and (min-width:544px){.dzCJzi{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;}}/*!sc*/ .eNCcrz{text-align:center;vertical-align:center;height:40px;border-top:1px solid;border-color:var(--borderColor-default,var(--color-border-default,#d0d7de));}/*!sc*/ .bHTcCe{border-top:1px solid var(--borderColor-default,var(--color-border-default));cursor:pointer;}/*!sc*/ .csrIcr{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;gap:16px;}/*!sc*/ .bUQNHB{border:1px solid;border-color:var(--borderColor-default,var(--color-border-default,#d0d7de));border-radius:6px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}/*!sc*/ @media screen and (max-width:543px){.bUQNHB{margin-left:-16px;margin-right:-16px;max-width:calc(100% + 32px);}}/*!sc*/ @media screen and (min-width:544px){.bUQNHB{max-width:100%;}}/*!sc*/ .jPdcfu{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;border-bottom:1px solid;border-bottom-color:var(--borderColor-default,var(--color-border-default,#d0d7de));-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-right:8px;position:-webkit-sticky;position:sticky;top:0;background-color:var(--bgColor-default,var(--color-canvas-default,#ffffff));z-index:1;border-top-left-radius:6px;border-top-right-radius:6px;}/*!sc*/ .iphEWz{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;border-bottom:none;max-width:100%;padding-left:8px;padding-right:8px;}/*!sc*/ .hUCRAk{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}/*!sc*/ .cwoBXV[data-size="medium"]{color:var(--fgColor-muted,var(--color-fg-subtle,#6e7781));padding-left:8px;padding-right:8px;}/*!sc*/ .QkQOb{padding:32px;overflow:auto;}/*!sc*/ data-styled.g1[id="Box-sc-g0xbh4-0"]{content:"iVEunk,jzuOtQ,bGojzy,iNSVHo,bVgnfw,CEgMp,gMOVLe,gUkoLg,bZBlpz,lhTYNA,ffLUq,bmcJak,fLXEGX,lmSMZJ,dqfxud,fGwBZA,jxTzTd,gqqBXN,dzXgxt,iWFGlI,vcvyP,YUPas,izFOf,vIPPs,fdROMU,jGKpsv,jdgHnn,bQivRW,ldkMIO,jMbWeI,gpqjiB,dzCJzi,eNCcrz,bHTcCe,csrIcr,bUQNHB,jPdcfu,iphEWz,hUCRAk,cwoBXV,QkQOb,"}/*!sc*/ .brGdpi{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;-webkit-clip:rect(0,0,0,0);clip:rect(0,0,0,0);white-space:nowrap;border-width:0;}/*!sc*/ data-styled.g6[id="_VisuallyHidden__VisuallyHidden-sc-11jhm7a-0"]{content:"brGdpi,"}/*!sc*/ .hWlpPn{position:relative;display:inline-block;}/*!sc*/ .hWlpPn::after{position:absolute;z-index:1000000;display:none;padding:0.5em 0.75em;font:normal normal 11px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";-webkit-font-smoothing:subpixel-antialiased;color:var(--tooltip-fgColor,var(--fgColor-onEmphasis,var(--color-fg-on-emphasis,#ffffff)));text-align:center;-webkit-text-decoration:none;text-decoration:none;text-shadow:none;text-transform:none;-webkit-letter-spacing:normal;-moz-letter-spacing:normal;-ms-letter-spacing:normal;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:var(--tooltip-bgColor,var(--bgColor-emphasis,var(--color-neutral-emphasis-plus,#24292f)));border-radius:6px;opacity:0;}/*!sc*/ @-webkit-keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}/*!sc*/ @keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}/*!sc*/ .hWlpPn:hover::after,.hWlpPn:active::after,.hWlpPn:focus::after,.hWlpPn:focus-within::after{display:inline-block;-webkit-text-decoration:none;text-decoration:none;-webkit-animation-name:tooltip-appear;animation-name:tooltip-appear;-webkit-animation-duration:0.1s;animation-duration:0.1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;-webkit-animation-delay:0s;animation-delay:0s;}/*!sc*/ .hWlpPn.tooltipped-no-delay:hover::after,.hWlpPn.tooltipped-no-delay:active::after,.hWlpPn.tooltipped-no-delay:focus::after,.hWlpPn.tooltipped-no-delay:focus-within::after{-webkit-animation-delay:0s;animation-delay:0s;}/*!sc*/ .hWlpPn.tooltipped-multiline:hover::after,.hWlpPn.tooltipped-multiline:active::after,.hWlpPn.tooltipped-multiline:focus::after,.hWlpPn.tooltipped-multiline:focus-within::after{display:table-cell;}/*!sc*/ .hWlpPn.tooltipped-s::after,.hWlpPn.tooltipped-se::after,.hWlpPn.tooltipped-sw::after{top:100%;right:50%;margin-top:6px;}/*!sc*/ .hWlpPn.tooltipped-se::after{right:auto;left:50%;margin-left:-16px;}/*!sc*/ .hWlpPn.tooltipped-sw::after{margin-right:-16px;}/*!sc*/ .hWlpPn.tooltipped-n::after,.hWlpPn.tooltipped-ne::after,.hWlpPn.tooltipped-nw::after{right:50%;bottom:100%;margin-bottom:6px;}/*!sc*/ .hWlpPn.tooltipped-ne::after{right:auto;left:50%;margin-left:-16px;}/*!sc*/ .hWlpPn.tooltipped-nw::after{margin-right:-16px;}/*!sc*/ .hWlpPn.tooltipped-s::after,.hWlpPn.tooltipped-n::after{-webkit-transform:translateX(50%);-ms-transform:translateX(50%);transform:translateX(50%);}/*!sc*/ .hWlpPn.tooltipped-w::after{right:100%;bottom:50%;margin-right:6px;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%);}/*!sc*/ .hWlpPn.tooltipped-e::after{bottom:50%;left:100%;margin-left:6px;-webkit-transform:translateY(50%);-ms-transform:translateY(50%);transform:translateY(50%);}/*!sc*/ .hWlpPn.tooltipped-multiline::after{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:250px;word-wrap:break-word;white-space:pre-line;border-collapse:separate;}/*!sc*/ .hWlpPn.tooltipped-multiline.tooltipped-s::after,.hWlpPn.tooltipped-multiline.tooltipped-n::after{right:auto;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);}/*!sc*/ .hWlpPn.tooltipped-multiline.tooltipped-w::after,.hWlpPn.tooltipped-multiline.tooltipped-e::after{right:100%;}/*!sc*/ .hWlpPn.tooltipped-align-right-2::after{right:0;margin-right:0;}/*!sc*/ .hWlpPn.tooltipped-align-left-2::after{left:0;margin-left:0;}/*!sc*/ data-styled.g17[id="Tooltip__TooltipBase-sc-17tf59c-0"]{content:"hWlpPn,"}/*!sc*/ .liVpTx{display:inline-block;overflow:hidden;text-overflow:ellipsis;vertical-align:top;white-space:nowrap;max-width:125px;}/*!sc*/ data-styled.g19[id="Truncate__StyledTruncate-sc-23o1d2-0"]{content:"liVpTx,"}/*!sc*/ </style> <!-- --> <!-- --> <div class="Box-sc-g0xbh4-0 iVEunk"><div class="Box-sc-g0xbh4-0 jzuOtQ"><div class="Box-sc-g0xbh4-0 bGojzy"></div></div><div class="Box-sc-g0xbh4-0 iNSVHo"><div class="Box-sc-g0xbh4-0 bVgnfw"><div class="Box-sc-g0xbh4-0 CEgMp"><button type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-label="develop branch" data-testid="anchor-button" class="Box-sc-g0xbh4-0 gMOVLe prc-Button-ButtonBase-c50BI overview-ref-selector width-full" data-loading="false" data-size="medium" data-variant="default" aria-describedby="branch-picker-repos-header-ref-selector-loading-announcement" id="branch-picker-repos-header-ref-selector"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="text" class="prc-Button-Label-pTQ3x"><div class="Box-sc-g0xbh4-0 bZBlpz"><div class="Box-sc-g0xbh4-0 lhTYNA"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></div><div class="Box-sc-g0xbh4-0 ffLUq ref-selector-button-text-container"><span class="Box-sc-g0xbh4-0 bmcJak prc-Text-Text-0ima0"> <!-- -->develop</span></div></div></span><span data-component="trailingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></span></button><button hidden="" data-hotkey-scope="read-only-cursor-text-area"></button></div><div class="Box-sc-g0xbh4-0 fLXEGX"><a style="--button-color:fg.muted" type="button" href="/nlohmann/json/branches" class="Box-sc-g0xbh4-0 lmSMZJ prc-Button-ButtonBase-c50BI" data-loading="false" data-size="medium" data-variant="invisible" aria-describedby=":Rclab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x">Branches</span></span></a><a style="--button-color:fg.muted" type="button" href="/nlohmann/json/tags" class="Box-sc-g0xbh4-0 lmSMZJ prc-Button-ButtonBase-c50BI" data-loading="false" data-size="medium" data-variant="invisible" aria-describedby=":Rklab:-loading-announcement"><span data-component="buttonContent" class="Box-sc-g0xbh4-0 gUkoLg prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-tag" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x">Tags</span></span></a></div><div class="Box-sc-g0xbh4-0 dqfxud"><a style="--button-color:fg.muted" type="button" aria-label="Go to Branches page" href="/nlohmann/json/branches" class="Box-sc-g0xbh4-0 fGwBZA prc-Button-ButtonBase-c50BI" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="invisible" aria-describedby=":Relab:-loading-announcement"><svg aria-hidden="true" focusable="false" class="octicon octicon-git-branch" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg></a><a style="--button-color:fg.muted" type="button" aria-label="Go to Tags page" href="/nlohmann/json/tags" class="Box-sc-g0xbh4-0 fGwBZA prc-Button-ButtonBase-c50BI" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="invisible" aria-describedby=":Rmlab:-loading-announcement"><svg aria-hidden="true" focusable="false" class="octicon octicon-tag" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path></svg></a></div></div><div class="Box-sc-g0xbh4-0 jxTzTd"><div class="Box-sc-g0xbh4-0 gqqBXN"><div class="Box-sc-g0xbh4-0 dzXgxt"><!--$--><div class="Box-sc-g0xbh4-0 iWFGlI"><span class="Box-sc-g0xbh4-0 vcvyP TextInput-wrapper prc-components-TextInputWrapper-i1ofR prc-components-TextInputBaseWrapper-ueK9q" data-leading-visual="true" data-trailing-visual="true" aria-busy="false"><span class="TextInput-icon" id=":R2j5ab:" aria-hidden="true"><svg aria-hidden="true" focusable="false" class="octicon octicon-search" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"></path></svg></span><input type="text" aria-label="Go to file" role="combobox" aria-controls="file-results-list" aria-expanded="false" aria-haspopup="dialog" autoCorrect="off" spellcheck="false" placeholder="Go to file" aria-describedby=":R2j5ab: :R2j5abH1:" data-component="input" class="prc-components-Input-Ic-y8" value=""/><span class="TextInput-icon" id=":R2j5abH1:" aria-hidden="true"></span></span></div><!--/$--></div><div class="Box-sc-g0xbh4-0 YUPas"><button type="button" class="prc-Button-ButtonBase-c50BI" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-describedby=":Rr5ab:-loading-announcement"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-HKbr-"><span data-component="text" class="prc-Button-Label-pTQ3x">Go to file</span></span></button></div><div class="react-directory-add-file-icon"></div><div class="react-directory-remove-file-icon"></div></div><button type="button" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-c50BI" data-loading="false" data-size="medium" data-variant="primary" aria-describedby=":R55ab:-loading-announcement" id=":R55ab:"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-code hide-sm" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x">Code</span><span data-component="trailingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-triangle-down" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></span></span></button><div class="Box-sc-g0xbh4-0 izFOf"><button data-component="IconButton" type="button" aria-label="Open more actions menu" aria-haspopup="true" aria-expanded="false" tabindex="0" class="prc-Button-ButtonBase-c50BI prc-Button-IconButton-szpyj" data-loading="false" data-no-visuals="true" data-size="medium" data-variant="default" aria-describedby=":R75ab:-loading-announcement" id=":R75ab:"><svg aria-hidden="true" focusable="false" class="octicon octicon-kebab-horizontal" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg></button></div></div></div><div class="Box-sc-g0xbh4-0 vIPPs"><div data-hpc="true"><button hidden="" data-testid="focus-next-element-button" data-hotkey="j"></button><button hidden="" data-testid="focus-previous-element-button" data-hotkey="k"></button><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading" id="folders-and-files">Folders and files</h2><table aria-labelledby="folders-and-files" class="Box-sc-g0xbh4-0 fdROMU"><thead class="Box-sc-g0xbh4-0 jGKpsv"><tr class="Box-sc-g0xbh4-0 jdgHnn"><th colSpan="2" class="Box-sc-g0xbh4-0 bQivRW"><span class="text-bold">Name</span></th><th colSpan="1" class="Box-sc-g0xbh4-0 ldkMIO"><span class="text-bold">Name</span></th><th class="hide-sm"><div title="Last commit message" class="Truncate__StyledTruncate-sc-23o1d2-0 liVpTx width-fit"><span class="text-bold">Last commit message</span></div></th><th colSpan="1" class="Box-sc-g0xbh4-0 jMbWeI"><div title="Last commit date" class="Truncate__StyledTruncate-sc-23o1d2-0 liVpTx width-fit"><span class="text-bold">Last commit date</span></div></th></tr></thead><tbody><tr class="Box-sc-g0xbh4-0 gpqjiB"><td colSpan="3" class="bgColor-muted p-1 rounded-top-2"><div class="Box-sc-g0xbh4-0 dzCJzi"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading">Latest commit</h2><div style="width:120px" class="Skeleton Skeleton--text" data-testid="loading"> </div><div class="d-flex flex-shrink-0 gap-2"><div data-testid="latest-commit-details" class="d-none d-sm-flex flex-items-center"></div><div class="d-flex gap-2"><h2 class="sr-only ScreenReaderHeading-module__userSelectNone--vW4Cq prc-Heading-Heading-6CmGO" data-testid="screen-reader-heading">History</h2><a href="/nlohmann/json/commits/develop/" class="prc-Button-ButtonBase-c50BI d-none d-lg-flex LinkButton-module__code-view-link-button--xvCGA flex-items-center fgColor-default" data-loading="false" data-size="small" data-variant="invisible" aria-describedby=":Raqj8pab:-loading-announcement"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-history" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg></span><span data-component="text" class="prc-Button-Label-pTQ3x"><span class="fgColor-default">4,695 Commits</span></span></span></a><div class="d-sm-none"></div><div class="d-flex d-lg-none"><span role="tooltip" aria-label="4,695 Commits" id="history-icon-button-tooltip" class="Tooltip__TooltipBase-sc-17tf59c-0 hWlpPn tooltipped-n"><a href="/nlohmann/json/commits/develop/" class="prc-Button-ButtonBase-c50BI LinkButton-module__code-view-link-button--xvCGA flex-items-center fgColor-default" data-loading="false" data-size="small" data-variant="invisible" aria-describedby=":R1iqj8pab:-loading-announcement history-icon-button-tooltip"><span data-component="buttonContent" data-align="center" class="prc-Button-ButtonContent-HKbr-"><span data-component="leadingVisual" class="prc-Button-Visual-2epfX prc-Button-VisualWrap-Db-eB"><svg aria-hidden="true" focusable="false" class="octicon octicon-history" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"></path></svg></span></span></a></span></div></div></div></div></td></tr><tr class="react-directory-row undefined" id="folder-row-0"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".github" aria-label=".github, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/.github">.github</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".github" aria-label=".github, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/.github">.github</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-1"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".reuse" aria-label=".reuse, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/.reuse">.reuse</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".reuse" aria-label=".reuse, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/.reuse">.reuse</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-2"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="LICENSES" aria-label="LICENSES, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/LICENSES">LICENSES</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="LICENSES" aria-label="LICENSES, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/LICENSES">LICENSES</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-3"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="cmake" aria-label="cmake, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/cmake">cmake</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="cmake" aria-label="cmake, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/cmake">cmake</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-4"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="docs" aria-label="docs, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/docs">docs</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="docs" aria-label="docs, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/docs">docs</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-5"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="This path skips through empty directories" aria-label="include/nlohmann, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/include/nlohmann"><span class="react-directory-default-color" data-testid="path-name-segment">include/</span><span class="" data-testid="path-name-segment">nlohmann</span></a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="This path skips through empty directories" aria-label="include/nlohmann, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/include/nlohmann"><span class="react-directory-default-color" data-testid="path-name-segment">include/</span><span class="" data-testid="path-name-segment">nlohmann</span></a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-6"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="This path skips through empty directories" aria-label="single_include/nlohmann, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/single_include/nlohmann"><span class="react-directory-default-color" data-testid="path-name-segment">single_include/</span><span class="" data-testid="path-name-segment">nlohmann</span></a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="This path skips through empty directories" aria-label="single_include/nlohmann, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/single_include/nlohmann"><span class="react-directory-default-color" data-testid="path-name-segment">single_include/</span><span class="" data-testid="path-name-segment">nlohmann</span></a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-7"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="tests" aria-label="tests, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/tests">tests</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="tests" aria-label="tests, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/tests">tests</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-8"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="tools" aria-label="tools, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/tools">tools</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file-directory-fill icon-directory" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="tools" aria-label="tools, (Directory)" class="Link--primary" href="/nlohmann/json/tree/develop/tools">tools</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row undefined" id="folder-row-9"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".cirrus.yml" aria-label=".cirrus.yml, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/.cirrus.yml">.cirrus.yml</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".cirrus.yml" aria-label=".cirrus.yml, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/.cirrus.yml">.cirrus.yml</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-10"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".clang-tidy" aria-label=".clang-tidy, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/.clang-tidy">.clang-tidy</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".clang-tidy" aria-label=".clang-tidy, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/.clang-tidy">.clang-tidy</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-11"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".gitignore" aria-label=".gitignore, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/.gitignore">.gitignore</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title=".gitignore" aria-label=".gitignore, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/.gitignore">.gitignore</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-12"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="BUILD.bazel" aria-label="BUILD.bazel, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/BUILD.bazel">BUILD.bazel</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="BUILD.bazel" aria-label="BUILD.bazel, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/BUILD.bazel">BUILD.bazel</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-13"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="CITATION.cff" aria-label="CITATION.cff, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/CITATION.cff">CITATION.cff</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="CITATION.cff" aria-label="CITATION.cff, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/CITATION.cff">CITATION.cff</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-14"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="CMakeLists.txt" aria-label="CMakeLists.txt, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/CMakeLists.txt">CMakeLists.txt</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="CMakeLists.txt" aria-label="CMakeLists.txt, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/CMakeLists.txt">CMakeLists.txt</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-15"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="ChangeLog.md" aria-label="ChangeLog.md, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/ChangeLog.md">ChangeLog.md</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="ChangeLog.md" aria-label="ChangeLog.md, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/ChangeLog.md">ChangeLog.md</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-16"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="FILES.md" aria-label="FILES.md, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/FILES.md">FILES.md</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="FILES.md" aria-label="FILES.md, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/FILES.md">FILES.md</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-17"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="LICENSE.MIT" aria-label="LICENSE.MIT, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/LICENSE.MIT">LICENSE.MIT</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="LICENSE.MIT" aria-label="LICENSE.MIT, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/LICENSE.MIT">LICENSE.MIT</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-18"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="MODULE.bazel" aria-label="MODULE.bazel, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/MODULE.bazel">MODULE.bazel</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="MODULE.bazel" aria-label="MODULE.bazel, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/MODULE.bazel">MODULE.bazel</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-19"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Makefile" aria-label="Makefile, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/Makefile">Makefile</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Makefile" aria-label="Makefile, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/Makefile">Makefile</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-20"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Package.swift" aria-label="Package.swift, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/Package.swift">Package.swift</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="Package.swift" aria-label="Package.swift, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/Package.swift">Package.swift</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-21"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="README.md" aria-label="README.md, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/README.md">README.md</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="README.md" aria-label="README.md, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/README.md">README.md</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-22"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="meson.build" aria-label="meson.build, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/meson.build">meson.build</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="meson.build" aria-label="meson.build, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/meson.build">meson.build</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="react-directory-row truncate-for-mobile" id="folder-row-23"><td class="react-directory-row-name-cell-small-screen" colSpan="2"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="nlohmann_json.natvis" aria-label="nlohmann_json.natvis, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/nlohmann_json.natvis">nlohmann_json.natvis</a></div></div></div></div></td><td class="react-directory-row-name-cell-large-screen" colSpan="1"><div class="react-directory-filename-column"><svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M2 1.75C2 .784 2.784 0 3.75 0h6.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0 1 13.25 16h-9.5A1.75 1.75 0 0 1 2 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h9.5a.25.25 0 0 0 .25-.25V6h-2.75A1.75 1.75 0 0 1 9 4.25V1.5Zm6.75.062V4.25c0 .138.112.25.25.25h2.688l-.011-.013-2.914-2.914-.013-.011Z"></path></svg><div class="overflow-hidden"><div class="react-directory-filename-cell"><div class="react-directory-truncate"><a title="nlohmann_json.natvis" aria-label="nlohmann_json.natvis, (File)" class="Link--primary" href="/nlohmann/json/blob/develop/nlohmann_json.natvis">nlohmann_json.natvis</a></div></div></div></div></td><td class="react-directory-row-commit-cell"><div class="Skeleton Skeleton--text"> </div></td><td><div class="Skeleton Skeleton--text"> </div></td></tr><tr class="Box-sc-g0xbh4-0 eNCcrz show-for-mobile" data-testid="view-all-files-row"><td colSpan="3" class="Box-sc-g0xbh4-0 bHTcCe"><div><button class="prc-Link-Link-85e08">View all files</button></div></td></tr></tbody></table></div><div class="Box-sc-g0xbh4-0 csrIcr"><div class="Box-sc-g0xbh4-0 bUQNHB"><div itemscope="" itemType="https://schema.org/abstract" class="Box-sc-g0xbh4-0 jPdcfu"><h2 class="_VisuallyHidden__VisuallyHidden-sc-11jhm7a-0 brGdpi">Repository files navigation</h2><nav class="Box-sc-g0xbh4-0 iphEWz prc-components-UnderlineWrapper-oOh5J" aria-label="Repository files"><ul class="prc-components-UnderlineItemList-b23Hf" role="list"><li class="Box-sc-g0xbh4-0 hUCRAk"><a class="prc-components-UnderlineItem-lJsg-" href="#" aria-current="page"><span data-component="icon"><svg aria-hidden="true" focusable="false" class="octicon octicon-book" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path></svg></span><span data-component="text" data-content="README">README</span></a></li><li class="Box-sc-g0xbh4-0 hUCRAk"><a class="prc-components-UnderlineItem-lJsg-" href="#"><span data-component="icon"><svg aria-hidden="true" focusable="false" class="octicon octicon-code-of-conduct" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8.048 2.241c.964-.709 2.079-1.238 3.325-1.241a4.616 4.616 0 0 1 3.282 1.355c.41.408.757.86.996 1.428.238.568.348 1.206.347 1.968 0 2.193-1.505 4.254-3.081 5.862-1.496 1.526-3.213 2.796-4.249 3.563l-.22.163a.749.749 0 0 1-.895 0l-.221-.163c-1.036-.767-2.753-2.037-4.249-3.563C1.51 10.008.007 7.952.002 5.762a4.614 4.614 0 0 1 1.353-3.407C3.123.585 6.223.537 8.048 2.24Zm-1.153.983c-1.25-1.033-3.321-.967-4.48.191a3.115 3.115 0 0 0-.913 2.335c0 1.556 1.109 3.24 2.652 4.813C5.463 11.898 6.96 13.032 8 13.805c.353-.262.758-.565 1.191-.905l-1.326-1.223a.75.75 0 0 1 1.018-1.102l1.48 1.366c.328-.281.659-.577.984-.887L9.99 9.802a.75.75 0 1 1 1.019-1.103l1.384 1.28c.295-.329.566-.661.81-.995L12.92 8.7l-1.167-1.168c-.674-.671-1.78-.664-2.474.03-.268.269-.538.537-.802.797-.893.882-2.319.843-3.185-.032-.346-.35-.693-.697-1.043-1.047a.75.75 0 0 1-.04-1.016c.162-.191.336-.401.52-.623.62-.748 1.356-1.637 2.166-2.417Zm7.112 4.442c.313-.65.491-1.293.491-1.916v-.001c0-.614-.088-1.045-.23-1.385-.143-.339-.357-.633-.673-.949a3.111 3.111 0 0 0-2.218-.915c-1.092.003-2.165.627-3.226 1.602-.823.755-1.554 1.637-2.228 2.45l-.127.154.562.566a.755.755 0 0 0 1.066.02l.794-.79c1.258-1.258 3.312-1.31 4.594-.032.396.394.792.791 1.173 1.173Z"></path></svg></span><span data-component="text" data-content="Code of conduct">Code of conduct</span></a></li><li class="Box-sc-g0xbh4-0 hUCRAk"><a class="prc-components-UnderlineItem-lJsg-" href="#"><span data-component="icon"><svg aria-hidden="true" focusable="false" class="octicon octicon-law" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path></svg></span><span data-component="text" data-content="MIT license">MIT license</span></a></li><li class="Box-sc-g0xbh4-0 hUCRAk"><a class="prc-components-UnderlineItem-lJsg-" href="#"><span data-component="icon"><svg aria-hidden="true" focusable="false" class="octicon octicon-law" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path></svg></span><span data-component="text" data-content="Security">Security</span></a></li></ul></nav><button style="--button-color:fg.subtle" type="button" aria-label="Outline" aria-haspopup="true" aria-expanded="false" tabindex="0" class="Box-sc-g0xbh4-0 cwoBXV prc-Button-ButtonBase-c50BI" data-loading="false" data-size="medium" data-variant="invisible" aria-describedby=":Rr9ab:-loading-announcement" id=":Rr9ab:"><svg aria-hidden="true" focusable="false" class="octicon octicon-list-unordered" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom"><path d="M5.75 2.5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5Zm0 5h8.5a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5ZM2 14a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm1-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM2 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg></button></div><div class="Box-sc-g0xbh4-0 QkQOb js-snippet-clipboard-copy-unpositioned undefined" data-hpc="true"><article class="markdown-body entry-content container-lg" itemprop="text"><p dir="auto"><a href="https://github.com/nlohmann/json/releases"><img src="/nlohmann/json/raw/develop/docs/mkdocs/docs/images/json.gif" alt="JSON for Modern C++" data-animated-image="" style="max-width: 100%;"></a></p> <p dir="auto"><a href="https://ci.appveyor.com/project/nlohmann/json" rel="nofollow"><img src="https://camo.githubusercontent.com/edd68836500ad8d09155b045cde02e56cd95f1cdd19bebe9c347cfe4265b9198/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f3161636233363678667967337179626b2f6272616e63682f646576656c6f703f7376673d74727565" alt="Build Status" data-canonical-src="https://ci.appveyor.com/api/projects/status/1acb366xfyg3qybk/branch/develop?svg=true" style="max-width: 100%;"></a> <a href="https://github.com/nlohmann/json/actions?query=workflow%3AUbuntu"><img src="https://github.com/nlohmann/json/workflows/Ubuntu/badge.svg" alt="Ubuntu" style="max-width: 100%;"></a> <a href="https://github.com/nlohmann/json/actions?query=workflow%3AmacOS"><img src="https://github.com/nlohmann/json/workflows/macOS/badge.svg" alt="macOS" style="max-width: 100%;"></a> <a href="https://github.com/nlohmann/json/actions?query=workflow%3AWindows"><img src="https://github.com/nlohmann/json/workflows/Windows/badge.svg" alt="Windows" style="max-width: 100%;"></a> <a href="https://coveralls.io/github/nlohmann/json?branch=develop" rel="nofollow"><img src="https://camo.githubusercontent.com/2787aea563ab914b27d3cb496937660fdc1b7b6354aaf6ab6a2f26f48ba28d3e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e6c6f686d616e6e2f6a736f6e2f62616467652e7376673f6272616e63683d646576656c6f70" alt="Coverage Status" data-canonical-src="https://coveralls.io/repos/github/nlohmann/json/badge.svg?branch=develop" style="max-width: 100%;"></a> <a href="https://scan.coverity.com/projects/nlohmann-json" rel="nofollow"><img src="https://camo.githubusercontent.com/e86e5b2a7cde6a3f739deeb162abb2bfb046a026b428dbd41cbeb0bef7e4c4c2/68747470733a2f2f7363616e2e636f7665726974792e636f6d2f70726f6a656374732f353535302f62616467652e737667" alt="Coverity Scan Build Status" data-canonical-src="https://scan.coverity.com/projects/5550/badge.svg" style="max-width: 100%;"></a> <a href="https://app.codacy.com/gh/nlohmann/json/dashboard?utm_source=gh&amp;utm_medium=referral&amp;utm_content=&amp;utm_campaign=Badge_grade" rel="nofollow"><img src="https://camo.githubusercontent.com/adb256ade3511928a73d655dd85dca6b66b49f40f8a235cc35822ee314832573/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6530643161396435643666643436666362363535633463623933306262336538" alt="Codacy Badge" data-canonical-src="https://app.codacy.com/project/badge/Grade/e0d1a9d5d6fd46fcb655c4cb930bb3e8" style="max-width: 100%;"></a> <a href="https://cirrus-ci.com/github/nlohmann/json" rel="nofollow"><img src="https://camo.githubusercontent.com/e90101264d33507fe6c18740220432366a343c0bc68986aafa43fc83c5ed3d1a/68747470733a2f2f6170692e6369727275732d63692e636f6d2f6769746875622f6e6c6f686d616e6e2f6a736f6e2e737667" alt="Cirrus CI" data-canonical-src="https://api.cirrus-ci.com/github/nlohmann/json.svg" style="max-width: 100%;"></a> <a href="https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&amp;can=1&amp;q=proj:json" rel="nofollow"><img src="https://camo.githubusercontent.com/5e84b71074d9de291be80ac3931ca9f195144908750ad7320ad0cdf60d758606/68747470733a2f2f6f73732d66757a7a2d6275696c642d6c6f67732e73746f726167652e676f6f676c65617069732e636f6d2f6261646765732f6a736f6e2e737667" alt="Fuzzing Status" data-canonical-src="https://oss-fuzz-build-logs.storage.googleapis.com/badges/json.svg" style="max-width: 100%;"></a> <a href="https://wandbox.org/permlink/1mp10JbaANo6FUc7" rel="nofollow"><img src="https://camo.githubusercontent.com/d143e703ce01a12ed5273943c6dab84e0cfea2ab11db226bcbffdd5754a083e3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7472792d6f6e6c696e652d626c75652e737667" alt="Try online" data-canonical-src="https://img.shields.io/badge/try-online-blue.svg" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me" rel="nofollow"><img src="https://camo.githubusercontent.com/c5ede95d445ad5d9f5e365eb4f2314f84a0873e10bb5941fbb6e6290e28ca439/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d6d6b646f63732d626c75652e737667" alt="Documentation" data-canonical-src="https://img.shields.io/badge/docs-mkdocs-blue.svg" style="max-width: 100%;"></a> <a href="https://raw.githubusercontent.com/nlohmann/json/master/LICENSE.MIT" rel="nofollow"><img src="https://camo.githubusercontent.com/6581c31c16c1b13ddc2efb92e2ad69a93ddc4a92fd871ff15d401c4c6c9155a4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667" alt="GitHub license" data-canonical-src="https://img.shields.io/badge/license-MIT-blue.svg" style="max-width: 100%;"></a> <a href="https://github.com/nlohmann/json/releases"><img src="https://camo.githubusercontent.com/a8799678a3067f81afcedccd5dea79711ff511dd79510514a0d52de87bdab1af/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e6c6f686d616e6e2f6a736f6e2e737667" alt="GitHub Releases" data-canonical-src="https://img.shields.io/github/release/nlohmann/json.svg" style="max-width: 100%;"></a> <a href="https://repology.org/project/nlohmann-json/versions" rel="nofollow"><img src="https://camo.githubusercontent.com/6228104fb35a646eb103b776f16a9f5637b31f2275c42100113e369157a9e8df/68747470733a2f2f7265706f6c6f67792e6f72672f62616467652f74696e792d7265706f732f6e6c6f686d616e6e2d6a736f6e2e737667" alt="Packaging status" data-canonical-src="https://repology.org/badge/tiny-repos/nlohmann-json.svg" style="max-width: 100%;"></a> <a href="https://github.com/nlohmann/json/releases"><img src="https://camo.githubusercontent.com/f89c8366693cc5f6c35f61c50e4341db7b37e4a79f15196490ce956c7bd6898b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f6e6c6f686d616e6e2f6a736f6e2f746f74616c" alt="GitHub Downloads" data-canonical-src="https://img.shields.io/github/downloads/nlohmann/json/total" style="max-width: 100%;"></a> <a href="https://github.com/nlohmann/json/issues"><img src="https://camo.githubusercontent.com/42a1cb8f26c5f094c7f26b7d8b4c598c4dcfe222cb557f88844378b7d2654edc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6e6c6f686d616e6e2f6a736f6e2e737667" alt="GitHub Issues" data-canonical-src="https://img.shields.io/github/issues/nlohmann/json.svg" style="max-width: 100%;"></a> <a href="https://isitmaintained.com/project/nlohmann/json" title="Average time to resolve an issue" rel="nofollow"><img src="https://camo.githubusercontent.com/d25a4b6294dcd8b4ce26e4038ba5b891b5dcd65c1898d7bd18d8574672fb443e/68747470733a2f2f697369746d61696e7461696e65642e636f6d2f62616467652f7265736f6c7574696f6e2f6e6c6f686d616e6e2f6a736f6e2e737667" alt="Average time to resolve an issue" data-canonical-src="https://isitmaintained.com/badge/resolution/nlohmann/json.svg" style="max-width: 100%;"></a> <a href="https://bestpractices.coreinfrastructure.org/projects/289" rel="nofollow"><img src="https://camo.githubusercontent.com/2736df12905b69fec83f525f4edc9e6b39676732656df4bd348623fc58174707/68747470733a2f2f626573747072616374696365732e636f7265696e6672617374727563747572652e6f72672f70726f6a656374732f3238392f6261646765" alt="CII Best Practices" data-canonical-src="https://bestpractices.coreinfrastructure.org/projects/289/badge" style="max-width: 100%;"></a> <a href="https://scorecard.dev/viewer/?uri=github.com/nlohmann/json" rel="nofollow"><img src="https://camo.githubusercontent.com/f997411a438de53e94fb535bba862502c23b98085ee2ccc9852ef5586da9996e/68747470733a2f2f6170692e73636f7265636172642e6465762f70726f6a656374732f6769746875622e636f6d2f6e6c6f686d616e6e2f6a736f6e2f6261646765" alt="OpenSSF Scorecard" data-canonical-src="https://api.scorecard.dev/projects/github.com/nlohmann/json/badge" style="max-width: 100%;"></a> <a href="https://github.com/sponsors/nlohmann"><img src="https://camo.githubusercontent.com/557eb0d571bd9690353de596ded801b3fbcc641e939a616b8cd863c92b62d633/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d53706f6e736f72732d666636396234" alt="GitHub Sponsors" data-canonical-src="https://img.shields.io/badge/GitHub-Sponsors-ff69b4" style="max-width: 100%;"></a> <a href="https://api.reuse.software/info/github.com/nlohmann/json" rel="nofollow"><img src="https://camo.githubusercontent.com/3d31d4296b4445e5851d3099c10da0b1d7dadfadeacacfb92164116028542827/68747470733a2f2f6170692e72657573652e736f6674776172652f62616467652f6769746875622e636f6d2f6e6c6f686d616e6e2f6a736f6e" alt="REUSE status" data-canonical-src="https://api.reuse.software/badge/github.com/nlohmann/json" style="max-width: 100%;"></a> <a href="https://discord.gg/6mrGXKvX7y" rel="nofollow"><img src="https://camo.githubusercontent.com/6c2388179ca51e7faf2df1404491a97e477ee7213885e60ad1659a79b6fad641/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f31303033373433333134333431373933393133" alt="Discord" data-canonical-src="https://img.shields.io/discord/1003743314341793913" style="max-width: 100%;"></a></p> <ul dir="auto"> <li><a href="#design-goals">Design goals</a></li> <li><a href="#sponsors">Sponsors</a></li> <li><a href="#support">Support</a> (<a href="https://json.nlohmann.me" rel="nofollow">documentation</a>, <a href="https://json.nlohmann.me/home/faq/" rel="nofollow">FAQ</a>, <a href="https://github.com/nlohmann/json/discussions">discussions</a>, <a href="https://json.nlohmann.me/api/basic_json/" rel="nofollow">API</a>, <a href="https://github.com/nlohmann/json/issues">bug issues</a>)</li> <li><a href="#quick-reference">Quick reference</a></li> <li><a href="#examples">Examples</a> <ul dir="auto"> <li><a href="#read-json-from-a-file">Read JSON from a file</a></li> <li><a href="#creating-json-objects-from-json-literals">Creating <code>json</code> objects from JSON literals</a></li> <li><a href="#json-as-first-class-data-type">JSON as first-class data type</a></li> <li><a href="#serialization--deserialization">Serialization / Deserialization</a></li> <li><a href="#stl-like-access">STL-like access</a></li> <li><a href="#conversion-from-stl-containers">Conversion from STL containers</a></li> <li><a href="#json-pointer-and-json-patch">JSON Pointer and JSON Patch</a></li> <li><a href="#json-merge-patch">JSON Merge Patch</a></li> <li><a href="#implicit-conversions">Implicit conversions</a></li> <li><a href="#arbitrary-types-conversions">Conversions to/from arbitrary types</a></li> <li><a href="#specializing-enum-conversion">Specializing enum conversion</a></li> <li><a href="#binary-formats-bson-cbor-messagepack-ubjson-and-bjdata">Binary formats (BSON, CBOR, MessagePack, UBJSON, and BJData)</a></li> </ul> </li> <li><a href="#customers">Customers</a></li> <li><a href="#supported-compilers">Supported compilers</a></li> <li><a href="#integration">Integration</a> <ul dir="auto"> <li><a href="#cmake">CMake</a></li> <li><a href="#package-managers">Package Managers</a></li> <li><a href="#pkg-config">Pkg-config</a></li> </ul> </li> <li><a href="#license">License</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#thanks">Thanks</a></li> <li><a href="#used-third-party-tools">Used third-party tools</a></li> <li><a href="#notes">Notes</a></li> <li><a href="#execute-unit-tests">Execute unit tests</a></li> </ul> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Design goals</h2><a id="user-content-design-goals" class="anchor" aria-label="Permalink: Design goals" href="#design-goals"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">There are myriads of <a href="https://json.org" rel="nofollow">JSON</a> libraries out there, and each may even have its reason to exist. Our class had these design goals:</p> <ul dir="auto"> <li> <p dir="auto"><strong>Intuitive syntax</strong>. In languages such as Python, JSON feels like a first class data type. We used all the operator magic of modern C++ to achieve the same feeling in your code. Check out the <a href="#examples">examples below</a> and you'll know what I mean.</p> </li> <li> <p dir="auto"><strong>Trivial integration</strong>. Our whole code consists of a single header file <a href="https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp"><code>json.hpp</code></a>. That's it. No library, no subproject, no dependencies, no complex build system. The class is written in vanilla C++11. All in all, everything should require no adjustment of your compiler flags or project settings. The library is also included in all popular <a href="https://json.nlohmann.me/integration/package_managers/" rel="nofollow">package managers</a>.</p> </li> <li> <p dir="auto"><strong>Serious testing</strong>. Our code is heavily <a href="https://github.com/nlohmann/json/tree/develop/tests/src">unit-tested</a> and covers <a href="https://coveralls.io/r/nlohmann/json" rel="nofollow">100%</a> of the code, including all exceptional behavior. Furthermore, we checked with <a href="https://valgrind.org" rel="nofollow">Valgrind</a> and the <a href="https://clang.llvm.org/docs/index.html" rel="nofollow">Clang Sanitizers</a> that there are no memory leaks. <a href="https://github.com/google/oss-fuzz/tree/master/projects/json">Google OSS-Fuzz</a> additionally runs fuzz tests against all parsers 24/7, effectively executing billions of tests so far. To maintain high quality, the project is following the <a href="https://bestpractices.coreinfrastructure.org/projects/289" rel="nofollow">Core Infrastructure Initiative (CII) best practices</a>. See the <a href="https://json.nlohmann.me/community/quality_assurance" rel="nofollow">quality assurance</a> overview documentation.</p> </li> </ul> <p dir="auto">Other aspects were not so important to us:</p> <ul dir="auto"> <li> <p dir="auto"><strong>Memory efficiency</strong>. Each JSON object has an overhead of one pointer (the maximal size of a union) and one enumeration element (1 byte). The default generalization uses the following C++ data types: <code>std::string</code> for strings, <code>int64_t</code>, <code>uint64_t</code> or <code>double</code> for numbers, <code>std::map</code> for objects, <code>std::vector</code> for arrays, and <code>bool</code> for Booleans. However, you can template the generalized class <code>basic_json</code> to your needs.</p> </li> <li> <p dir="auto"><strong>Speed</strong>. There are certainly <a href="https://github.com/miloyip/nativejson-benchmark#parsing-time">faster JSON libraries</a> out there. However, if your goal is to speed up your development by adding JSON support with a single header, then this library is the way to go. If you know how to use a <code>std::vector</code> or <code>std::map</code>, you are already set.</p> </li> </ul> <p dir="auto">See the <a href="https://github.com/nlohmann/json/blob/master/.github/CONTRIBUTING.md#please-dont">contribution guidelines</a> for more information.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Sponsors</h2><a id="user-content-sponsors" class="anchor" aria-label="Permalink: Sponsors" href="#sponsors"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">You can sponsor this library at <a href="https://github.com/sponsors/nlohmann">GitHub Sponsors</a>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">🙋 Priority Sponsor</h3><a id="user-content-raising_hand-priority-sponsor" class="anchor" aria-label="Permalink: :raising_hand: Priority Sponsor" href="#raising_hand-priority-sponsor"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul dir="auto"> <li><a href="https://github.com/codeclown">Martti Laine</a></li> <li><a href="https://github.com/phrrngtn">Paul Harrington</a></li> </ul> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">🏷️ Named Sponsors</h3><a id="user-content-label-named-sponsors" class="anchor" aria-label="Permalink: :label: Named Sponsors" href="#label-named-sponsors"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul dir="auto"> <li><a href="https://github.com/reFX-Mike">Michael Hartmann</a></li> <li><a href="https://github.com/sthagen">Stefan Hagen</a></li> <li><a href="https://github.com/homer6">Steve Sperandeo</a></li> <li><a href="https://github.com/eljefedelrodeodeljefe">Robert Jefe Lindstädt</a></li> <li><a href="https://github.com/ciroque">Steve Wagner</a></li> <li><a href="https://github.com/LionNatsu">Lion Yang</a></li> </ul> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Further support</h3><a id="user-content-further-support" class="anchor" aria-label="Permalink: Further support" href="#further-support"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The development of the library is further supported by JetBrains by providing free access to their IDE tools.</p> <p dir="auto"><a href="https://jb.gg/OpenSourceSupport" rel="nofollow"><img src="https://camo.githubusercontent.com/10b97e557d8d32622250903852c1b2db59c5d29d431bc3b2a0e55301219150b7/68747470733a2f2f7265736f75726365732e6a6574627261696e732e636f6d2f73746f726167652f70726f64756374732f636f6d70616e792f6272616e642f6c6f676f732f6a6574627261696e732e737667" alt="JetBrains logo." data-canonical-src="https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg" style="max-width: 100%;"></a></p> <p dir="auto">Thanks everyone!</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Support</h2><a id="user-content-support" class="anchor" aria-label="Permalink: Support" href="#support"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">❓ If you have a <strong>question</strong>, please check if it is already answered in the <a href="https://json.nlohmann.me/home/faq/" rel="nofollow"><strong>FAQ</strong></a> or the <a href="https://github.com/nlohmann/json/discussions/categories/q-a"><strong>Q&amp;A</strong></a> section. If not, please <a href="https://github.com/nlohmann/json/discussions/new"><strong>ask a new question</strong></a> there.</p> <p dir="auto">📚 If you want to <strong>learn more</strong> about how to use the library, check out the rest of the <a href="#examples"><strong>README</strong></a>, have a look at <a href="https://github.com/nlohmann/json/tree/develop/docs/mkdocs/docs/examples"><strong>code examples</strong></a>, or browse through the <a href="https://json.nlohmann.me" rel="nofollow"><strong>help pages</strong></a>.</p> <p dir="auto">🚧 If you want to understand the <strong>API</strong> better, check out the <a href="https://json.nlohmann.me/api/basic_json/" rel="nofollow"><strong>API Reference</strong></a> or have a look at the <a href="#quick-reference">quick reference</a> below.</p> <p dir="auto">🐛 If you found a <strong>bug</strong>, please check the <a href="https://json.nlohmann.me/home/faq/" rel="nofollow"><strong>FAQ</strong></a> if it is a known issue or the result of a design decision. Please also have a look at the <a href="https://github.com/nlohmann/json/issues"><strong>issue list</strong></a> before you <a href="https://github.com/nlohmann/json/issues/new/choose"><strong>create a new issue</strong></a>. Please provide as much information as possible to help us understand and reproduce your issue.</p> <p dir="auto">There is also a <a href="https://github.com/Kapeli/Dash-User-Contributions/tree/master/docsets/JSON_for_Modern_C%2B%2B"><strong>docset</strong></a> for the documentation browsers <a href="https://kapeli.com/dash" rel="nofollow">Dash</a>, <a href="https://velocity.silverlakesoftware.com" rel="nofollow">Velocity</a>, and <a href="https://zealdocs.org" rel="nofollow">Zeal</a> that contains the full <a href="https://json.nlohmann.me" rel="nofollow">documentation</a> as offline resource.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Quick reference</h2><a id="user-content-quick-reference" class="anchor" aria-label="Permalink: Quick reference" href="#quick-reference"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul dir="auto"> <li><strong>Constructors</strong> <a href="https://json.nlohmann.me/api/basic_json/basic_json" rel="nofollow">basic_json</a>, <a href="https://json.nlohmann.me/api/basic_json/array" rel="nofollow">array</a>, <a href="https://json.nlohmann.me/api/basic_json/binary" rel="nofollow">binary</a>, <a href="https://json.nlohmann.me/api/basic_json/object" rel="nofollow">object</a></li> <li><strong>Object inspection</strong>: <a href="https://json.nlohmann.me/api/basic_json/type" rel="nofollow">type</a>, <a href="https://json.nlohmann.me/api/basic_json/operator_value_t" rel="nofollow">operator value_t</a>, <a href="https://json.nlohmann.me/api/basic_json/type_name" rel="nofollow">type_name</a>, <a href="https://json.nlohmann.me/api/basic_json/is_primitive" rel="nofollow">is_primitive</a>, <a href="https://json.nlohmann.me/api/basic_json/is_structured" rel="nofollow">is_structured</a>, <a href="https://json.nlohmann.me/api/basic_json/is_null" rel="nofollow">is_null</a>, <a href="https://json.nlohmann.me/api/basic_json/is_boolean" rel="nofollow">is_boolean</a>, <a href="https://json.nlohmann.me/api/basic_json/is_number" rel="nofollow">is_number</a>, <a href="https://json.nlohmann.me/api/basic_json/is_number_integer" rel="nofollow">is_number_integer</a>, <a href="https://json.nlohmann.me/api/basic_json/is_number_unsigned" rel="nofollow">is_number_unsigned</a>, <a href="https://json.nlohmann.me/api/basic_json/is_number_float" rel="nofollow">is_number_float</a>, <a href="https://json.nlohmann.me/api/basic_json/is_object" rel="nofollow">is_object</a>, <a href="https://json.nlohmann.me/api/basic_json/is_array" rel="nofollow">is_array</a>, <a href="https://json.nlohmann.me/api/basic_json/is_string" rel="nofollow">is_string</a>, <a href="https://json.nlohmann.me/api/basic_json/is_binary" rel="nofollow">is_binary</a>, <a href="https://json.nlohmann.me/api/basic_json/is_discarded" rel="nofollow">is_discarded</a></li> <li><strong>Value access</strong>; <a href="https://json.nlohmann.me/api/basic_json/get" rel="nofollow">get</a>, <a href="https://json.nlohmann.me/api/basic_json/get_to" rel="nofollow">get_to</a>, <a href="https://json.nlohmann.me/api/basic_json/get_ptr" rel="nofollow">get_ptr</a>, <a href="https://json.nlohmann.me/api/basic_json/get_ref" rel="nofollow">get_ref</a>, <a href="https://json.nlohmann.me/api/basic_json/operator_ValueType" rel="nofollow">operator ValueType</a>, <a href="https://json.nlohmann.me/api/basic_json/get_binary" rel="nofollow">get_binary</a></li> <li><strong>Element access</strong>: <a href="https://json.nlohmann.me/api/basic_json/at" rel="nofollow">at</a>, <a href="https://json.nlohmann.me/api/basic_json/operator%5B%5D" rel="nofollow">operator[]</a>, <a href="https://json.nlohmann.me/api/basic_json/value" rel="nofollow">value</a>, <a href="https://json.nlohmann.me/api/basic_json/front" rel="nofollow">front</a>, <a href="https://json.nlohmann.me/api/basic_json/back" rel="nofollow">back</a></li> <li><strong>Lookup</strong>: <a href="https://json.nlohmann.me/api/basic_json/find" rel="nofollow">find</a>, <a href="https://json.nlohmann.me/api/basic_json/count" rel="nofollow">count</a>, <a href="https://json.nlohmann.me/api/basic_json/contains" rel="nofollow">contains</a></li> <li><strong>Iterators</strong>: <a href="https://json.nlohmann.me/api/basic_json/begin" rel="nofollow">begin</a>, <a href="https://json.nlohmann.me/api/basic_json/cbegin" rel="nofollow">cbegin</a>, <a href="https://json.nlohmann.me/api/basic_json/end" rel="nofollow">end</a>, <a href="https://json.nlohmann.me/api/basic_json/cend" rel="nofollow">cend</a>, <a href="https://json.nlohmann.me/api/basic_json/rbegin" rel="nofollow">rbegin</a>, <a href="https://json.nlohmann.me/api/basic_json/rend" rel="nofollow">rend</a>, <a href="https://json.nlohmann.me/api/basic_json/crbegin" rel="nofollow">crbegin</a>, <a href="https://json.nlohmann.me/api/basic_json/crend" rel="nofollow">crend</a>, <a href="https://json.nlohmann.me/api/basic_json/items" rel="nofollow">items</a></li> <li><strong>Capacity</strong>: <a href="https://json.nlohmann.me/api/basic_json/empty" rel="nofollow">empty</a>, <a href="https://json.nlohmann.me/api/basic_json/size" rel="nofollow">size</a>, <a href="https://json.nlohmann.me/api/basic_json/max_size" rel="nofollow">max_size</a></li> <li><strong>Modifiers</strong>: <a href="https://json.nlohmann.me/api/basic_json/clear" rel="nofollow">clear</a>, <a href="https://json.nlohmann.me/api/basic_json/push_back" rel="nofollow">push_back</a>, <a href="https://json.nlohmann.me/api/basic_json/operator+=" rel="nofollow">operator+=</a>, <a href="https://json.nlohmann.me/api/basic_json/emplace_back" rel="nofollow">emplace_back</a>, <a href="https://json.nlohmann.me/api/basic_json/emplace" rel="nofollow">emplace</a>, <a href="https://json.nlohmann.me/api/basic_json/erase" rel="nofollow">erase</a>, <a href="https://json.nlohmann.me/api/basic_json/insert" rel="nofollow">insert</a>, <a href="https://json.nlohmann.me/api/basic_json/update" rel="nofollow">update</a>, <a href="https://json.nlohmann.me/api/basic_json/swap" rel="nofollow">swap</a></li> <li><strong>Lexicographical comparison operators</strong>: <a href="https://json.nlohmann.me/api/basic_json/operator_eq" rel="nofollow">operator==</a>, <a href="https://json.nlohmann.me/api/basic_json/operator_ne" rel="nofollow">operator!=</a>, <a href="https://json.nlohmann.me/api/basic_json/operator_lt" rel="nofollow">operator&lt;</a>, <a href="https://json.nlohmann.me/api/basic_json/operator_gt" rel="nofollow">operator&gt;</a>, <a href="https://json.nlohmann.me/api/basic_json/operator_le" rel="nofollow">operator&lt;=</a>, <a href="https://json.nlohmann.me/api/basic_json/operator_ge" rel="nofollow">operator&gt;=</a>, <a href="https://json.nlohmann.me/api/basic_json/operator_spaceship" rel="nofollow">operator&lt;=&gt;</a></li> <li><strong>Serialization / Dumping</strong>: <a href="https://json.nlohmann.me/api/basic_json/dump" rel="nofollow">dump</a></li> <li><strong>Deserialization / Parsing</strong>: <a href="https://json.nlohmann.me/api/basic_json/parse" rel="nofollow">parse</a>, <a href="https://json.nlohmann.me/api/basic_json/accept" rel="nofollow">accept</a>, <a href="https://json.nlohmann.me/api/basic_json/sax_parse" rel="nofollow">sax_parse</a></li> <li><strong>JSON Pointer functions</strong>: <a href="https://json.nlohmann.me/api/basic_json/flatten" rel="nofollow">flatten</a>, <a href="https://json.nlohmann.me/api/basic_json/unflatten" rel="nofollow">unflatten</a></li> <li><strong>JSON Patch functions</strong>: <a href="https://json.nlohmann.me/api/basic_json/patch" rel="nofollow">patch</a>, <a href="https://json.nlohmann.me/api/basic_json/patch_inplace" rel="nofollow">patch_inplace</a>, <a href="https://json.nlohmann.me/api/basic_json/diff" rel="nofollow">diff</a>, <a href="https://json.nlohmann.me/api/basic_json/merge_patch" rel="nofollow">merge_patch</a></li> <li><strong>Static functions</strong>: <a href="https://json.nlohmann.me/api/basic_json/meta" rel="nofollow">meta</a>, <a href="https://json.nlohmann.me/api/basic_json/get_allocator" rel="nofollow">get_allocator</a></li> <li><strong>Binary formats</strong>: <a href="https://json.nlohmann.me/api/basic_json/from_bjdata" rel="nofollow">from_bjdata</a>, <a href="https://json.nlohmann.me/api/basic_json/from_bson" rel="nofollow">from_bson</a>, <a href="https://json.nlohmann.me/api/basic_json/from_cbor" rel="nofollow">from_cbor</a>, <a href="https://json.nlohmann.me/api/basic_json/from_msgpack" rel="nofollow">from_msgpack</a>, <a href="https://json.nlohmann.me/api/basic_json/from_ubjson" rel="nofollow">from_ubjson</a>, <a href="https://json.nlohmann.me/api/basic_json/to_bjdata" rel="nofollow">to_bjdata</a>, <a href="https://json.nlohmann.me/api/basic_json/to_bson" rel="nofollow">to_bson</a>, <a href="https://json.nlohmann.me/api/basic_json/to_cbor" rel="nofollow">to_cbor</a>, <a href="https://json.nlohmann.me/api/basic_json/to_msgpack" rel="nofollow">to_msgpack</a>, <a href="https://json.nlohmann.me/api/basic_json/to_ubjson" rel="nofollow">to_ubjson</a></li> <li><strong>Non-member functions</strong>: <a href="https://json.nlohmann.me/api/operator_ltlt/" rel="nofollow">operator&lt;&lt;</a>, <a href="https://json.nlohmann.me/api/operator_gtgt/" rel="nofollow">operator&gt;&gt;</a>, <a href="https://json.nlohmann.me/api/basic_json/to_string" rel="nofollow">to_string</a></li> <li><strong>Literals</strong>: <a href="https://json.nlohmann.me/api/operator_literal_json" rel="nofollow">operator""_json</a></li> <li><strong>Helper classes</strong>: <a href="https://json.nlohmann.me/api/basic_json/std_hash" rel="nofollow">std::hash&lt;basic_json&gt;</a>, <a href="https://json.nlohmann.me/api/basic_json/std_swap" rel="nofollow">std::swap&lt;basic_json&gt;</a></li> </ul> <p dir="auto"><a href="https://json.nlohmann.me/api/basic_json/" rel="nofollow"><strong>Full API documentation</strong></a></p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Examples</h2><a id="user-content-examples" class="anchor" aria-label="Permalink: Examples" href="#examples"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Here are some examples to give you an idea how to use the class.</p> <p dir="auto">Beside the examples below, you may want to:</p> <p dir="auto">→ Check the <a href="https://json.nlohmann.me/" rel="nofollow">documentation</a><br> → Browse the <a href="https://github.com/nlohmann/json/tree/develop/docs/mkdocs/docs/examples">standalone example files</a><br> → Read the full <a href="https://json.nlohmann.me/api/basic_json/" rel="nofollow">API Documentation</a> with self-contained examples for every function</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Read JSON from a file</h3><a id="user-content-read-json-from-a-file" class="anchor" aria-label="Permalink: Read JSON from a file" href="#read-json-from-a-file"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The <code>json</code> class provides an API for manipulating a JSON value. To create a <code>json</code> object by reading a JSON file:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#include &lt;fstream&gt; #include &lt;nlohmann/json.hpp&gt; using json = nlohmann::json; // ... std::ifstream f(&quot;example.json&quot;); json data = json::parse(f);"><pre>#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>fstream<span class="pl-pds">&gt;</span></span> #<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>nlohmann/json.hpp<span class="pl-pds">&gt;</span></span> <span class="pl-k">using</span> json = nlohmann::json; <span class="pl-c"><span class="pl-c">//</span> ...</span> std::ifstream <span class="pl-en">f</span>(<span class="pl-s"><span class="pl-pds">"</span>example.json<span class="pl-pds">"</span></span>); json data = json::parse(f);</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Creating <code>json</code> objects from JSON literals</h3><a id="user-content-creating-json-objects-from-json-literals" class="anchor" aria-label="Permalink: Creating json objects from JSON literals" href="#creating-json-objects-from-json-literals"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Assume you want to create hard-code this literal JSON value in a file, as a <code>json</code> object:</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ &quot;pi&quot;: 3.141, &quot;happy&quot;: true }"><pre>{ <span class="pl-ent">"pi"</span>: <span class="pl-c1">3.141</span>, <span class="pl-ent">"happy"</span>: <span class="pl-c1">true</span> }</pre></div> <p dir="auto">There are various options:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Using (raw) string literals and json::parse json ex1 = json::parse(R&quot;( { &quot;pi&quot;: 3.141, &quot;happy&quot;: true } )&quot;); // Using user-defined (raw) string literals using namespace nlohmann::literals; json ex2 = R&quot;( { &quot;pi&quot;: 3.141, &quot;happy&quot;: true } )&quot;_json; // Using initializer lists json ex3 = { {&quot;happy&quot;, true}, {&quot;pi&quot;, 3.141}, };"><pre><span class="pl-c"><span class="pl-c">//</span> Using (raw) string literals and json::parse</span> json ex1 = json::parse(<span class="pl-s"><span class="pl-pds">R"(</span></span> <span class="pl-s"> {</span> <span class="pl-s"> "pi": 3.141,</span> <span class="pl-s"> "happy": true</span> <span class="pl-s"> }</span> <span class="pl-s"><span class="pl-pds">)"</span></span>); <span class="pl-c"><span class="pl-c">//</span> Using user-defined (raw) string literals</span> <span class="pl-k">using</span> <span class="pl-k">namespace</span> <span class="pl-en">nlohmann</span>::literals<span class="pl-k">;</span> json ex2 = <span class="pl-s"><span class="pl-pds">R"(</span></span> <span class="pl-s"> {</span> <span class="pl-s"> "pi": 3.141,</span> <span class="pl-s"> "happy": true</span> <span class="pl-s"> }</span> <span class="pl-s"><span class="pl-pds">)"</span></span>_json; <span class="pl-c"><span class="pl-c">//</span> Using initializer lists</span> json ex3 = { {<span class="pl-s"><span class="pl-pds">"</span>happy<span class="pl-pds">"</span></span>, <span class="pl-c1">true</span>}, {<span class="pl-s"><span class="pl-pds">"</span>pi<span class="pl-pds">"</span></span>, <span class="pl-c1">3.141</span>}, };</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">JSON as first-class data type</h3><a id="user-content-json-as-first-class-data-type" class="anchor" aria-label="Permalink: JSON as first-class data type" href="#json-as-first-class-data-type"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Here are some examples to give you an idea how to use the class.</p> <p dir="auto">Assume you want to create the JSON object</p> <div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{ &quot;pi&quot;: 3.141, &quot;happy&quot;: true, &quot;name&quot;: &quot;Niels&quot;, &quot;nothing&quot;: null, &quot;answer&quot;: { &quot;everything&quot;: 42 }, &quot;list&quot;: [1, 0, 2], &quot;object&quot;: { &quot;currency&quot;: &quot;USD&quot;, &quot;value&quot;: 42.99 } }"><pre>{ <span class="pl-ent">"pi"</span>: <span class="pl-c1">3.141</span>, <span class="pl-ent">"happy"</span>: <span class="pl-c1">true</span>, <span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>Niels<span class="pl-pds">"</span></span>, <span class="pl-ent">"nothing"</span>: <span class="pl-c1">null</span>, <span class="pl-ent">"answer"</span>: { <span class="pl-ent">"everything"</span>: <span class="pl-c1">42</span> }, <span class="pl-ent">"list"</span>: [<span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">2</span>], <span class="pl-ent">"object"</span>: { <span class="pl-ent">"currency"</span>: <span class="pl-s"><span class="pl-pds">"</span>USD<span class="pl-pds">"</span></span>, <span class="pl-ent">"value"</span>: <span class="pl-c1">42.99</span> } }</pre></div> <p dir="auto">With this library, you could write:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// create an empty structure (null) json j; // add a number that is stored as double (note the implicit conversion of j to an object) j[&quot;pi&quot;] = 3.141; // add a Boolean that is stored as bool j[&quot;happy&quot;] = true; // add a string that is stored as std::string j[&quot;name&quot;] = &quot;Niels&quot;; // add another null object by passing nullptr j[&quot;nothing&quot;] = nullptr; // add an object inside the object j[&quot;answer&quot;][&quot;everything&quot;] = 42; // add an array that is stored as std::vector (using an initializer list) j[&quot;list&quot;] = { 1, 0, 2 }; // add another object (using an initializer list of pairs) j[&quot;object&quot;] = { {&quot;currency&quot;, &quot;USD&quot;}, {&quot;value&quot;, 42.99} }; // instead, you could also write (which looks very similar to the JSON above) json j2 = { {&quot;pi&quot;, 3.141}, {&quot;happy&quot;, true}, {&quot;name&quot;, &quot;Niels&quot;}, {&quot;nothing&quot;, nullptr}, {&quot;answer&quot;, { {&quot;everything&quot;, 42} }}, {&quot;list&quot;, {1, 0, 2}}, {&quot;object&quot;, { {&quot;currency&quot;, &quot;USD&quot;}, {&quot;value&quot;, 42.99} }} };"><pre><span class="pl-c"><span class="pl-c">//</span> create an empty structure (null)</span> json j; <span class="pl-c"><span class="pl-c">//</span> add a number that is stored as double (note the implicit conversion of j to an object)</span> j[<span class="pl-s"><span class="pl-pds">"</span>pi<span class="pl-pds">"</span></span>] = <span class="pl-c1">3.141</span>; <span class="pl-c"><span class="pl-c">//</span> add a Boolean that is stored as bool</span> j[<span class="pl-s"><span class="pl-pds">"</span>happy<span class="pl-pds">"</span></span>] = <span class="pl-c1">true</span>; <span class="pl-c"><span class="pl-c">//</span> add a string that is stored as std::string</span> j[<span class="pl-s"><span class="pl-pds">"</span>name<span class="pl-pds">"</span></span>] = <span class="pl-s"><span class="pl-pds">"</span>Niels<span class="pl-pds">"</span></span>; <span class="pl-c"><span class="pl-c">//</span> add another null object by passing nullptr</span> j[<span class="pl-s"><span class="pl-pds">"</span>nothing<span class="pl-pds">"</span></span>] = <span class="pl-c1">nullptr</span>; <span class="pl-c"><span class="pl-c">//</span> add an object inside the object</span> j[<span class="pl-s"><span class="pl-pds">"</span>answer<span class="pl-pds">"</span></span>][<span class="pl-s"><span class="pl-pds">"</span>everything<span class="pl-pds">"</span></span>] = <span class="pl-c1">42</span>; <span class="pl-c"><span class="pl-c">//</span> add an array that is stored as std::vector (using an initializer list)</span> j[<span class="pl-s"><span class="pl-pds">"</span>list<span class="pl-pds">"</span></span>] = { <span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">2</span> }; <span class="pl-c"><span class="pl-c">//</span> add another object (using an initializer list of pairs)</span> j[<span class="pl-s"><span class="pl-pds">"</span>object<span class="pl-pds">"</span></span>] = { {<span class="pl-s"><span class="pl-pds">"</span>currency<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>USD<span class="pl-pds">"</span></span>}, {<span class="pl-s"><span class="pl-pds">"</span>value<span class="pl-pds">"</span></span>, <span class="pl-c1">42.99</span>} }; <span class="pl-c"><span class="pl-c">//</span> instead, you could also write (which looks very similar to the JSON above)</span> json j2 = { {<span class="pl-s"><span class="pl-pds">"</span>pi<span class="pl-pds">"</span></span>, <span class="pl-c1">3.141</span>}, {<span class="pl-s"><span class="pl-pds">"</span>happy<span class="pl-pds">"</span></span>, <span class="pl-c1">true</span>}, {<span class="pl-s"><span class="pl-pds">"</span>name<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>Niels<span class="pl-pds">"</span></span>}, {<span class="pl-s"><span class="pl-pds">"</span>nothing<span class="pl-pds">"</span></span>, <span class="pl-c1">nullptr</span>}, {<span class="pl-s"><span class="pl-pds">"</span>answer<span class="pl-pds">"</span></span>, { {<span class="pl-s"><span class="pl-pds">"</span>everything<span class="pl-pds">"</span></span>, <span class="pl-c1">42</span>} }}, {<span class="pl-s"><span class="pl-pds">"</span>list<span class="pl-pds">"</span></span>, {<span class="pl-c1">1</span>, <span class="pl-c1">0</span>, <span class="pl-c1">2</span>}}, {<span class="pl-s"><span class="pl-pds">"</span>object<span class="pl-pds">"</span></span>, { {<span class="pl-s"><span class="pl-pds">"</span>currency<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>USD<span class="pl-pds">"</span></span>}, {<span class="pl-s"><span class="pl-pds">"</span>value<span class="pl-pds">"</span></span>, <span class="pl-c1">42.99</span>} }} };</pre></div> <p dir="auto">Note that in all these cases, you never need to "tell" the compiler which JSON value type you want to use. If you want to be explicit or express some edge cases, the functions <a href="https://json.nlohmann.me/api/basic_json/array/" rel="nofollow"><code>json::array()</code></a> and <a href="https://json.nlohmann.me/api/basic_json/object/" rel="nofollow"><code>json::object()</code></a> will help:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// a way to express the empty array [] json empty_array_explicit = json::array(); // ways to express the empty object {} json empty_object_implicit = json({}); json empty_object_explicit = json::object(); // a way to express an _array_ of key/value pairs [[&quot;currency&quot;, &quot;USD&quot;], [&quot;value&quot;, 42.99]] json array_not_object = json::array({ {&quot;currency&quot;, &quot;USD&quot;}, {&quot;value&quot;, 42.99} });"><pre><span class="pl-c"><span class="pl-c">//</span> a way to express the empty array []</span> json empty_array_explicit = json::array(); <span class="pl-c"><span class="pl-c">//</span> ways to express the empty object {}</span> json empty_object_implicit = json({}); json empty_object_explicit = json::object(); <span class="pl-c"><span class="pl-c">//</span> a way to express an _array_ of key/value pairs [["currency", "USD"], ["value", 42.99]]</span> json array_not_object = json::array({ {<span class="pl-s"><span class="pl-pds">"</span>currency<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>USD<span class="pl-pds">"</span></span>}, {<span class="pl-s"><span class="pl-pds">"</span>value<span class="pl-pds">"</span></span>, <span class="pl-c1">42.99</span>} });</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Serialization / Deserialization</h3><a id="user-content-serialization--deserialization" class="anchor" aria-label="Permalink: Serialization / Deserialization" href="#serialization--deserialization"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">To/from strings</h4><a id="user-content-tofrom-strings" class="anchor" aria-label="Permalink: To/from strings" href="#tofrom-strings"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">You can create a JSON value (deserialization) by appending <code>_json</code> to a string literal:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// create object from string literal json j = &quot;{ \&quot;happy\&quot;: true, \&quot;pi\&quot;: 3.141 }&quot;_json; // or even nicer with a raw string literal auto j2 = R&quot;( { &quot;happy&quot;: true, &quot;pi&quot;: 3.141 } )&quot;_json;"><pre><span class="pl-c"><span class="pl-c">//</span> create object from string literal</span> json j = <span class="pl-s"><span class="pl-pds">"</span>{ <span class="pl-cce">\"</span>happy<span class="pl-cce">\"</span>: true, <span class="pl-cce">\"</span>pi<span class="pl-cce">\"</span>: 3.141 }<span class="pl-pds">"</span></span>_json; <span class="pl-c"><span class="pl-c">//</span> or even nicer with a raw string literal</span> <span class="pl-k">auto</span> j2 = <span class="pl-s"><span class="pl-pds">R"(</span></span> <span class="pl-s"> {</span> <span class="pl-s"> "happy": true,</span> <span class="pl-s"> "pi": 3.141</span> <span class="pl-s"> }</span> <span class="pl-s"><span class="pl-pds">)"</span></span>_json;</pre></div> <p dir="auto">Note that without appending the <code>_json</code> suffix, the passed string literal is not parsed, but just used as JSON string value. That is, <code>json j = "{ \"happy\": true, \"pi\": 3.141 }"</code> would just store the string <code>"{ "happy": true, "pi": 3.141 }"</code> rather than parsing the actual object.</p> <p dir="auto">The string literal should be brought into scope with <code>using namespace nlohmann::literals;</code> (see <a href="https://json.nlohmann.me/api/operator_literal_json/" rel="nofollow"><code>json::parse()</code></a>).</p> <p dir="auto">The above example can also be expressed explicitly using <a href="https://json.nlohmann.me/api/basic_json/parse/" rel="nofollow"><code>json::parse()</code></a>:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// parse explicitly auto j3 = json::parse(R&quot;({&quot;happy&quot;: true, &quot;pi&quot;: 3.141})&quot;);"><pre><span class="pl-c"><span class="pl-c">//</span> parse explicitly</span> <span class="pl-k">auto</span> j3 = json::parse(<span class="pl-s"><span class="pl-pds">R"(</span>{"happy": true, "pi": 3.141}<span class="pl-pds">)"</span></span>);</pre></div> <p dir="auto">You can also get a string representation of a JSON value (serialize):</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// explicit conversion to string std::string s = j.dump(); // {&quot;happy&quot;:true,&quot;pi&quot;:3.141} // serialization with pretty printing // pass in the amount of spaces to indent std::cout &lt;&lt; j.dump(4) &lt;&lt; std::endl; // { // &quot;happy&quot;: true, // &quot;pi&quot;: 3.141 // }"><pre><span class="pl-c"><span class="pl-c">//</span> explicit conversion to string</span> std::string s = j.dump(); <span class="pl-c"><span class="pl-c">//</span> {"happy":true,"pi":3.141}</span> <span class="pl-c"><span class="pl-c">//</span> serialization with pretty printing</span> <span class="pl-c"><span class="pl-c">//</span> pass in the amount of spaces to indent</span> std::cout &lt;&lt; j.dump(<span class="pl-c1">4</span>) &lt;&lt; std::endl; <span class="pl-c"><span class="pl-c">//</span> {</span> <span class="pl-c"><span class="pl-c">//</span> "happy": true,</span> <span class="pl-c"><span class="pl-c">//</span> "pi": 3.141</span> <span class="pl-c"><span class="pl-c">//</span> }</span></pre></div> <p dir="auto">Note the difference between serialization and assignment:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// store a string in a JSON value json j_string = &quot;this is a string&quot;; // retrieve the string value auto cpp_string = j_string.template get&lt;std::string&gt;(); // retrieve the string value (alternative when a variable already exists) std::string cpp_string2; j_string.get_to(cpp_string2); // retrieve the serialized value (explicit JSON serialization) std::string serialized_string = j_string.dump(); // output of original string std::cout &lt;&lt; cpp_string &lt;&lt; &quot; == &quot; &lt;&lt; cpp_string2 &lt;&lt; &quot; == &quot; &lt;&lt; j_string.template get&lt;std::string&gt;() &lt;&lt; '\n'; // output of serialized value std::cout &lt;&lt; j_string &lt;&lt; &quot; == &quot; &lt;&lt; serialized_string &lt;&lt; std::endl;"><pre><span class="pl-c"><span class="pl-c">//</span> store a string in a JSON value</span> json j_string = <span class="pl-s"><span class="pl-pds">"</span>this is a string<span class="pl-pds">"</span></span>; <span class="pl-c"><span class="pl-c">//</span> retrieve the string value</span> <span class="pl-k">auto</span> cpp_string = j_string.<span class="pl-k">template </span>get&lt;std::string&gt;(); <span class="pl-c"><span class="pl-c">//</span> retrieve the string value (alternative when a variable already exists)</span> std::string cpp_string2; j_string.get_to(cpp_string2); <span class="pl-c"><span class="pl-c">//</span> retrieve the serialized value (explicit JSON serialization)</span> std::string serialized_string = j_string.dump(); <span class="pl-c"><span class="pl-c">//</span> output of original string</span> std::cout &lt;&lt; cpp_string &lt;&lt; <span class="pl-s"><span class="pl-pds">"</span> == <span class="pl-pds">"</span></span> &lt;&lt; cpp_string2 &lt;&lt; <span class="pl-s"><span class="pl-pds">"</span> == <span class="pl-pds">"</span></span> &lt;&lt; j_string.<span class="pl-k">template </span>get&lt;std::string&gt;() &lt;&lt; <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\n</span><span class="pl-pds">'</span></span>; <span class="pl-c"><span class="pl-c">//</span> output of serialized value</span> std::cout &lt;&lt; j_string &lt;&lt; <span class="pl-s"><span class="pl-pds">"</span> == <span class="pl-pds">"</span></span> &lt;&lt; serialized_string &lt;&lt; std::endl;</pre></div> <p dir="auto"><a href="https://json.nlohmann.me/api/basic_json/dump/" rel="nofollow"><code>.dump()</code></a> returns the originally stored string value.</p> <p dir="auto">Note the library only supports UTF-8. When you store strings with different encodings in the library, calling <a href="https://json.nlohmann.me/api/basic_json/dump/" rel="nofollow"><code>dump()</code></a> may throw an exception unless <code>json::error_handler_t::replace</code> or <code>json::error_handler_t::ignore</code> are used as error handlers.</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">To/from streams (e.g. files, string streams)</h4><a id="user-content-tofrom-streams-eg-files-string-streams" class="anchor" aria-label="Permalink: To/from streams (e.g. files, string streams)" href="#tofrom-streams-eg-files-string-streams"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">You can also use streams to serialize and deserialize:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// deserialize from standard input json j; std::cin &gt;&gt; j; // serialize to standard output std::cout &lt;&lt; j; // the setw manipulator was overloaded to set the indentation for pretty printing std::cout &lt;&lt; std::setw(4) &lt;&lt; j &lt;&lt; std::endl;"><pre><span class="pl-c"><span class="pl-c">//</span> deserialize from standard input</span> json j; std::cin &gt;&gt; j; <span class="pl-c"><span class="pl-c">//</span> serialize to standard output</span> std::cout &lt;&lt; j; <span class="pl-c"><span class="pl-c">//</span> the setw manipulator was overloaded to set the indentation for pretty printing</span> std::cout &lt;&lt; std::setw(<span class="pl-c1">4</span>) &lt;&lt; j &lt;&lt; std::endl;</pre></div> <p dir="auto">These operators work for any subclasses of <code>std::istream</code> or <code>std::ostream</code>. Here is the same example with files:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// read a JSON file std::ifstream i(&quot;file.json&quot;); json j; i &gt;&gt; j; // write prettified JSON to another file std::ofstream o(&quot;pretty.json&quot;); o &lt;&lt; std::setw(4) &lt;&lt; j &lt;&lt; std::endl;"><pre><span class="pl-c"><span class="pl-c">//</span> read a JSON file</span> std::ifstream <span class="pl-en">i</span>(<span class="pl-s"><span class="pl-pds">"</span>file.json<span class="pl-pds">"</span></span>); json j; i &gt;&gt; j; <span class="pl-c"><span class="pl-c">//</span> write prettified JSON to another file</span> std::ofstream <span class="pl-en">o</span>(<span class="pl-s"><span class="pl-pds">"</span>pretty.json<span class="pl-pds">"</span></span>); o &lt;&lt; std::setw(<span class="pl-c1">4</span>) &lt;&lt; j &lt;&lt; std::endl;</pre></div> <p dir="auto">Please note that setting the exception bit for <code>failbit</code> is inappropriate for this use case. It will result in program termination due to the <code>noexcept</code> specifier in use.</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Read from iterator range</h4><a id="user-content-read-from-iterator-range" class="anchor" aria-label="Permalink: Read from iterator range" href="#read-from-iterator-range"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">You can also parse JSON from an iterator range; that is, from any container accessible by iterators whose <code>value_type</code> is an integral type of 1, 2 or 4 bytes, which will be interpreted as UTF-8, UTF-16 and UTF-32 respectively. For instance, a <code>std::vector&lt;std::uint8_t&gt;</code>, or a <code>std::list&lt;std::uint16_t&gt;</code>:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="std::vector&lt;std::uint8_t&gt; v = {'t', 'r', 'u', 'e'}; json j = json::parse(v.begin(), v.end());"><pre>std::vector&lt;std::<span class="pl-c1">uint8_t</span>&gt; v = {<span class="pl-s"><span class="pl-pds">'</span>t<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>r<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>u<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>e<span class="pl-pds">'</span></span>}; json j = json::parse(v.begin(), v.end());</pre></div> <p dir="auto">You may leave the iterators for the range [begin, end):</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="std::vector&lt;std::uint8_t&gt; v = {'t', 'r', 'u', 'e'}; json j = json::parse(v);"><pre>std::vector&lt;std::<span class="pl-c1">uint8_t</span>&gt; v = {<span class="pl-s"><span class="pl-pds">'</span>t<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>r<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>u<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>e<span class="pl-pds">'</span></span>}; json j = json::parse(v);</pre></div> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Custom data source</h4><a id="user-content-custom-data-source" class="anchor" aria-label="Permalink: Custom data source" href="#custom-data-source"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Since the parse function accepts arbitrary iterator ranges, you can provide your own data sources by implementing the <code>LegacyInputIterator</code> concept.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct MyContainer { void advance(); const char&amp; get_current(); }; struct MyIterator { using difference_type = std::ptrdiff_t; using value_type = char; using pointer = const char*; using reference = const char&amp;; using iterator_category = std::input_iterator_tag; MyIterator&amp; operator++() { target-&gt;advance(); return *this; } bool operator!=(const MyIterator&amp; rhs) const { return rhs.target != target; } reference operator*() const { return target-&gt;get_current(); } MyContainer* target = nullptr; }; MyIterator begin(MyContainer&amp; tgt) { return MyIterator{&amp;tgt}; } MyIterator end(const MyContainer&amp;) { return {}; } void foo() { MyContainer c; json j = json::parse(c); }"><pre><span class="pl-k">struct</span> <span class="pl-en">MyContainer</span> { <span class="pl-k">void</span> <span class="pl-en">advance</span>(); <span class="pl-k">const</span> <span class="pl-k">char</span>&amp; <span class="pl-en">get_current</span>(); }; <span class="pl-k">struct</span> <span class="pl-en">MyIterator</span> { <span class="pl-k">using</span> difference_type = std::<span class="pl-c1">ptrdiff_t</span>; <span class="pl-k">using</span> value_type = <span class="pl-k">char</span>; <span class="pl-k">using</span> pointer = <span class="pl-k">const</span> <span class="pl-k">char</span>*; <span class="pl-k">using</span> reference = <span class="pl-k">const</span> <span class="pl-k">char</span>&amp;; <span class="pl-k">using</span> iterator_category = std::input_iterator_tag; MyIterator&amp; <span class="pl-k">operator</span>++() { target-&gt;<span class="pl-c1">advance</span>(); <span class="pl-k">return</span> *<span class="pl-c1">this</span>; } <span class="pl-k">bool</span> <span class="pl-k">operator</span>!=(<span class="pl-k">const</span> MyIterator&amp; rhs) <span class="pl-k">const</span> { <span class="pl-k">return</span> rhs.<span class="pl-smi">target</span> != target; } reference <span class="pl-k">operator</span>*() <span class="pl-k">const</span> { <span class="pl-k">return</span> target-&gt;<span class="pl-c1">get_current</span>(); } MyContainer* target = <span class="pl-c1">nullptr</span>; }; MyIterator <span class="pl-en">begin</span>(MyContainer&amp; tgt) { <span class="pl-k">return</span> MyIterator{&amp;tgt}; } MyIterator <span class="pl-en">end</span>(<span class="pl-k">const</span> MyContainer&amp;) { <span class="pl-k">return</span> {}; } <span class="pl-k">void</span> <span class="pl-en">foo</span>() { MyContainer c; json j = <span class="pl-c1">json::parse</span>(c); }</pre></div> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">SAX interface</h4><a id="user-content-sax-interface" class="anchor" aria-label="Permalink: SAX interface" href="#sax-interface"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The library uses a SAX-like interface with the following functions:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// called when null is parsed bool null(); // called when a boolean is parsed; value is passed bool boolean(bool val); // called when a signed or unsigned integer number is parsed; value is passed bool number_integer(number_integer_t val); bool number_unsigned(number_unsigned_t val); // called when a floating-point number is parsed; value and original string is passed bool number_float(number_float_t val, const string_t&amp; s); // called when a string is parsed; value is passed and can be safely moved away bool string(string_t&amp; val); // called when a binary value is parsed; value is passed and can be safely moved away bool binary(binary_t&amp; val); // called when an object or array begins or ends, resp. The number of elements is passed (or -1 if not known) bool start_object(std::size_t elements); bool end_object(); bool start_array(std::size_t elements); bool end_array(); // called when an object key is parsed; value is passed and can be safely moved away bool key(string_t&amp; val); // called when a parse error occurs; byte position, the last token, and an exception is passed bool parse_error(std::size_t position, const std::string&amp; last_token, const detail::exception&amp; ex);"><pre><span class="pl-c"><span class="pl-c">//</span> called when null is parsed</span> <span class="pl-k">bool</span> <span class="pl-en">null</span>(); <span class="pl-c"><span class="pl-c">//</span> called when a boolean is parsed; value is passed</span> <span class="pl-k">bool</span> <span class="pl-en">boolean</span>(<span class="pl-k">bool</span> val); <span class="pl-c"><span class="pl-c">//</span> called when a signed or unsigned integer number is parsed; value is passed</span> <span class="pl-k">bool</span> <span class="pl-en">number_integer</span>(<span class="pl-c1">number_integer_t</span> val); <span class="pl-k">bool</span> <span class="pl-en">number_unsigned</span>(<span class="pl-c1">number_unsigned_t</span> val); <span class="pl-c"><span class="pl-c">//</span> called when a floating-point number is parsed; value and original string is passed</span> <span class="pl-k">bool</span> <span class="pl-en">number_float</span>(<span class="pl-c1">number_float_t</span> val, <span class="pl-k">const</span> <span class="pl-c1">string_t</span>&amp; s); <span class="pl-c"><span class="pl-c">//</span> called when a string is parsed; value is passed and can be safely moved away</span> <span class="pl-k">bool</span> <span class="pl-en">string</span>(<span class="pl-c1">string_t</span>&amp; val); <span class="pl-c"><span class="pl-c">//</span> called when a binary value is parsed; value is passed and can be safely moved away</span> <span class="pl-k">bool</span> <span class="pl-en">binary</span>(<span class="pl-c1">binary_t</span>&amp; val); <span class="pl-c"><span class="pl-c">//</span> called when an object or array begins or ends, resp. The number of elements is passed (or -1 if not known)</span> <span class="pl-k">bool</span> <span class="pl-en">start_object</span>(std::<span class="pl-c1">size_t</span> elements); <span class="pl-k">bool</span> <span class="pl-en">end_object</span>(); <span class="pl-k">bool</span> <span class="pl-en">start_array</span>(std::<span class="pl-c1">size_t</span> elements); <span class="pl-k">bool</span> <span class="pl-en">end_array</span>(); <span class="pl-c"><span class="pl-c">//</span> called when an object key is parsed; value is passed and can be safely moved away</span> <span class="pl-k">bool</span> <span class="pl-en">key</span>(<span class="pl-c1">string_t</span>&amp; val); <span class="pl-c"><span class="pl-c">//</span> called when a parse error occurs; byte position, the last token, and an exception is passed</span> <span class="pl-k">bool</span> <span class="pl-en">parse_error</span>(std::<span class="pl-c1">size_t</span> position, <span class="pl-k">const</span> std::string&amp; last_token, <span class="pl-k">const</span> detail::<span class="pl-c1">exception</span>&amp; ex);</pre></div> <p dir="auto">The return value of each function determines whether parsing should proceed.</p> <p dir="auto">To implement your own SAX handler, proceed as follows:</p> <ol dir="auto"> <li>Implement the SAX interface in a class. You can use class <code>nlohmann::json_sax&lt;json&gt;</code> as base class, but you can also use any class where the functions described above are implemented and public.</li> <li>Create an object of your SAX interface class, e.g. <code>my_sax</code>.</li> <li>Call <code>bool json::sax_parse(input, &amp;my_sax)</code>; where the first parameter can be any input like a string or an input stream and the second parameter is a pointer to your SAX interface.</li> </ol> <p dir="auto">Note the <code>sax_parse</code> function only returns a <code>bool</code> indicating the result of the last executed SAX event. It does not return a <code>json</code> value - it is up to you to decide what to do with the SAX events. Furthermore, no exceptions are thrown in case of a parse error - it is up to you what to do with the exception object passed to your <code>parse_error</code> implementation. Internally, the SAX interface is used for the DOM parser (class <code>json_sax_dom_parser</code>) as well as the acceptor (<code>json_sax_acceptor</code>), see file <a href="https://github.com/nlohmann/json/blob/develop/include/nlohmann/detail/input/json_sax.hpp"><code>json_sax.hpp</code></a>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">STL-like access</h3><a id="user-content-stl-like-access" class="anchor" aria-label="Permalink: STL-like access" href="#stl-like-access"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">We designed the JSON class to behave just like an STL container. In fact, it satisfies the <a href="https://en.cppreference.com/w/cpp/named_req/ReversibleContainer" rel="nofollow"><strong>ReversibleContainer</strong></a> requirement.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// create an array using push_back json j; j.push_back(&quot;foo&quot;); j.push_back(1); j.push_back(true); // also use emplace_back j.emplace_back(1.78); // iterate the array for (json::iterator it = j.begin(); it != j.end(); ++it) { std::cout &lt;&lt; *it &lt;&lt; '\n'; } // range-based for for (auto&amp; element : j) { std::cout &lt;&lt; element &lt;&lt; '\n'; } // getter/setter const auto tmp = j[0].template get&lt;std::string&gt;(); j[1] = 42; bool foo = j.at(2); // comparison j == R&quot;([&quot;foo&quot;, 1, true, 1.78])&quot;_json; // true // other stuff j.size(); // 4 entries j.empty(); // false j.type(); // json::value_t::array j.clear(); // the array is empty again // convenience type checkers j.is_null(); j.is_boolean(); j.is_number(); j.is_object(); j.is_array(); j.is_string(); // create an object json o; o[&quot;foo&quot;] = 23; o[&quot;bar&quot;] = false; o[&quot;baz&quot;] = 3.141; // also use emplace o.emplace(&quot;weather&quot;, &quot;sunny&quot;); // special iterator member functions for objects for (json::iterator it = o.begin(); it != o.end(); ++it) { std::cout &lt;&lt; it.key() &lt;&lt; &quot; : &quot; &lt;&lt; it.value() &lt;&lt; &quot;\n&quot;; } // the same code as range for for (auto&amp; el : o.items()) { std::cout &lt;&lt; el.key() &lt;&lt; &quot; : &quot; &lt;&lt; el.value() &lt;&lt; &quot;\n&quot;; } // even easier with structured bindings (C++17) for (auto&amp; [key, value] : o.items()) { std::cout &lt;&lt; key &lt;&lt; &quot; : &quot; &lt;&lt; value &lt;&lt; &quot;\n&quot;; } // find an entry if (o.contains(&quot;foo&quot;)) { // there is an entry with key &quot;foo&quot; } // or via find and an iterator if (o.find(&quot;foo&quot;) != o.end()) { // there is an entry with key &quot;foo&quot; } // or simpler using count() int foo_present = o.count(&quot;foo&quot;); // 1 int fob_present = o.count(&quot;fob&quot;); // 0 // delete an entry o.erase(&quot;foo&quot;);"><pre><span class="pl-c"><span class="pl-c">//</span> create an array using push_back</span> json j; j.push_back(<span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span>); j.push_back(<span class="pl-c1">1</span>); j.push_back(<span class="pl-c1">true</span>); <span class="pl-c"><span class="pl-c">//</span> also use emplace_back</span> j.emplace_back(<span class="pl-c1">1.78</span>); <span class="pl-c"><span class="pl-c">//</span> iterate the array</span> <span class="pl-k">for</span> (json::iterator it = j.begin(); it != j.end(); ++it) { std::cout &lt;&lt; *it &lt;&lt; <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\n</span><span class="pl-pds">'</span></span>; } <span class="pl-c"><span class="pl-c">//</span> range-based for</span> <span class="pl-k">for</span> (<span class="pl-k">auto</span>&amp; element : j) { std::cout &lt;&lt; element &lt;&lt; <span class="pl-s"><span class="pl-pds">'</span><span class="pl-cce">\n</span><span class="pl-pds">'</span></span>; } <span class="pl-c"><span class="pl-c">//</span> getter/setter</span> <span class="pl-k">const</span> <span class="pl-k">auto</span> tmp = j[<span class="pl-c1">0</span>].<span class="pl-k">template </span>get&lt;std::string&gt;(); j[<span class="pl-c1">1</span>] = <span class="pl-c1">42</span>; <span class="pl-k">bool</span> foo = j.at(<span class="pl-c1">2</span>); <span class="pl-c"><span class="pl-c">//</span> comparison</span> j == <span class="pl-s"><span class="pl-pds">R"(</span>["foo", 1, true, 1.78]<span class="pl-pds">)"</span></span>_json; <span class="pl-c"><span class="pl-c">//</span> true</span> <span class="pl-c"><span class="pl-c">//</span> other stuff</span> j.size(); <span class="pl-c"><span class="pl-c">//</span> 4 entries</span> j.empty(); <span class="pl-c"><span class="pl-c">//</span> false</span> j.type(); <span class="pl-c"><span class="pl-c">//</span> json::value_t::array</span> j.clear(); <span class="pl-c"><span class="pl-c">//</span> the array is empty again</span> <span class="pl-c"><span class="pl-c">//</span> convenience type checkers</span> j.is_null(); j.is_boolean(); j.is_number(); j.is_object(); j.is_array(); j.is_string(); <span class="pl-c"><span class="pl-c">//</span> create an object</span> json o; o[<span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span>] = <span class="pl-c1">23</span>; o[<span class="pl-s"><span class="pl-pds">"</span>bar<span class="pl-pds">"</span></span>] = <span class="pl-c1">false</span>; o[<span class="pl-s"><span class="pl-pds">"</span>baz<span class="pl-pds">"</span></span>] = <span class="pl-c1">3.141</span>; <span class="pl-c"><span class="pl-c">//</span> also use emplace</span> o.emplace(<span class="pl-s"><span class="pl-pds">"</span>weather<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>sunny<span class="pl-pds">"</span></span>); <span class="pl-c"><span class="pl-c">//</span> special iterator member functions for objects</span> <span class="pl-k">for</span> (json::iterator it = o.begin(); it != o.end(); ++it) { std::cout &lt;&lt; it.<span class="pl-c1">key</span>() &lt;&lt; <span class="pl-s"><span class="pl-pds">"</span> : <span class="pl-pds">"</span></span> &lt;&lt; it.<span class="pl-c1">value</span>() &lt;&lt; <span class="pl-s"><span class="pl-pds">"</span><span class="pl-cce">\n</span><span class="pl-pds">"</span></span>; } <span class="pl-c"><span class="pl-c">//</span> the same code as range for</span> <span class="pl-k">for</span> (<span class="pl-k">auto</span>&amp; el : o.items()) { std::cout &lt;&lt; el.<span class="pl-c1">key</span>() &lt;&lt; <span class="pl-s"><span class="pl-pds">"</span> : <span class="pl-pds">"</span></span> &lt;&lt; el.<span class="pl-c1">value</span>() &lt;&lt; <span class="pl-s"><span class="pl-pds">"</span><span class="pl-cce">\n</span><span class="pl-pds">"</span></span>; } <span class="pl-c"><span class="pl-c">//</span> even easier with structured bindings (C++17)</span> <span class="pl-k">for</span> (<span class="pl-k">auto</span>&amp; [key, value] : o.items()) { std::cout &lt;&lt; key &lt;&lt; <span class="pl-s"><span class="pl-pds">"</span> : <span class="pl-pds">"</span></span> &lt;&lt; value &lt;&lt; <span class="pl-s"><span class="pl-pds">"</span><span class="pl-cce">\n</span><span class="pl-pds">"</span></span>; } <span class="pl-c"><span class="pl-c">//</span> find an entry</span> <span class="pl-k">if</span> (o.contains(<span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span>)) { <span class="pl-c"><span class="pl-c">//</span> there is an entry with key "foo"</span> } <span class="pl-c"><span class="pl-c">//</span> or via find and an iterator</span> <span class="pl-k">if</span> (o.find(<span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span>) != o.end()) { <span class="pl-c"><span class="pl-c">//</span> there is an entry with key "foo"</span> } <span class="pl-c"><span class="pl-c">//</span> or simpler using count()</span> <span class="pl-k">int</span> foo_present = o.count(<span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span>); <span class="pl-c"><span class="pl-c">//</span> 1</span> <span class="pl-k">int</span> fob_present = o.count(<span class="pl-s"><span class="pl-pds">"</span>fob<span class="pl-pds">"</span></span>); <span class="pl-c"><span class="pl-c">//</span> 0</span> <span class="pl-c"><span class="pl-c">//</span> delete an entry</span> o.erase(<span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span>);</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Conversion from STL containers</h3><a id="user-content-conversion-from-stl-containers" class="anchor" aria-label="Permalink: Conversion from STL containers" href="#conversion-from-stl-containers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Any sequence container (<code>std::array</code>, <code>std::vector</code>, <code>std::deque</code>, <code>std::forward_list</code>, <code>std::list</code>) whose values can be used to construct JSON values (e.g., integers, floating point numbers, Booleans, string types, or again STL containers described in this section) can be used to create a JSON array. The same holds for similar associative containers (<code>std::set</code>, <code>std::multiset</code>, <code>std::unordered_set</code>, <code>std::unordered_multiset</code>), but in these cases the order of the elements of the array depends on how the elements are ordered in the respective STL container.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="std::vector&lt;int&gt; c_vector {1, 2, 3, 4}; json j_vec(c_vector); // [1, 2, 3, 4] std::deque&lt;double&gt; c_deque {1.2, 2.3, 3.4, 5.6}; json j_deque(c_deque); // [1.2, 2.3, 3.4, 5.6] std::list&lt;bool&gt; c_list {true, true, false, true}; json j_list(c_list); // [true, true, false, true] std::forward_list&lt;int64_t&gt; c_flist {12345678909876, 23456789098765, 34567890987654, 45678909876543}; json j_flist(c_flist); // [12345678909876, 23456789098765, 34567890987654, 45678909876543] std::array&lt;unsigned long, 4&gt; c_array {{1, 2, 3, 4}}; json j_array(c_array); // [1, 2, 3, 4] std::set&lt;std::string&gt; c_set {&quot;one&quot;, &quot;two&quot;, &quot;three&quot;, &quot;four&quot;, &quot;one&quot;}; json j_set(c_set); // only one entry for &quot;one&quot; is used // [&quot;four&quot;, &quot;one&quot;, &quot;three&quot;, &quot;two&quot;] std::unordered_set&lt;std::string&gt; c_uset {&quot;one&quot;, &quot;two&quot;, &quot;three&quot;, &quot;four&quot;, &quot;one&quot;}; json j_uset(c_uset); // only one entry for &quot;one&quot; is used // maybe [&quot;two&quot;, &quot;three&quot;, &quot;four&quot;, &quot;one&quot;] std::multiset&lt;std::string&gt; c_mset {&quot;one&quot;, &quot;two&quot;, &quot;one&quot;, &quot;four&quot;}; json j_mset(c_mset); // both entries for &quot;one&quot; are used // maybe [&quot;one&quot;, &quot;two&quot;, &quot;one&quot;, &quot;four&quot;] std::unordered_multiset&lt;std::string&gt; c_umset {&quot;one&quot;, &quot;two&quot;, &quot;one&quot;, &quot;four&quot;}; json j_umset(c_umset); // both entries for &quot;one&quot; are used // maybe [&quot;one&quot;, &quot;two&quot;, &quot;one&quot;, &quot;four&quot;]"><pre>std::vector&lt;<span class="pl-k">int</span>&gt; c_vector {<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>, <span class="pl-c1">4</span>}; json <span class="pl-en">j_vec</span>(c_vector); <span class="pl-c"><span class="pl-c">//</span> [1, 2, 3, 4]</span> std::deque&lt;<span class="pl-k">double</span>&gt; c_deque {<span class="pl-c1">1.2</span>, <span class="pl-c1">2.3</span>, <span class="pl-c1">3.4</span>, <span class="pl-c1">5.6</span>}; json <span class="pl-en">j_deque</span>(c_deque); <span class="pl-c"><span class="pl-c">//</span> [1.2, 2.3, 3.4, 5.6]</span> std::list&lt;<span class="pl-k">bool</span>&gt; c_list {<span class="pl-c1">true</span>, <span class="pl-c1">true</span>, <span class="pl-c1">false</span>, <span class="pl-c1">true</span>}; json <span class="pl-en">j_list</span>(c_list); <span class="pl-c"><span class="pl-c">//</span> [true, true, false, true]</span> std::forward_list&lt;<span class="pl-c1">int64_t</span>&gt; c_flist {<span class="pl-c1">12345678909876</span>, <span class="pl-c1">23456789098765</span>, <span class="pl-c1">34567890987654</span>, <span class="pl-c1">45678909876543</span>}; json <span class="pl-en">j_flist</span>(c_flist); <span class="pl-c"><span class="pl-c">//</span> [12345678909876, 23456789098765, 34567890987654, 45678909876543]</span> std::array&lt;<span class="pl-k">unsigned</span> <span class="pl-k">long</span>, <span class="pl-c1">4</span>&gt; c_array {{<span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>, <span class="pl-c1">4</span>}}; json <span class="pl-en">j_array</span>(c_array); <span class="pl-c"><span class="pl-c">//</span> [1, 2, 3, 4]</span> std::set&lt;std::string&gt; c_set {<span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>two<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>three<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>four<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>}; json <span class="pl-en">j_set</span>(c_set); <span class="pl-c"><span class="pl-c">//</span> only one entry for "one" is used</span> <span class="pl-c"><span class="pl-c">//</span> ["four", "one", "three", "two"]</span> std::unordered_set&lt;std::string&gt; c_uset {<span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>two<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>three<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>four<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>}; json <span class="pl-en">j_uset</span>(c_uset); <span class="pl-c"><span class="pl-c">//</span> only one entry for "one" is used</span> <span class="pl-c"><span class="pl-c">//</span> maybe ["two", "three", "four", "one"]</span> std::multiset&lt;std::string&gt; c_mset {<span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>two<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>four<span class="pl-pds">"</span></span>}; json <span class="pl-en">j_mset</span>(c_mset); <span class="pl-c"><span class="pl-c">//</span> both entries for "one" are used</span> <span class="pl-c"><span class="pl-c">//</span> maybe ["one", "two", "one", "four"]</span> std::unordered_multiset&lt;std::string&gt; c_umset {<span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>two<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>four<span class="pl-pds">"</span></span>}; json <span class="pl-en">j_umset</span>(c_umset); <span class="pl-c"><span class="pl-c">//</span> both entries for "one" are used</span> <span class="pl-c"><span class="pl-c">//</span> maybe ["one", "two", "one", "four"]</span></pre></div> <p dir="auto">Likewise, any associative key-value containers (<code>std::map</code>, <code>std::multimap</code>, <code>std::unordered_map</code>, <code>std::unordered_multimap</code>) whose keys can construct an <code>std::string</code> and whose values can be used to construct JSON values (see examples above) can be used to create a JSON object. Note that in case of multimaps only one key is used in the JSON object and the value depends on the internal order of the STL container.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="std::map&lt;std::string, int&gt; c_map { {&quot;one&quot;, 1}, {&quot;two&quot;, 2}, {&quot;three&quot;, 3} }; json j_map(c_map); // {&quot;one&quot;: 1, &quot;three&quot;: 3, &quot;two&quot;: 2 } std::unordered_map&lt;const char*, double&gt; c_umap { {&quot;one&quot;, 1.2}, {&quot;two&quot;, 2.3}, {&quot;three&quot;, 3.4} }; json j_umap(c_umap); // {&quot;one&quot;: 1.2, &quot;two&quot;: 2.3, &quot;three&quot;: 3.4} std::multimap&lt;std::string, bool&gt; c_mmap { {&quot;one&quot;, true}, {&quot;two&quot;, true}, {&quot;three&quot;, false}, {&quot;three&quot;, true} }; json j_mmap(c_mmap); // only one entry for key &quot;three&quot; is used // maybe {&quot;one&quot;: true, &quot;two&quot;: true, &quot;three&quot;: true} std::unordered_multimap&lt;std::string, bool&gt; c_ummap { {&quot;one&quot;, true}, {&quot;two&quot;, true}, {&quot;three&quot;, false}, {&quot;three&quot;, true} }; json j_ummap(c_ummap); // only one entry for key &quot;three&quot; is used // maybe {&quot;one&quot;: true, &quot;two&quot;: true, &quot;three&quot;: true}"><pre>std::map&lt;std::string, <span class="pl-k">int</span>&gt; c_map { {<span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>, <span class="pl-c1">1</span>}, {<span class="pl-s"><span class="pl-pds">"</span>two<span class="pl-pds">"</span></span>, <span class="pl-c1">2</span>}, {<span class="pl-s"><span class="pl-pds">"</span>three<span class="pl-pds">"</span></span>, <span class="pl-c1">3</span>} }; json <span class="pl-en">j_map</span>(c_map); <span class="pl-c"><span class="pl-c">//</span> {"one": 1, "three": 3, "two": 2 }</span> std::unordered_map&lt;<span class="pl-k">const</span> <span class="pl-k">char</span>*, <span class="pl-k">double</span>&gt; c_umap { {<span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>, <span class="pl-c1">1.2</span>}, {<span class="pl-s"><span class="pl-pds">"</span>two<span class="pl-pds">"</span></span>, <span class="pl-c1">2.3</span>}, {<span class="pl-s"><span class="pl-pds">"</span>three<span class="pl-pds">"</span></span>, <span class="pl-c1">3.4</span>} }; json <span class="pl-en">j_umap</span>(c_umap); <span class="pl-c"><span class="pl-c">//</span> {"one": 1.2, "two": 2.3, "three": 3.4}</span> std::multimap&lt;std::string, <span class="pl-k">bool</span>&gt; c_mmap { {<span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>, <span class="pl-c1">true</span>}, {<span class="pl-s"><span class="pl-pds">"</span>two<span class="pl-pds">"</span></span>, <span class="pl-c1">true</span>}, {<span class="pl-s"><span class="pl-pds">"</span>three<span class="pl-pds">"</span></span>, <span class="pl-c1">false</span>}, {<span class="pl-s"><span class="pl-pds">"</span>three<span class="pl-pds">"</span></span>, <span class="pl-c1">true</span>} }; json <span class="pl-en">j_mmap</span>(c_mmap); <span class="pl-c"><span class="pl-c">//</span> only one entry for key "three" is used</span> <span class="pl-c"><span class="pl-c">//</span> maybe {"one": true, "two": true, "three": true}</span> std::unordered_multimap&lt;std::string, <span class="pl-k">bool</span>&gt; c_ummap { {<span class="pl-s"><span class="pl-pds">"</span>one<span class="pl-pds">"</span></span>, <span class="pl-c1">true</span>}, {<span class="pl-s"><span class="pl-pds">"</span>two<span class="pl-pds">"</span></span>, <span class="pl-c1">true</span>}, {<span class="pl-s"><span class="pl-pds">"</span>three<span class="pl-pds">"</span></span>, <span class="pl-c1">false</span>}, {<span class="pl-s"><span class="pl-pds">"</span>three<span class="pl-pds">"</span></span>, <span class="pl-c1">true</span>} }; json <span class="pl-en">j_ummap</span>(c_ummap); <span class="pl-c"><span class="pl-c">//</span> only one entry for key "three" is used</span> <span class="pl-c"><span class="pl-c">//</span> maybe {"one": true, "two": true, "three": true}</span></pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">JSON Pointer and JSON Patch</h3><a id="user-content-json-pointer-and-json-patch" class="anchor" aria-label="Permalink: JSON Pointer and JSON Patch" href="#json-pointer-and-json-patch"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The library supports <strong>JSON Pointer</strong> (<a href="https://tools.ietf.org/html/rfc6901" rel="nofollow">RFC 6901</a>) as alternative means to address structured values. On top of this, <strong>JSON Patch</strong> (<a href="https://tools.ietf.org/html/rfc6902" rel="nofollow">RFC 6902</a>) allows describing differences between two JSON values - effectively allowing patch and diff operations known from Unix.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// a JSON value json j_original = R&quot;({ &quot;baz&quot;: [&quot;one&quot;, &quot;two&quot;, &quot;three&quot;], &quot;foo&quot;: &quot;bar&quot; })&quot;_json; // access members with a JSON pointer (RFC 6901) j_original[&quot;/baz/1&quot;_json_pointer]; // &quot;two&quot; // a JSON patch (RFC 6902) json j_patch = R&quot;([ { &quot;op&quot;: &quot;replace&quot;, &quot;path&quot;: &quot;/baz&quot;, &quot;value&quot;: &quot;boo&quot; }, { &quot;op&quot;: &quot;add&quot;, &quot;path&quot;: &quot;/hello&quot;, &quot;value&quot;: [&quot;world&quot;] }, { &quot;op&quot;: &quot;remove&quot;, &quot;path&quot;: &quot;/foo&quot;} ])&quot;_json; // apply the patch json j_result = j_original.patch(j_patch); // { // &quot;baz&quot;: &quot;boo&quot;, // &quot;hello&quot;: [&quot;world&quot;] // } // calculate a JSON patch from two JSON values json::diff(j_result, j_original); // [ // { &quot;op&quot;:&quot; replace&quot;, &quot;path&quot;: &quot;/baz&quot;, &quot;value&quot;: [&quot;one&quot;, &quot;two&quot;, &quot;three&quot;] }, // { &quot;op&quot;: &quot;remove&quot;,&quot;path&quot;: &quot;/hello&quot; }, // { &quot;op&quot;: &quot;add&quot;, &quot;path&quot;: &quot;/foo&quot;, &quot;value&quot;: &quot;bar&quot; } // ]"><pre><span class="pl-c"><span class="pl-c">//</span> a JSON value</span> json j_original = <span class="pl-s"><span class="pl-pds">R"(</span>{</span> <span class="pl-s"> "baz": ["one", "two", "three"],</span> <span class="pl-s"> "foo": "bar"</span> <span class="pl-s">}<span class="pl-pds">)"</span></span>_json; <span class="pl-c"><span class="pl-c">//</span> access members with a JSON pointer (RFC 6901)</span> j_original[<span class="pl-s"><span class="pl-pds">"</span>/baz/1<span class="pl-pds">"</span></span>_json_pointer]; <span class="pl-c"><span class="pl-c">//</span> "two"</span> <span class="pl-c"><span class="pl-c">//</span> a JSON patch (RFC 6902)</span> json j_patch = <span class="pl-s"><span class="pl-pds">R"(</span>[</span> <span class="pl-s"> { "op": "replace", "path": "/baz", "value": "boo" },</span> <span class="pl-s"> { "op": "add", "path": "/hello", "value": ["world"] },</span> <span class="pl-s"> { "op": "remove", "path": "/foo"}</span> <span class="pl-s">]<span class="pl-pds">)"</span></span>_json; <span class="pl-c"><span class="pl-c">//</span> apply the patch</span> json j_result = j_original.patch(j_patch); <span class="pl-c"><span class="pl-c">//</span> {</span> <span class="pl-c"><span class="pl-c">//</span> "baz": "boo",</span> <span class="pl-c"><span class="pl-c">//</span> "hello": ["world"]</span> <span class="pl-c"><span class="pl-c">//</span> }</span> <span class="pl-c"><span class="pl-c">//</span> calculate a JSON patch from two JSON values</span> <span class="pl-en">json::diff</span>(j_result, j_original); <span class="pl-c"><span class="pl-c">//</span> [</span> <span class="pl-c"><span class="pl-c">//</span> { "op":" replace", "path": "/baz", "value": ["one", "two", "three"] },</span> <span class="pl-c"><span class="pl-c">//</span> { "op": "remove","path": "/hello" },</span> <span class="pl-c"><span class="pl-c">//</span> { "op": "add", "path": "/foo", "value": "bar" }</span> <span class="pl-c"><span class="pl-c">//</span> ]</span></pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">JSON Merge Patch</h3><a id="user-content-json-merge-patch" class="anchor" aria-label="Permalink: JSON Merge Patch" href="#json-merge-patch"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The library supports <strong>JSON Merge Patch</strong> (<a href="https://tools.ietf.org/html/rfc7386" rel="nofollow">RFC 7386</a>) as a patch format. Instead of using JSON Pointer (see above) to specify values to be manipulated, it describes the changes using a syntax that closely mimics the document being modified.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// a JSON value json j_document = R&quot;({ &quot;a&quot;: &quot;b&quot;, &quot;c&quot;: { &quot;d&quot;: &quot;e&quot;, &quot;f&quot;: &quot;g&quot; } })&quot;_json; // a patch json j_patch = R&quot;({ &quot;a&quot;:&quot;z&quot;, &quot;c&quot;: { &quot;f&quot;: null } })&quot;_json; // apply the patch j_document.merge_patch(j_patch); // { // &quot;a&quot;: &quot;z&quot;, // &quot;c&quot;: { // &quot;d&quot;: &quot;e&quot; // } // }"><pre><span class="pl-c"><span class="pl-c">//</span> a JSON value</span> json j_document = <span class="pl-s"><span class="pl-pds">R"(</span>{</span> <span class="pl-s"> "a": "b",</span> <span class="pl-s"> "c": {</span> <span class="pl-s"> "d": "e",</span> <span class="pl-s"> "f": "g"</span> <span class="pl-s"> }</span> <span class="pl-s">}<span class="pl-pds">)"</span></span>_json; <span class="pl-c"><span class="pl-c">//</span> a patch</span> json j_patch = <span class="pl-s"><span class="pl-pds">R"(</span>{</span> <span class="pl-s"> "a":"z",</span> <span class="pl-s"> "c": {</span> <span class="pl-s"> "f": null</span> <span class="pl-s"> }</span> <span class="pl-s">}<span class="pl-pds">)"</span></span>_json; <span class="pl-c"><span class="pl-c">//</span> apply the patch</span> j_document.merge_patch(j_patch); <span class="pl-c"><span class="pl-c">//</span> {</span> <span class="pl-c"><span class="pl-c">//</span> "a": "z",</span> <span class="pl-c"><span class="pl-c">//</span> "c": {</span> <span class="pl-c"><span class="pl-c">//</span> "d": "e"</span> <span class="pl-c"><span class="pl-c">//</span> }</span> <span class="pl-c"><span class="pl-c">//</span> }</span></pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Implicit conversions</h3><a id="user-content-implicit-conversions" class="anchor" aria-label="Permalink: Implicit conversions" href="#implicit-conversions"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Supported types can be implicitly converted to JSON values.</p> <p dir="auto">It is recommended to <strong>NOT USE</strong> implicit conversions <strong>FROM</strong> a JSON value. You can find more details about this recommendation <a href="https://www.github.com/nlohmann/json/issues/958">here</a>. You can switch off implicit conversions by defining <code>JSON_USE_IMPLICIT_CONVERSIONS</code> to <code>0</code> before including the <code>json.hpp</code> header. When using CMake, you can also achieve this by setting the option <code>JSON_ImplicitConversions</code> to <code>OFF</code>.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// strings std::string s1 = &quot;Hello, world!&quot;; json js = s1; auto s2 = js.template get&lt;std::string&gt;(); // NOT RECOMMENDED std::string s3 = js; std::string s4; s4 = js; // Booleans bool b1 = true; json jb = b1; auto b2 = jb.template get&lt;bool&gt;(); // NOT RECOMMENDED bool b3 = jb; bool b4; b4 = jb; // numbers int i = 42; json jn = i; auto f = jn.template get&lt;double&gt;(); // NOT RECOMMENDED double f2 = jb; double f3; f3 = jb; // etc."><pre><span class="pl-c"><span class="pl-c">//</span> strings</span> std::string s1 = <span class="pl-s"><span class="pl-pds">"</span>Hello, world!<span class="pl-pds">"</span></span>; json js = s1; <span class="pl-k">auto</span> s2 = js.<span class="pl-k">template </span>get&lt;std::string&gt;(); <span class="pl-c"><span class="pl-c">//</span> NOT RECOMMENDED</span> std::string s3 = js; std::string s4; s4 = js; <span class="pl-c"><span class="pl-c">//</span> Booleans</span> <span class="pl-k">bool</span> b1 = <span class="pl-c1">true</span>; json jb = b1; <span class="pl-k">auto</span> b2 = jb.<span class="pl-k">template </span>get&lt;<span class="pl-k">bool</span>&gt;(); <span class="pl-c"><span class="pl-c">//</span> NOT RECOMMENDED</span> <span class="pl-k">bool</span> b3 = jb; <span class="pl-k">bool</span> b4; b4 = jb; <span class="pl-c"><span class="pl-c">//</span> numbers</span> <span class="pl-k">int</span> i = <span class="pl-c1">42</span>; json jn = i; <span class="pl-k">auto</span> f = jn.<span class="pl-k">template </span>get&lt;<span class="pl-k">double</span>&gt;(); <span class="pl-c"><span class="pl-c">//</span> NOT RECOMMENDED</span> <span class="pl-k">double</span> f2 = jb; <span class="pl-k">double</span> f3; f3 = jb; <span class="pl-c"><span class="pl-c">//</span> etc.</span></pre></div> <p dir="auto">Note that <code>char</code> types are not automatically converted to JSON strings, but to integer numbers. A conversion to a string must be specified explicitly:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="char ch = 'A'; // ASCII value 65 json j_default = ch; // stores integer number 65 json j_string = std::string(1, ch); // stores string &quot;A&quot;"><pre><span class="pl-k">char</span> ch = <span class="pl-s"><span class="pl-pds">'</span>A<span class="pl-pds">'</span></span>; <span class="pl-c"><span class="pl-c">//</span> ASCII value 65</span> json j_default = ch; <span class="pl-c"><span class="pl-c">//</span> stores integer number 65</span> json j_string = std::string(<span class="pl-c1">1</span>, ch); <span class="pl-c"><span class="pl-c">//</span> stores string "A"</span></pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Arbitrary types conversions</h3><a id="user-content-arbitrary-types-conversions" class="anchor" aria-label="Permalink: Arbitrary types conversions" href="#arbitrary-types-conversions"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Every type can be serialized in JSON, not just STL containers and scalar types. Usually, you would do something along those lines:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="namespace ns { // a simple struct to model a person struct person { std::string name; std::string address; int age; }; } ns::person p = {&quot;Ned Flanders&quot;, &quot;744 Evergreen Terrace&quot;, 60}; // convert to JSON: copy each value into the JSON object json j; j[&quot;name&quot;] = p.name; j[&quot;address&quot;] = p.address; j[&quot;age&quot;] = p.age; // ... // convert from JSON: copy each value from the JSON object ns::person p { j[&quot;name&quot;].template get&lt;std::string&gt;(), j[&quot;address&quot;].template get&lt;std::string&gt;(), j[&quot;age&quot;].template get&lt;int&gt;() };"><pre><span class="pl-k">namespace</span> <span class="pl-en">ns</span> { <span class="pl-c"><span class="pl-c">//</span> a simple struct to model a person</span> <span class="pl-k">struct</span> <span class="pl-en">person</span> { std::string name; std::string address; <span class="pl-k">int</span> age; }; } ns::person p = {<span class="pl-s"><span class="pl-pds">"</span>Ned Flanders<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>744 Evergreen Terrace<span class="pl-pds">"</span></span>, <span class="pl-c1">60</span>}; <span class="pl-c"><span class="pl-c">//</span> convert to JSON: copy each value into the JSON object</span> json j; j[<span class="pl-s"><span class="pl-pds">"</span>name<span class="pl-pds">"</span></span>] = p.name; j[<span class="pl-s"><span class="pl-pds">"</span>address<span class="pl-pds">"</span></span>] = p.address; j[<span class="pl-s"><span class="pl-pds">"</span>age<span class="pl-pds">"</span></span>] = p.age; <span class="pl-c"><span class="pl-c">//</span> ...</span> <span class="pl-c"><span class="pl-c">//</span> convert from JSON: copy each value from the JSON object</span> ns::person p { j[<span class="pl-s"><span class="pl-pds">"</span>name<span class="pl-pds">"</span></span>].<span class="pl-k">template</span> <span class="pl-smi">get</span>&lt;std::string&gt;(), j[<span class="pl-s"><span class="pl-pds">"</span>address<span class="pl-pds">"</span></span>].<span class="pl-k">template</span> <span class="pl-smi">get</span>&lt;std::string&gt;(), j[<span class="pl-s"><span class="pl-pds">"</span>age<span class="pl-pds">"</span></span>].<span class="pl-k">template</span> <span class="pl-smi">get</span>&lt;<span class="pl-k">int</span>&gt;() };</pre></div> <p dir="auto">It works, but that's quite a lot of boilerplate... Fortunately, there's a better way:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// create a person ns::person p {&quot;Ned Flanders&quot;, &quot;744 Evergreen Terrace&quot;, 60}; // conversion: person -&gt; json json j = p; std::cout &lt;&lt; j &lt;&lt; std::endl; // {&quot;address&quot;:&quot;744 Evergreen Terrace&quot;,&quot;age&quot;:60,&quot;name&quot;:&quot;Ned Flanders&quot;} // conversion: json -&gt; person auto p2 = j.template get&lt;ns::person&gt;(); // that's it assert(p == p2);"><pre><span class="pl-c"><span class="pl-c">//</span> create a person</span> ns::person p {<span class="pl-s"><span class="pl-pds">"</span>Ned Flanders<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>744 Evergreen Terrace<span class="pl-pds">"</span></span>, <span class="pl-c1">60</span>}; <span class="pl-c"><span class="pl-c">//</span> conversion: person -&gt; json</span> json j = p; std::cout &lt;&lt; j &lt;&lt; std::endl; <span class="pl-c"><span class="pl-c">//</span> {"address":"744 Evergreen Terrace","age":60,"name":"Ned Flanders"}</span> <span class="pl-c"><span class="pl-c">//</span> conversion: json -&gt; person</span> <span class="pl-k">auto</span> p2 = j.<span class="pl-k">template </span>get&lt;ns::person&gt;(); <span class="pl-c"><span class="pl-c">//</span> that's it</span> <span class="pl-en">assert</span>(p == p2);</pre></div> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Basic usage</h4><a id="user-content-basic-usage" class="anchor" aria-label="Permalink: Basic usage" href="#basic-usage"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">To make this work with one of your types, you only need to provide two functions:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using json = nlohmann::json; namespace ns { void to_json(json&amp; j, const person&amp; p) { j = json{{&quot;name&quot;, p.name}, {&quot;address&quot;, p.address}, {&quot;age&quot;, p.age}}; } void from_json(const json&amp; j, person&amp; p) { j.at(&quot;name&quot;).get_to(p.name); j.at(&quot;address&quot;).get_to(p.address); j.at(&quot;age&quot;).get_to(p.age); } } // namespace ns"><pre><span class="pl-k">using</span> json = nlohmann::json; <span class="pl-k">namespace</span> <span class="pl-en">ns</span> { <span class="pl-k">void</span> <span class="pl-en">to_json</span>(json&amp; j, <span class="pl-k">const</span> person&amp; p) { j = json{{<span class="pl-s"><span class="pl-pds">"</span>name<span class="pl-pds">"</span></span>, p.<span class="pl-smi">name</span>}, {<span class="pl-s"><span class="pl-pds">"</span>address<span class="pl-pds">"</span></span>, p.<span class="pl-smi">address</span>}, {<span class="pl-s"><span class="pl-pds">"</span>age<span class="pl-pds">"</span></span>, p.<span class="pl-smi">age</span>}}; } <span class="pl-k">void</span> <span class="pl-en">from_json</span>(<span class="pl-k">const</span> json&amp; j, person&amp; p) { j.<span class="pl-c1">at</span>(<span class="pl-s"><span class="pl-pds">"</span>name<span class="pl-pds">"</span></span>).<span class="pl-c1">get_to</span>(p.<span class="pl-smi">name</span>); j.<span class="pl-c1">at</span>(<span class="pl-s"><span class="pl-pds">"</span>address<span class="pl-pds">"</span></span>).<span class="pl-c1">get_to</span>(p.<span class="pl-smi">address</span>); j.<span class="pl-c1">at</span>(<span class="pl-s"><span class="pl-pds">"</span>age<span class="pl-pds">"</span></span>).<span class="pl-c1">get_to</span>(p.<span class="pl-smi">age</span>); } } <span class="pl-c"><span class="pl-c">//</span> namespace ns</span></pre></div> <p dir="auto">That's all! When calling the <code>json</code> constructor with your type, your custom <code>to_json</code> method will be automatically called. Likewise, when calling <code>template get&lt;your_type&gt;()</code> or <code>get_to(your_type&amp;)</code>, the <code>from_json</code> method will be called.</p> <p dir="auto">Some important things:</p> <ul dir="auto"> <li>Those methods <strong>MUST</strong> be in your type's namespace (which can be the global namespace), or the library will not be able to locate them (in this example, they are in namespace <code>ns</code>, where <code>person</code> is defined).</li> <li>Those methods <strong>MUST</strong> be available (e.g., proper headers must be included) everywhere you use these conversions. Look at <a href="https://github.com/nlohmann/json/issues/1108" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/1108/hovercard">issue 1108</a> for errors that may occur otherwise.</li> <li>When using <code>template get&lt;your_type&gt;()</code>, <code>your_type</code> <strong>MUST</strong> be <a href="https://en.cppreference.com/w/cpp/named_req/DefaultConstructible" rel="nofollow">DefaultConstructible</a>. (There is a way to bypass this requirement described later.)</li> <li>In function <code>from_json</code>, use function <a href="https://json.nlohmann.me/api/basic_json/at/" rel="nofollow"><code>at()</code></a> to access the object values rather than <code>operator[]</code>. In case a key does not exist, <code>at</code> throws an exception that you can handle, whereas <code>operator[]</code> exhibits undefined behavior.</li> <li>You do not need to add serializers or deserializers for STL types like <code>std::vector</code>: the library already implements these.</li> </ul> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Simplify your life with macros</h4><a id="user-content-simplify-your-life-with-macros" class="anchor" aria-label="Permalink: Simplify your life with macros" href="#simplify-your-life-with-macros"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">If you just want to serialize/deserialize some structs, the <code>to_json</code>/<code>from_json</code> functions can be a lot of boilerplate. There are <a href="https://json.nlohmann.me/features/arbitrary_types/#simplify-your-life-with-macros" rel="nofollow"><strong>several macros</strong></a> to make your life easier as long as you (1) want to use a JSON object as serialization and (2) want to use the member variable names as object keys in that object.</p> <p dir="auto">Which macro to choose depends on whether private member variables need to be accessed, a deserialization is needed, missing values should yield an error or should be replaced by default values, and if derived classes are used. See <a href="https://json.nlohmann.me/api/macros/#serializationdeserialization-macros" rel="nofollow">this overview to choose the right one for your use case</a>.</p> <div class="markdown-heading" dir="auto"><h5 tabindex="-1" class="heading-element" dir="auto">Example usage of macros</h5><a id="user-content-example-usage-of-macros" class="anchor" aria-label="Permalink: Example usage of macros" href="#example-usage-of-macros"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The <code>to_json</code>/<code>from_json</code> functions for the <code>person</code> struct above can be created with <a href="https://json.nlohmann.me/api/macros/nlohmann_define_type_non_intrusive/" rel="nofollow"><code>NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE</code></a>. In all macros, the first parameter is the name of the class/struct, and all remaining parameters name the members.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="namespace ns { NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(person, name, address, age) }"><pre><span class="pl-k">namespace</span> <span class="pl-en">ns</span> { <span class="pl-en">NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE</span>(person, name, address, age) }</pre></div> <p dir="auto">Here is another example with private members, where <a href="https://json.nlohmann.me/api/macros/nlohmann_define_type_intrusive/" rel="nofollow"><code>NLOHMANN_DEFINE_TYPE_INTRUSIVE</code></a> is needed:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="namespace ns { class address { private: std::string street; int housenumber; int postcode; public: NLOHMANN_DEFINE_TYPE_INTRUSIVE(address, street, housenumber, postcode) }; }"><pre><span class="pl-k">namespace</span> <span class="pl-en">ns</span> { <span class="pl-k">class</span> <span class="pl-en">address</span> { <span class="pl-k">private:</span> std::string street; <span class="pl-k">int</span> housenumber; <span class="pl-k">int</span> postcode; <span class="pl-k">public:</span> <span class="pl-en">NLOHMANN_DEFINE_TYPE_INTRUSIVE</span>(address, street, housenumber, postcode) }; }</pre></div> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">How do I convert third-party types?</h4><a id="user-content-how-do-i-convert-third-party-types" class="anchor" aria-label="Permalink: How do I convert third-party types?" href="#how-do-i-convert-third-party-types"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This requires a bit more advanced technique. But first, let's see how this conversion mechanism works:</p> <p dir="auto">The library uses <strong>JSON Serializers</strong> to convert types to json. The default serializer for <code>nlohmann::json</code> is <code>nlohmann::adl_serializer</code> (ADL means <a href="https://en.cppreference.com/w/cpp/language/adl" rel="nofollow">Argument-Dependent Lookup</a>).</p> <p dir="auto">It is implemented like this (simplified):</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="template &lt;typename T&gt; struct adl_serializer { static void to_json(json&amp; j, const T&amp; value) { // calls the &quot;to_json&quot; method in T's namespace } static void from_json(const json&amp; j, T&amp; value) { // same thing, but with the &quot;from_json&quot; method } };"><pre><span class="pl-k">template </span>&lt;<span class="pl-k">typename</span> T&gt; <span class="pl-k">struct</span> <span class="pl-en">adl_serializer</span> { <span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">to_json</span>(json&amp; j, <span class="pl-k">const</span> T&amp; value) { <span class="pl-c"><span class="pl-c">//</span> calls the "to_json" method in T's namespace</span> } <span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">from_json</span>(<span class="pl-k">const</span> json&amp; j, T&amp; value) { <span class="pl-c"><span class="pl-c">//</span> same thing, but with the "from_json" method</span> } };</pre></div> <p dir="auto">This serializer works fine when you have control over the type's namespace. However, what about <code>boost::optional</code> or <code>std::filesystem::path</code> (C++17)? Hijacking the <code>boost</code> namespace is pretty bad, and it's illegal to add something other than template specializations to <code>std</code>...</p> <p dir="auto">To solve this, you need to add a specialization of <code>adl_serializer</code> to the <code>nlohmann</code> namespace, here's an example:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// partial specialization (full specialization works too) namespace nlohmann { template &lt;typename T&gt; struct adl_serializer&lt;boost::optional&lt;T&gt;&gt; { static void to_json(json&amp; j, const boost::optional&lt;T&gt;&amp; opt) { if (opt == boost::none) { j = nullptr; } else { j = *opt; // this will call adl_serializer&lt;T&gt;::to_json which will // find the free function to_json in T's namespace! } } static void from_json(const json&amp; j, boost::optional&lt;T&gt;&amp; opt) { if (j.is_null()) { opt = boost::none; } else { opt = j.template get&lt;T&gt;(); // same as above, but with // adl_serializer&lt;T&gt;::from_json } } }; }"><pre><span class="pl-c"><span class="pl-c">//</span> partial specialization (full specialization works too)</span> <span class="pl-k">namespace</span> <span class="pl-en">nlohmann</span> { <span class="pl-k">template </span>&lt;<span class="pl-k">typename</span> T&gt; <span class="pl-k">struct</span> <span class="pl-en">adl_serializer</span>&lt;boost::optional&lt;T&gt;&gt; { <span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">to_json</span>(json&amp; j, <span class="pl-k">const</span> boost::optional&lt;T&gt;&amp; opt) { <span class="pl-k">if</span> (opt == boost::none) { j = <span class="pl-c1">nullptr</span>; } <span class="pl-k">else</span> { j = *opt; <span class="pl-c"><span class="pl-c">//</span> this will call adl_serializer&lt;T&gt;::to_json which will</span> <span class="pl-c"><span class="pl-c">//</span> find the free function to_json in T's namespace!</span> } } <span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">from_json</span>(<span class="pl-k">const</span> json&amp; j, boost::optional&lt;T&gt;&amp; opt) { <span class="pl-k">if</span> (j.<span class="pl-c1">is_null</span>()) { opt = boost::none; } <span class="pl-k">else</span> { opt = j.<span class="pl-k">template</span> <span class="pl-smi">get</span>&lt;T&gt;(); <span class="pl-c"><span class="pl-c">//</span> same as above, but with</span> <span class="pl-c"><span class="pl-c">//</span> adl_serializer&lt;T&gt;::from_json</span> } } }; }</pre></div> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">How can I use <code>get()</code> for non-default constructible/non-copyable types?</h4><a id="user-content-how-can-i-use-get-for-non-default-constructiblenon-copyable-types" class="anchor" aria-label="Permalink: How can I use get() for non-default constructible/non-copyable types?" href="#how-can-i-use-get-for-non-default-constructiblenon-copyable-types"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">There is a way, if your type is <a href="https://en.cppreference.com/w/cpp/named_req/MoveConstructible" rel="nofollow">MoveConstructible</a>. You will need to specialize the <code>adl_serializer</code> as well, but with a special <code>from_json</code> overload:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct move_only_type { move_only_type() = delete; move_only_type(int ii): i(ii) {} move_only_type(const move_only_type&amp;) = delete; move_only_type(move_only_type&amp;&amp;) = default; int i; }; namespace nlohmann { template &lt;&gt; struct adl_serializer&lt;move_only_type&gt; { // note: the return type is no longer 'void', and the method only takes // one argument static move_only_type from_json(const json&amp; j) { return {j.template get&lt;int&gt;()}; } // Here's the catch! You must provide a to_json method! Otherwise, you // will not be able to convert move_only_type to json, since you fully // specialized adl_serializer on that type static void to_json(json&amp; j, move_only_type t) { j = t.i; } }; }"><pre><span class="pl-k">struct</span> <span class="pl-en">move_only_type</span> { <span class="pl-en">move_only_type</span>() = <span class="pl-k">delete</span>; <span class="pl-en">move_only_type</span>(<span class="pl-k">int</span> ii): i(ii) {} <span class="pl-en">move_only_type</span>(<span class="pl-k">const</span> move_only_type&amp;) = <span class="pl-k">delete</span>; <span class="pl-en">move_only_type</span>(move_only_type&amp;&amp;) = <span class="pl-k">default</span>; <span class="pl-k">int</span> i; }; <span class="pl-k">namespace</span> <span class="pl-en">nlohmann</span> { <span class="pl-k">template </span>&lt;&gt; <span class="pl-k">struct</span> <span class="pl-en">adl_serializer</span>&lt;move_only_type&gt; { <span class="pl-c"><span class="pl-c">//</span> note: the return type is no longer 'void', and the method only takes</span> <span class="pl-c"><span class="pl-c">//</span> one argument</span> <span class="pl-k">static</span> move_only_type <span class="pl-en">from_json</span>(<span class="pl-k">const</span> json&amp; j) { <span class="pl-k">return</span> {j.<span class="pl-k">template</span> <span class="pl-smi">get</span>&lt;<span class="pl-k">int</span>&gt;()}; } <span class="pl-c"><span class="pl-c">//</span> Here's the catch! You must provide a to_json method! Otherwise, you</span> <span class="pl-c"><span class="pl-c">//</span> will not be able to convert move_only_type to json, since you fully</span> <span class="pl-c"><span class="pl-c">//</span> specialized adl_serializer on that type</span> <span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">to_json</span>(json&amp; j, move_only_type t) { j = t.<span class="pl-smi">i</span>; } }; }</pre></div> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Can I write my own serializer? (Advanced use)</h4><a id="user-content-can-i-write-my-own-serializer-advanced-use" class="anchor" aria-label="Permalink: Can I write my own serializer? (Advanced use)" href="#can-i-write-my-own-serializer-advanced-use"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Yes. You might want to take a look at <a href="https://github.com/nlohmann/json/blob/develop/tests/src/unit-udt.cpp"><code>unit-udt.cpp</code></a> in the test suite, to see a few examples.</p> <p dir="auto">If you write your own serializer, you'll need to do a few things:</p> <ul dir="auto"> <li>use a different <code>basic_json</code> alias than <code>nlohmann::json</code> (the last template parameter of <code>basic_json</code> is the <code>JSONSerializer</code>)</li> <li>use your <code>basic_json</code> alias (or a template parameter) in all your <code>to_json</code>/<code>from_json</code> methods</li> <li>use <code>nlohmann::to_json</code> and <code>nlohmann::from_json</code> when you need ADL</li> </ul> <p dir="auto">Here is an example, without simplifications, that only accepts types with a size &lt;= 32, and uses ADL.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// You should use void as a second template argument // if you don't need compile-time checks on T template&lt;typename T, typename SFINAE = typename std::enable_if&lt;sizeof(T) &lt;= 32&gt;::type&gt; struct less_than_32_serializer { template &lt;typename BasicJsonType&gt; static void to_json(BasicJsonType&amp; j, T value) { // we want to use ADL, and call the correct to_json overload using nlohmann::to_json; // this method is called by adl_serializer, // this is where the magic happens to_json(j, value); } template &lt;typename BasicJsonType&gt; static void from_json(const BasicJsonType&amp; j, T&amp; value) { // same thing here using nlohmann::from_json; from_json(j, value); } };"><pre><span class="pl-c"><span class="pl-c">//</span> You should use void as a second template argument</span> <span class="pl-c"><span class="pl-c">//</span> if you don't need compile-time checks on T</span> <span class="pl-k">template</span>&lt;<span class="pl-k">typename</span> T, <span class="pl-k">typename</span> SFINAE = <span class="pl-k">typename</span> std::enable_if&lt;<span class="pl-k">sizeof</span>(T) &lt;= <span class="pl-c1">32</span>&gt;::type&gt; <span class="pl-k">struct</span> <span class="pl-en">less_than_32_serializer</span> { <span class="pl-k">template </span>&lt;<span class="pl-k">typename</span> BasicJsonType&gt; <span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">to_json</span>(BasicJsonType&amp; j, T value) { <span class="pl-c"><span class="pl-c">//</span> we want to use ADL, and call the correct to_json overload</span> <span class="pl-k">using</span> nlohmann::to_json; <span class="pl-c"><span class="pl-c">//</span> this method is called by adl_serializer,</span> <span class="pl-c"><span class="pl-c">//</span> this is where the magic happens</span> <span class="pl-c1">to_json</span>(j, value); } <span class="pl-k">template </span>&lt;<span class="pl-k">typename</span> BasicJsonType&gt; <span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">from_json</span>(<span class="pl-k">const</span> BasicJsonType&amp; j, T&amp; value) { <span class="pl-c"><span class="pl-c">//</span> same thing here</span> <span class="pl-k">using</span> nlohmann::from_json; <span class="pl-c1">from_json</span>(j, value); } };</pre></div> <p dir="auto">Be <strong>very</strong> careful when reimplementing your serializer, you can stack overflow if you don't pay attention:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="template &lt;typename T, void&gt; struct bad_serializer { template &lt;typename BasicJsonType&gt; static void to_json(BasicJsonType&amp; j, const T&amp; value) { // this calls BasicJsonType::json_serializer&lt;T&gt;::to_json(j, value) // if BasicJsonType::json_serializer == bad_serializer ... oops! j = value; } template &lt;typename BasicJsonType&gt; static void to_json(const BasicJsonType&amp; j, T&amp; value) { // this calls BasicJsonType::json_serializer&lt;T&gt;::from_json(j, value) // if BasicJsonType::json_serializer == bad_serializer ... oops! value = j.template get&lt;T&gt;(); // oops! } };"><pre><span class="pl-k">template </span>&lt;<span class="pl-k">typename</span> T, <span class="pl-k">void</span>&gt; <span class="pl-k">struct</span> <span class="pl-en">bad_serializer</span> { <span class="pl-k">template </span>&lt;<span class="pl-k">typename</span> BasicJsonType&gt; <span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">to_json</span>(BasicJsonType&amp; j, <span class="pl-k">const</span> T&amp; value) { <span class="pl-c"><span class="pl-c">//</span> this calls BasicJsonType::json_serializer&lt;T&gt;::to_json(j, value)</span> <span class="pl-c"><span class="pl-c">//</span> if BasicJsonType::json_serializer == bad_serializer ... oops!</span> j = value; } <span class="pl-k">template </span>&lt;<span class="pl-k">typename</span> BasicJsonType&gt; <span class="pl-k">static</span> <span class="pl-k">void</span> <span class="pl-en">to_json</span>(<span class="pl-k">const</span> BasicJsonType&amp; j, T&amp; value) { <span class="pl-c"><span class="pl-c">//</span> this calls BasicJsonType::json_serializer&lt;T&gt;::from_json(j, value)</span> <span class="pl-c"><span class="pl-c">//</span> if BasicJsonType::json_serializer == bad_serializer ... oops!</span> value = j.<span class="pl-k">template</span> <span class="pl-smi">get</span>&lt;T&gt;(); <span class="pl-c"><span class="pl-c">//</span> oops!</span> } };</pre></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Specializing enum conversion</h3><a id="user-content-specializing-enum-conversion" class="anchor" aria-label="Permalink: Specializing enum conversion" href="#specializing-enum-conversion"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">By default, enum values are serialized to JSON as integers. In some cases this could result in undesired behavior. If an enum is modified or re-ordered after data has been serialized to JSON, the later de-serialized JSON data may be undefined or a different enum value than was originally intended.</p> <p dir="auto">It is possible to more precisely specify how a given enum is mapped to and from JSON as shown below:</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// example enum type declaration enum TaskState { TS_STOPPED, TS_RUNNING, TS_COMPLETED, TS_INVALID=-1, }; // map TaskState values to JSON as strings NLOHMANN_JSON_SERIALIZE_ENUM( TaskState, { {TS_INVALID, nullptr}, {TS_STOPPED, &quot;stopped&quot;}, {TS_RUNNING, &quot;running&quot;}, {TS_COMPLETED, &quot;completed&quot;}, })"><pre><span class="pl-c"><span class="pl-c">//</span> example enum type declaration</span> <span class="pl-k">enum</span> TaskState { TS_STOPPED, TS_RUNNING, TS_COMPLETED, TS_INVALID=-<span class="pl-c1">1</span>, }; <span class="pl-c"><span class="pl-c">//</span> map TaskState values to JSON as strings</span> <span class="pl-en">NLOHMANN_JSON_SERIALIZE_ENUM</span>( TaskState, { {TS_INVALID, <span class="pl-c1">nullptr</span>}, {TS_STOPPED, <span class="pl-s"><span class="pl-pds">"</span>stopped<span class="pl-pds">"</span></span>}, {TS_RUNNING, <span class="pl-s"><span class="pl-pds">"</span>running<span class="pl-pds">"</span></span>}, {TS_COMPLETED, <span class="pl-s"><span class="pl-pds">"</span>completed<span class="pl-pds">"</span></span>}, })</pre></div> <p dir="auto">The <code>NLOHMANN_JSON_SERIALIZE_ENUM()</code> macro declares a set of <code>to_json()</code> / <code>from_json()</code> functions for type <code>TaskState</code> while avoiding repetition and boilerplate serialization code.</p> <p dir="auto"><strong>Usage:</strong></p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// enum to JSON as string json j = TS_STOPPED; assert(j == &quot;stopped&quot;); // json string to enum json j3 = &quot;running&quot;; assert(j3.template get&lt;TaskState&gt;() == TS_RUNNING); // undefined json value to enum (where the first map entry above is the default) json jPi = 3.14; assert(jPi.template get&lt;TaskState&gt;() == TS_INVALID);"><pre><span class="pl-c"><span class="pl-c">//</span> enum to JSON as string</span> json j = TS_STOPPED; <span class="pl-en">assert</span>(j == <span class="pl-s"><span class="pl-pds">"</span>stopped<span class="pl-pds">"</span></span>); <span class="pl-c"><span class="pl-c">//</span> json string to enum</span> json j3 = <span class="pl-s"><span class="pl-pds">"</span>running<span class="pl-pds">"</span></span>; <span class="pl-en">assert</span>(j3.<span class="pl-k">template </span>get&lt;TaskState&gt;() == TS_RUNNING); <span class="pl-c"><span class="pl-c">//</span> undefined json value to enum (where the first map entry above is the default)</span> json jPi = <span class="pl-c1">3.14</span>; <span class="pl-en">assert</span>(jPi.<span class="pl-k">template </span>get&lt;TaskState&gt;() == TS_INVALID);</pre></div> <p dir="auto">Just as in <a href="#arbitrary-types-conversions">Arbitrary Type Conversions</a> above,</p> <ul dir="auto"> <li><code>NLOHMANN_JSON_SERIALIZE_ENUM()</code> MUST be declared in your enum type's namespace (which can be the global namespace), or the library will not be able to locate it, and it will default to integer serialization.</li> <li>It MUST be available (e.g., proper headers must be included) everywhere you use the conversions.</li> </ul> <p dir="auto">Other Important points:</p> <ul dir="auto"> <li>When using <code>template get&lt;ENUM_TYPE&gt;()</code>, undefined JSON values will default to the first pair specified in your map. Select this default pair carefully.</li> <li>If an enum or JSON value is specified more than once in your map, the first matching occurrence from the top of the map will be returned when converting to or from JSON.</li> </ul> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Binary formats (BSON, CBOR, MessagePack, UBJSON, and BJData)</h3><a id="user-content-binary-formats-bson-cbor-messagepack-ubjson-and-bjdata" class="anchor" aria-label="Permalink: Binary formats (BSON, CBOR, MessagePack, UBJSON, and BJData)" href="#binary-formats-bson-cbor-messagepack-ubjson-and-bjdata"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Though JSON is a ubiquitous data format, it is not a very compact format suitable for data exchange, for instance over a network. Hence, the library supports <a href="https://bsonspec.org" rel="nofollow">BSON</a> (Binary JSON), <a href="https://cbor.io" rel="nofollow">CBOR</a> (Concise Binary Object Representation), <a href="https://msgpack.org" rel="nofollow">MessagePack</a>, <a href="https://ubjson.org" rel="nofollow">UBJSON</a> (Universal Binary JSON Specification) and <a href="https://neurojson.org/bjdata" rel="nofollow">BJData</a> (Binary JData) to efficiently encode JSON values to byte vectors and to decode such vectors.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// create a JSON value json j = R&quot;({&quot;compact&quot;: true, &quot;schema&quot;: 0})&quot;_json; // serialize to BSON std::vector&lt;std::uint8_t&gt; v_bson = json::to_bson(j); // 0x1B, 0x00, 0x00, 0x00, 0x08, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0x00, 0x01, 0x10, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // roundtrip json j_from_bson = json::from_bson(v_bson); // serialize to CBOR std::vector&lt;std::uint8_t&gt; v_cbor = json::to_cbor(j); // 0xA2, 0x67, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0xF5, 0x66, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00 // roundtrip json j_from_cbor = json::from_cbor(v_cbor); // serialize to MessagePack std::vector&lt;std::uint8_t&gt; v_msgpack = json::to_msgpack(j); // 0x82, 0xA7, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0xC3, 0xA6, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00 // roundtrip json j_from_msgpack = json::from_msgpack(v_msgpack); // serialize to UBJSON std::vector&lt;std::uint8_t&gt; v_ubjson = json::to_ubjson(j); // 0x7B, 0x69, 0x07, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0x54, 0x69, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x69, 0x00, 0x7D // roundtrip json j_from_ubjson = json::from_ubjson(v_ubjson);"><pre><span class="pl-c"><span class="pl-c">//</span> create a JSON value</span> json j = <span class="pl-s"><span class="pl-pds">R"(</span>{"compact": true, "schema": 0}<span class="pl-pds">)"</span></span>_json; <span class="pl-c"><span class="pl-c">//</span> serialize to BSON</span> std::vector&lt;std::<span class="pl-c1">uint8_t</span>&gt; v_bson = json::to_bson(j); <span class="pl-c"><span class="pl-c">//</span> 0x1B, 0x00, 0x00, 0x00, 0x08, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0x00, 0x01, 0x10, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00</span> <span class="pl-c"><span class="pl-c">//</span> roundtrip</span> json j_from_bson = json::from_bson(v_bson); <span class="pl-c"><span class="pl-c">//</span> serialize to CBOR</span> std::vector&lt;std::<span class="pl-c1">uint8_t</span>&gt; v_cbor = json::to_cbor(j); <span class="pl-c"><span class="pl-c">//</span> 0xA2, 0x67, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0xF5, 0x66, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00</span> <span class="pl-c"><span class="pl-c">//</span> roundtrip</span> json j_from_cbor = json::from_cbor(v_cbor); <span class="pl-c"><span class="pl-c">//</span> serialize to MessagePack</span> std::vector&lt;std::<span class="pl-c1">uint8_t</span>&gt; v_msgpack = json::to_msgpack(j); <span class="pl-c"><span class="pl-c">//</span> 0x82, 0xA7, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0xC3, 0xA6, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x00</span> <span class="pl-c"><span class="pl-c">//</span> roundtrip</span> json j_from_msgpack = json::from_msgpack(v_msgpack); <span class="pl-c"><span class="pl-c">//</span> serialize to UBJSON</span> std::vector&lt;std::<span class="pl-c1">uint8_t</span>&gt; v_ubjson = json::to_ubjson(j); <span class="pl-c"><span class="pl-c">//</span> 0x7B, 0x69, 0x07, 0x63, 0x6F, 0x6D, 0x70, 0x61, 0x63, 0x74, 0x54, 0x69, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6D, 0x61, 0x69, 0x00, 0x7D</span> <span class="pl-c"><span class="pl-c">//</span> roundtrip</span> json j_from_ubjson = json::from_ubjson(v_ubjson);</pre></div> <p dir="auto">The library also supports binary types from BSON, CBOR (byte strings), and MessagePack (bin, ext, fixext). They are stored by default as <code>std::vector&lt;std::uint8_t&gt;</code> to be processed outside the library.</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// CBOR byte string with payload 0xCAFE std::vector&lt;std::uint8_t&gt; v = {0x42, 0xCA, 0xFE}; // read value json j = json::from_cbor(v); // the JSON value has type binary j.is_binary(); // true // get reference to stored binary value auto&amp; binary = j.get_binary(); // the binary value has no subtype (CBOR has no binary subtypes) binary.has_subtype(); // false // access std::vector&lt;std::uint8_t&gt; member functions binary.size(); // 2 binary[0]; // 0xCA binary[1]; // 0xFE // set subtype to 0x10 binary.set_subtype(0x10); // serialize to MessagePack auto cbor = json::to_msgpack(j); // 0xD5 (fixext2), 0x10, 0xCA, 0xFE"><pre><span class="pl-c"><span class="pl-c">//</span> CBOR byte string with payload 0xCAFE</span> std::vector&lt;std::<span class="pl-c1">uint8_t</span>&gt; v = {<span class="pl-c1">0x42</span>, <span class="pl-c1">0xCA</span>, <span class="pl-c1">0xFE</span>}; <span class="pl-c"><span class="pl-c">//</span> read value</span> json j = json::from_cbor(v); <span class="pl-c"><span class="pl-c">//</span> the JSON value has type binary</span> j.is_binary(); <span class="pl-c"><span class="pl-c">//</span> true</span> <span class="pl-c"><span class="pl-c">//</span> get reference to stored binary value</span> <span class="pl-k">auto</span>&amp; binary = j.get_binary(); <span class="pl-c"><span class="pl-c">//</span> the binary value has no subtype (CBOR has no binary subtypes)</span> binary.has_subtype(); <span class="pl-c"><span class="pl-c">//</span> false</span> <span class="pl-c"><span class="pl-c">//</span> access std::vector&lt;std::uint8_t&gt; member functions</span> binary.size(); <span class="pl-c"><span class="pl-c">//</span> 2</span> binary[<span class="pl-c1">0</span>]; <span class="pl-c"><span class="pl-c">//</span> 0xCA</span> binary[<span class="pl-c1">1</span>]; <span class="pl-c"><span class="pl-c">//</span> 0xFE</span> <span class="pl-c"><span class="pl-c">//</span> set subtype to 0x10</span> binary.set_subtype(<span class="pl-c1">0x10</span>); <span class="pl-c"><span class="pl-c">//</span> serialize to MessagePack</span> <span class="pl-k">auto</span> cbor = json::to_msgpack(j); <span class="pl-c"><span class="pl-c">//</span> 0xD5 (fixext2), 0x10, 0xCA, 0xFE</span></pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Customers</h2><a id="user-content-customers" class="anchor" aria-label="Permalink: Customers" href="#customers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The library is used in multiple projects, applications, operating systems, etc. The list below is not exhaustive, but the result of an internet search. If you know further customers of the library, please let me know, see <a href="#contact">contact</a>.</p> <p dir="auto"><a href="https://json.nlohmann.me/home/customers/" rel="nofollow"><img src="/nlohmann/json/raw/develop/docs/mkdocs/docs/images/customers.png" alt="logos of customers using the library" style="max-width: 100%;"></a></p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Supported compilers</h2><a id="user-content-supported-compilers" class="anchor" aria-label="Permalink: Supported compilers" href="#supported-compilers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Though it's 2025 already, the support for C++11 is still a bit sparse. Currently, the following compilers are known to work:</p> <ul dir="auto"> <li>GCC 4.8 - 14.2 (and possibly later)</li> <li>Clang 3.4 - 20.0 (and possibly later)</li> <li>Apple Clang 9.1 - 16.0 (and possibly later)</li> <li>Intel C++ Compiler 17.0.2 (and possibly later)</li> <li>Nvidia CUDA Compiler 11.0.221 (and possibly later)</li> <li>Microsoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later)</li> <li>Microsoft Visual C++ 2017 / Build Tools 15.5.180.51428 (and possibly later)</li> <li>Microsoft Visual C++ 2019 / Build Tools 16.3.1+1def00d3d (and possibly later)</li> <li>Microsoft Visual C++ 2022 / Build Tools 19.30.30709.0 (and possibly later)</li> </ul> <p dir="auto">I would be happy to learn about other compilers/versions.</p> <p dir="auto">Please note:</p> <ul dir="auto"> <li> <p dir="auto">GCC 4.8 has a bug <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57824" rel="nofollow">57824</a>: multiline raw strings cannot be the arguments to macros. Don't use multiline raw strings directly in macros with this compiler.</p> </li> <li> <p dir="auto">Android defaults to using very old compilers and C++ libraries. To fix this, add the following to your <code>Application.mk</code>. This will switch to the LLVM C++ library, the Clang compiler, and enable C++11 and other features disabled by default.</p> <div class="highlight highlight-source-makefile notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="APP_STL := c++_shared NDK_TOOLCHAIN_VERSION := clang3.6 APP_CPPFLAGS += -frtti -fexceptions"><pre><span class="pl-smi">APP_STL</span> := c++_shared <span class="pl-smi">NDK_TOOLCHAIN_VERSION</span> := clang3.6 <span class="pl-smi">APP_CPPFLAGS</span> += -frtti -fexceptions</pre></div> <p dir="auto">The code compiles successfully with <a href="https://developer.android.com/ndk/index.html?hl=ml" rel="nofollow">Android NDK</a>, Revision 9 - 11 (and possibly later) and <a href="https://www.crystax.net/en/android/ndk" rel="nofollow">CrystaX's Android NDK</a> version 10.</p> </li> <li> <p dir="auto">For GCC running on MinGW or Android SDK, the error <code>'to_string' is not a member of 'std'</code> (or similarly, for <code>strtod</code> or <code>strtof</code>) may occur. Note this is not an issue with the code, but rather with the compiler itself. On Android, see above to build with a newer environment. For MinGW, please refer to <a href="https://tehsausage.com/mingw-to-string" rel="nofollow">this site</a> and <a href="https://github.com/nlohmann/json/issues/136" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/136/hovercard">this discussion</a> for information on how to fix this bug. For Android NDK using <code>APP_STL := gnustl_static</code>, please refer to <a href="https://github.com/nlohmann/json/issues/219" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/219/hovercard">this discussion</a>.</p> </li> <li> <p dir="auto">Unsupported versions of GCC and Clang are rejected by <code>#error</code> directives. This can be switched off by defining <code>JSON_SKIP_UNSUPPORTED_COMPILER_CHECK</code>. Note that you can expect no support in this case.</p> </li> </ul> <p dir="auto">See the page <a href="https://json.nlohmann.me/community/quality_assurance" rel="nofollow">quality assurance</a> on the compilers used to check the library in the CI.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Integration</h2><a id="user-content-integration" class="anchor" aria-label="Permalink: Integration" href="#integration"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><a href="https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp"><code>json.hpp</code></a> is the single required file in <code>single_include/nlohmann</code> or <a href="https://github.com/nlohmann/json/releases">released here</a>. You need to add</p> <div class="highlight highlight-source-c++ notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#include &lt;nlohmann/json.hpp&gt; // for convenience using json = nlohmann::json;"><pre>#<span class="pl-k">include</span> <span class="pl-s"><span class="pl-pds">&lt;</span>nlohmann/json.hpp<span class="pl-pds">&gt;</span></span> <span class="pl-c"><span class="pl-c">//</span> for convenience</span> <span class="pl-k">using</span> json = nlohmann::json;</pre></div> <p dir="auto">to the files you want to process JSON and set the necessary switches to enable C++11 (e.g., <code>-std=c++11</code> for GCC and Clang).</p> <p dir="auto">You can further use file <a href="https://github.com/nlohmann/json/blob/develop/include/nlohmann/json_fwd.hpp"><code>include/nlohmann/json_fwd.hpp</code></a> for forward-declarations. The installation of json_fwd.hpp (as part of cmake's install step), can be achieved by setting <code>-DJSON_MultipleHeaders=ON</code>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">CMake</h3><a id="user-content-cmake" class="anchor" aria-label="Permalink: CMake" href="#cmake"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">You can also use the <code>nlohmann_json::nlohmann_json</code> interface target in CMake. This target populates the appropriate usage requirements for <code>INTERFACE_INCLUDE_DIRECTORIES</code> to point to the appropriate include directories and <code>INTERFACE_COMPILE_FEATURES</code> for the necessary C++11 flags.</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">External</h4><a id="user-content-external" class="anchor" aria-label="Permalink: External" href="#external"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">To use this library from a CMake project, you can locate it directly with <code>find_package()</code> and use the namespaced imported target from the generated package configuration:</p> <div class="highlight highlight-source-cmake notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# CMakeLists.txt find_package(nlohmann_json 3.11.3 REQUIRED) ... add_library(foo ...) ... target_link_libraries(foo PRIVATE nlohmann_json::nlohmann_json)"><pre><span class="pl-c"># CMakeLists.txt</span> <span class="pl-k">find_package</span>(nlohmann_json 3.11.3 REQUIRED) ... <span class="pl-k">add_library</span>(foo ...) ... <span class="pl-k">target_link_libraries</span>(foo <span class="pl-e">PRIVATE</span> nlohmann_json::nlohmann_json)</pre></div> <p dir="auto">The package configuration file, <code>nlohmann_jsonConfig.cmake</code>, can be used either from an install tree or directly out of the build tree.</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Embedded</h4><a id="user-content-embedded" class="anchor" aria-label="Permalink: Embedded" href="#embedded"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">To embed the library directly into an existing CMake project, place the entire source tree in a subdirectory and call <code>add_subdirectory()</code> in your <code>CMakeLists.txt</code> file:</p> <div class="highlight highlight-source-cmake notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Typically you don't care so much for a third party library's tests to be # run from your own project's code. set(JSON_BuildTests OFF CACHE INTERNAL &quot;&quot;) # If you only include this third party in PRIVATE source files, you do not # need to install it when your main project gets installed. # set(JSON_Install OFF CACHE INTERNAL &quot;&quot;) # Don't use include(nlohmann_json/CMakeLists.txt) since that carries with it # unintended consequences that will break the build. It's generally # discouraged (although not necessarily well documented as such) to use # include(...) for pulling in other CMake projects anyways. add_subdirectory(nlohmann_json) ... add_library(foo ...) ... target_link_libraries(foo PRIVATE nlohmann_json::nlohmann_json)"><pre><span class="pl-c"># Typically you don't care so much for a third party library's tests to be</span> <span class="pl-c"># run from your own project's code.</span> <span class="pl-k">set</span>(JSON_BuildTests <span class="pl-k">OFF</span> <span class="pl-k">CACHE</span> <span class="pl-k">INTERNAL</span> <span class="pl-s">""</span>) <span class="pl-c"># If you only include this third party in PRIVATE source files, you do not</span> <span class="pl-c"># need to install it when your main project gets installed.</span> <span class="pl-c"># set(JSON_Install OFF CACHE INTERNAL "")</span> <span class="pl-c"># Don't use include(nlohmann_json/CMakeLists.txt) since that carries with it</span> <span class="pl-c"># unintended consequences that will break the build. It's generally</span> <span class="pl-c"># discouraged (although not necessarily well documented as such) to use</span> <span class="pl-c"># include(...) for pulling in other CMake projects anyways.</span> <span class="pl-k">add_subdirectory</span>(nlohmann_json) ... <span class="pl-k">add_library</span>(foo ...) ... <span class="pl-k">target_link_libraries</span>(foo <span class="pl-e">PRIVATE</span> nlohmann_json::nlohmann_json)</pre></div> <div class="markdown-heading" dir="auto"><h5 tabindex="-1" class="heading-element" dir="auto">Embedded (FetchContent)</h5><a id="user-content-embedded-fetchcontent" class="anchor" aria-label="Permalink: Embedded (FetchContent)" href="#embedded-fetchcontent"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Since CMake v3.11, <a href="https://cmake.org/cmake/help/v3.11/module/FetchContent.html" rel="nofollow">FetchContent</a> can be used to automatically download a release as a dependency at configure time.</p> <p dir="auto">Example:</p> <div class="highlight highlight-source-cmake notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="include(FetchContent) FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz) FetchContent_MakeAvailable(json) target_link_libraries(foo PRIVATE nlohmann_json::nlohmann_json)"><pre><span class="pl-k">include</span>(FetchContent) FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz) FetchContent_MakeAvailable(json) <span class="pl-k">target_link_libraries</span>(foo <span class="pl-e">PRIVATE</span> nlohmann_json::nlohmann_json)</pre></div> <p dir="auto"><strong>Note</strong>: It is recommended to use the URL approach described above which is supported as of version 3.10.0. See <a href="https://json.nlohmann.me/integration/cmake/#fetchcontent" rel="nofollow">https://json.nlohmann.me/integration/cmake/#fetchcontent</a> for more information.</p> <div class="markdown-heading" dir="auto"><h4 tabindex="-1" class="heading-element" dir="auto">Supporting Both</h4><a id="user-content-supporting-both" class="anchor" aria-label="Permalink: Supporting Both" href="#supporting-both"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">To allow your project to support either an externally supplied or an embedded JSON library, you can use a pattern akin to the following:</p> <div class="highlight highlight-source-cmake notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Top level CMakeLists.txt project(FOO) ... option(FOO_USE_EXTERNAL_JSON &quot;Use an external JSON library&quot; OFF) ... add_subdirectory(thirdparty) ... add_library(foo ...) ... # Note that the namespaced target will always be available regardless of the # import method target_link_libraries(foo PRIVATE nlohmann_json::nlohmann_json)"><pre><span class="pl-c"># Top level CMakeLists.txt</span> <span class="pl-k">project</span>(FOO) ... <span class="pl-k">option</span>(FOO_USE_EXTERNAL_JSON <span class="pl-s">"Use an external JSON library"</span> <span class="pl-k">OFF</span>) ... <span class="pl-k">add_subdirectory</span>(thirdparty) ... <span class="pl-k">add_library</span>(foo ...) ... <span class="pl-c"># Note that the namespaced target will always be available regardless of the</span> <span class="pl-c"># import method</span> <span class="pl-k">target_link_libraries</span>(foo <span class="pl-e">PRIVATE</span> nlohmann_json::nlohmann_json)</pre></div> <div class="highlight highlight-source-cmake notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# thirdparty/CMakeLists.txt ... if(FOO_USE_EXTERNAL_JSON) find_package(nlohmann_json 3.11.3 REQUIRED) else() set(JSON_BuildTests OFF CACHE INTERNAL &quot;&quot;) add_subdirectory(nlohmann_json) endif() ..."><pre><span class="pl-c"># thirdparty/CMakeLists.txt</span> ... <span class="pl-k">if</span>(FOO_USE_EXTERNAL_JSON) <span class="pl-k"> find_package</span>(nlohmann_json 3.11.3 REQUIRED) <span class="pl-k">else</span>() <span class="pl-k"> set</span>(JSON_BuildTests <span class="pl-k">OFF</span> <span class="pl-k">CACHE</span> <span class="pl-k">INTERNAL</span> <span class="pl-s">""</span>) <span class="pl-k"> add_subdirectory</span>(nlohmann_json) <span class="pl-k">endif</span>() ...</pre></div> <p dir="auto"><code>thirdparty/nlohmann_json</code> is then a complete copy of this source tree.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Package Managers</h3><a id="user-content-package-managers" class="anchor" aria-label="Permalink: Package Managers" href="#package-managers"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">Use your favorite <a href="https://json.nlohmann.me/integration/package_managers/" rel="nofollow"><strong>package manager</strong></a> to use the library.</p> <ul dir="auto"> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/homebrew.svg"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/homebrew.svg" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#homebrew" rel="nofollow"><strong>Homebrew</strong></a> <code>nlohmann-json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/meson.svg"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/meson.svg" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#meson" rel="nofollow"><strong>Meson</strong></a> <code>nlohmann_json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/bazel.svg"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/bazel.svg" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#bazel" rel="nofollow"><strong>Bazel</strong></a> <code>nlohmann_json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/conan.svg"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/conan.svg" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#conan" rel="nofollow"><strong>Conan</strong></a> <code>nlohmann_json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/spack.svg"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/spack.svg" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#spack" rel="nofollow"><strong>Spack</strong></a> <code>nlohmann-json</code></li> <li><a href="https://json.nlohmann.me/integration/package_managers/#hunter" rel="nofollow"><strong>Hunter</strong></a> <code>nlohmann_json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/vcpkg.png"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/vcpkg.png" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#vcpkg" rel="nofollow"><strong>vcpkg</strong></a> <code>nlohmann-json</code></li> <li><a href="https://json.nlohmann.me/integration/package_managers/#cget" rel="nofollow"><strong>cget</strong></a> <code>nlohmann/json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/swift.svg"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/swift.svg" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#swift-package-manager" rel="nofollow"><strong>Swift Package Manager</strong></a> <code>nlohmann/json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/nuget.svg"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/nuget.svg" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#nuget" rel="nofollow"><strong>Nuget</strong></a> <code>nlohmann.json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/conda.svg"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/conda.svg" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#conda" rel="nofollow"><strong>Conda</strong></a> <code>nlohmann_json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/macports.svg"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/macports.svg" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#macports" rel="nofollow"><strong>MacPorts</strong></a> <code>nlohmann-json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/CPM.png"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/CPM.png" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#cpmcmake" rel="nofollow"><strong>cpm.cmake</strong></a> <code>gh:nlohmann/json</code></li> <li><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/xmake.svg"><img src="https://raw.githubusercontent.com/nlohmann/json/refs/heads/develop/docs/mkdocs/docs/images/package_managers/xmake.svg" height="20" style="max-width: 100%;"></a> <a href="https://json.nlohmann.me/integration/package_managers/#xmake" rel="nofollow"><strong>xmake</strong></a> <code>nlohmann_json</code></li> </ul> <p dir="auto">The library is part of many package managers. See the <a href="https://json.nlohmann.me/integration/package_managers/" rel="nofollow"><strong>documentation</strong></a> for detailed descriptions and examples.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Pkg-config</h3><a id="user-content-pkg-config" class="anchor" aria-label="Permalink: Pkg-config" href="#pkg-config"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">If you are using bare Makefiles, you can use <code>pkg-config</code> to generate the include flags that point to where the library is installed:</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="pkg-config nlohmann_json --cflags"><pre>pkg-config nlohmann_json --cflags</pre></div> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">License</h2><a id="user-content-license" class="anchor" aria-label="Permalink: License" href="#license"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/3c95aefc8ac8a790cee5e2b2f113e902214bd779102fbdf70d6f9bb8c0e64f7b/68747470733a2f2f3134393735333432352e76322e707265737361626c6563646e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323030392f30362f4f5349417070726f7665645f313030583132352e706e67"><img align="right" src="https://camo.githubusercontent.com/3c95aefc8ac8a790cee5e2b2f113e902214bd779102fbdf70d6f9bb8c0e64f7b/68747470733a2f2f3134393735333432352e76322e707265737361626c6563646e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323030392f30362f4f5349417070726f7665645f313030583132352e706e67" alt="OSI approved license" data-canonical-src="https://149753425.v2.pressablecdn.com/wp-content/uploads/2009/06/OSIApproved_100X125.png" style="max-width: 100%;"></a></p> <p dir="auto">The class is licensed under the <a href="https://opensource.org/licenses/MIT" rel="nofollow">MIT License</a>:</p> <p dir="auto">Copyright © 2013-2025 <a href="https://nlohmann.me" rel="nofollow">Niels Lohmann</a></p> <p dir="auto">Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> <p dir="auto">The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> <p dir="auto">THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p> <hr> <ul dir="auto"> <li>The class contains the UTF-8 Decoder from Bjoern Hoehrmann which is licensed under the <a href="https://opensource.org/licenses/MIT" rel="nofollow">MIT License</a> (see above). Copyright © 2008-2009 <a href="https://bjoern.hoehrmann.de/" rel="nofollow">Björn Hoehrmann</a> <a href="mailto:bjoern@hoehrmann.de">bjoern@hoehrmann.de</a></li> <li>The class contains a slightly modified version of the Grisu2 algorithm from Florian Loitsch which is licensed under the <a href="https://opensource.org/licenses/MIT" rel="nofollow">MIT License</a> (see above). Copyright © 2009 <a href="https://florian.loitsch.com/" rel="nofollow">Florian Loitsch</a></li> <li>The class contains a copy of <a href="https://nemequ.github.io/hedley/" rel="nofollow">Hedley</a> from Evan Nemerson which is licensed as <a href="https://creativecommons.org/publicdomain/zero/1.0/" rel="nofollow">CC0-1.0</a>.</li> <li>The class contains parts of <a href="https://github.com/abseil/abseil-cpp">Google Abseil</a> which is licensed under the <a href="https://opensource.org/licenses/Apache-2.0" rel="nofollow">Apache 2.0 License</a>.</li> </ul> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/0322a6e969eb058bb34792e6868b94aaf2899130ced4238aa7f4e545f0222d64/68747470733a2f2f6769742e667366652e6f72672f72657573652f72657573652d63692f7261772f6272616e63682f6d61737465722f72657573652d686f72697a6f6e74616c2e706e67"><img align="right" src="https://camo.githubusercontent.com/0322a6e969eb058bb34792e6868b94aaf2899130ced4238aa7f4e545f0222d64/68747470733a2f2f6769742e667366652e6f72672f72657573652f72657573652d63692f7261772f6272616e63682f6d61737465722f72657573652d686f72697a6f6e74616c2e706e67" alt="REUSE Software" data-canonical-src="https://git.fsfe.org/reuse/reuse-ci/raw/branch/master/reuse-horizontal.png" style="max-width: 100%;"></a></p> <p dir="auto">The library is compliant to version 3.3 of the <a href="https://reuse.software" rel="nofollow"><strong>REUSE specification</strong></a>:</p> <ul dir="auto"> <li>Every source file contains an SPDX copyright header.</li> <li>The full text of all licenses used in the repository can be found in the <code>LICENSES</code> folder.</li> <li>File <code>.reuse/dep5</code> contains an overview of all files' copyrights and licenses.</li> <li>Run <code>pipx run reuse lint</code> to verify the project's REUSE compliance and <code>pipx run reuse spdx</code> to generate a SPDX SBOM.</li> </ul> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Contact</h2><a id="user-content-contact" class="anchor" aria-label="Permalink: Contact" href="#contact"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">If you have questions regarding the library, I would like to invite you to <a href="https://github.com/nlohmann/json/issues/new/choose">open an issue at GitHub</a>. Please describe your request, problem, or question as detailed as possible, and also mention the version of the library you are using as well as the version of your compiler and operating system. Opening an issue at GitHub allows other users and contributors to this library to collaborate. For instance, I have little experience with MSVC, and most issues in this regard have been solved by a growing community. If you have a look at the <a href="https://github.com/nlohmann/json/issues?q=is%3Aissue+is%3Aclosed">closed issues</a>, you will see that we react quite timely in most cases.</p> <p dir="auto">Only if your request would contain confidential information, please <a href="mailto:mail@nlohmann.me">send me an email</a>. For encrypted messages, please use <a href="https://keybase.io/nlohmann/pgp_keys.asc" rel="nofollow">this key</a>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Security</h2><a id="user-content-security" class="anchor" aria-label="Permalink: Security" href="#security"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto"><a href="https://github.com/nlohmann/json/commits">Commits by Niels Lohmann</a> and <a href="https://github.com/nlohmann/json/releases">releases</a> are signed with this <a href="https://keybase.io/nlohmann/pgp_keys.asc?fingerprint=797167ae41c0a6d9232e48457f3cea63ae251b69" rel="nofollow">PGP Key</a>.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Thanks</h2><a id="user-content-thanks" class="anchor" aria-label="Permalink: Thanks" href="#thanks"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">I deeply appreciate the help of the following people.</p> <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/nlohmann/json/develop/docs/avatars.png"><img src="https://raw.githubusercontent.com/nlohmann/json/develop/docs/avatars.png" align="right" alt="GitHub avatars of the contributors" style="max-width: 100%;"></a></p> <ol dir="auto"> <li><a href="https://github.com/Teemperor">Teemperor</a> implemented CMake support and lcov integration, realized escape and Unicode handling in the string parser, and fixed the JSON serialization.</li> <li><a href="https://github.com/elliotgoodrich">elliotgoodrich</a> fixed an issue with double deletion in the iterator classes.</li> <li><a href="https://github.com/kirkshoop">kirkshoop</a> made the iterators of the class composable to other libraries.</li> <li><a href="https://github.com/wanwc">wancw</a> fixed a bug that hindered the class to compile with Clang.</li> <li>Tomas Åblad found a bug in the iterator implementation.</li> <li><a href="https://github.com/jrandall">Joshua C. Randall</a> fixed a bug in the floating-point serialization.</li> <li><a href="https://github.com/aburgh">Aaron Burghardt</a> implemented code to parse streams incrementally. Furthermore, he greatly improved the parser class by allowing the definition of a filter function to discard undesired elements while parsing.</li> <li><a href="https://github.com/dkopecek">Daniel Kopeček</a> fixed a bug in the compilation with GCC 5.0.</li> <li><a href="https://github.com/Florianjw">Florian Weber</a> fixed a bug in and improved the performance of the comparison operators.</li> <li><a href="https://github.com/EricMCornelius">Eric Cornelius</a> pointed out a bug in the handling with NaN and infinity values. He also improved the performance of the string escaping.</li> <li><a href="https://github.com/likebeta">易思龙</a> implemented a conversion from anonymous enums.</li> <li><a href="https://github.com/kepkin">kepkin</a> patiently pushed forward the support for Microsoft Visual studio.</li> <li><a href="https://github.com/gregmarr">gregmarr</a> simplified the implementation of reverse iterators and helped with numerous hints and improvements. In particular, he pushed forward the implementation of user-defined types.</li> <li><a href="https://github.com/caiovlp">Caio Luppi</a> fixed a bug in the Unicode handling.</li> <li><a href="https://github.com/dariomt">dariomt</a> fixed some typos in the examples.</li> <li><a href="https://github.com/d-frey">Daniel Frey</a> cleaned up some pointers and implemented exception-safe memory allocation.</li> <li><a href="https://github.com/ColinH">Colin Hirsch</a> took care of a small namespace issue.</li> <li><a href="https://github.com/whoshuu">Huu Nguyen</a> correct a variable name in the documentation.</li> <li><a href="https://github.com/silverweed">Silverweed</a> overloaded <code>parse()</code> to accept an rvalue reference.</li> <li><a href="https://github.com/dariomt">dariomt</a> fixed a subtlety in MSVC type support and implemented the <code>get_ref()</code> function to get a reference to stored values.</li> <li><a href="https://github.com/ZahlGraf">ZahlGraf</a> added a workaround that allows compilation using Android NDK.</li> <li><a href="https://github.com/whackashoe">whackashoe</a> replaced a function that was marked as unsafe by Visual Studio.</li> <li><a href="https://github.com/406345">406345</a> fixed two small warnings.</li> <li><a href="https://github.com/glenfe">Glen Fernandes</a> noted a potential portability problem in the <code>has_mapped_type</code> function.</li> <li><a href="https://github.com/nibroc">Corbin Hughes</a> fixed some typos in the contribution guidelines.</li> <li><a href="https://github.com/twelsby">twelsby</a> fixed the array subscript operator, an issue that failed the MSVC build, and floating-point parsing/dumping. He further added support for unsigned integer numbers and implemented better roundtrip support for parsed numbers.</li> <li><a href="https://github.com/vog">Volker Diels-Grabsch</a> fixed a link in the README file.</li> <li><a href="https://github.com/msm-">msm-</a> added support for American Fuzzy Lop.</li> <li><a href="https://github.com/Annihil">Annihil</a> fixed an example in the README file.</li> <li><a href="https://github.com/Themercee">Themercee</a> noted a wrong URL in the README file.</li> <li><a href="https://github.com/lv-zheng">Lv Zheng</a> fixed a namespace issue with <code>int64_t</code> and <code>uint64_t</code>.</li> <li><a href="https://github.com/abc100m">abc100m</a> analyzed the issues with GCC 4.8 and proposed a <a href="https://github.com/nlohmann/json/pull/212" data-hovercard-type="pull_request" data-hovercard-url="/nlohmann/json/pull/212/hovercard">partial solution</a>.</li> <li><a href="https://github.com/zewt">zewt</a> added useful notes to the README file about Android.</li> <li><a href="https://github.com/robertmrk">Róbert Márki</a> added a fix to use move iterators and improved the integration via CMake.</li> <li><a href="https://github.com/ChrisKitching">Chris Kitching</a> cleaned up the CMake files.</li> <li><a href="https://github.com/06needhamt">Tom Needham</a> fixed a subtle bug with MSVC 2015 which was also proposed by <a href="https://github.com/Epidal">Michael K.</a>.</li> <li><a href="https://github.com/thelostt">Mário Feroldi</a> fixed a small typo.</li> <li><a href="https://github.com/duncanwerner">duncanwerner</a> found a really embarrassing performance regression in the 2.0.0 release.</li> <li><a href="https://github.com/dtoma">Damien</a> fixed one of the last conversion warnings.</li> <li><a href="https://github.com/t-b">Thomas Braun</a> fixed a warning in a test case and adjusted MSVC calls in the CI.</li> <li><a href="https://github.com/theodelrieu">Théo DELRIEU</a> patiently and constructively oversaw the long way toward <a href="https://github.com/nlohmann/json/issues/290" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/290/hovercard">iterator-range parsing</a>. He also implemented the magic behind the serialization/deserialization of user-defined types and split the single header file into smaller chunks.</li> <li><a href="https://github.com/5tefan">Stefan</a> fixed a minor issue in the documentation.</li> <li><a href="https://github.com/vasild">Vasil Dimov</a> fixed the documentation regarding conversions from <code>std::multiset</code>.</li> <li><a href="https://github.com/ChristophJud">ChristophJud</a> overworked the CMake files to ease project inclusion.</li> <li><a href="https://github.com/vpetrigo">Vladimir Petrigo</a> made a SFINAE hack more readable and added Visual Studio 17 to the build matrix.</li> <li><a href="https://github.com/seeekr">Denis Andrejew</a> fixed a grammar issue in the README file.</li> <li><a href="https://github.com/palacaze">Pierre-Antoine Lacaze</a> found a subtle bug in the <code>dump()</code> function.</li> <li><a href="https://github.com/TurpentineDistillery">TurpentineDistillery</a> pointed to <a href="https://en.cppreference.com/w/cpp/locale/locale/classic" rel="nofollow"><code>std::locale::classic()</code></a> to avoid too much locale joggling, found some nice performance improvements in the parser, improved the benchmarking code, and realized locale-independent number parsing and printing.</li> <li><a href="https://github.com/cgzones">cgzones</a> had an idea how to fix the Coverity scan.</li> <li><a href="https://github.com/jaredgrubb">Jared Grubb</a> silenced a nasty documentation warning.</li> <li><a href="https://github.com/qwename">Yixin Zhang</a> fixed an integer overflow check.</li> <li><a href="https://github.com/Bosswestfalen">Bosswestfalen</a> merged two iterator classes into a smaller one.</li> <li><a href="https://github.com/Daniel599">Daniel599</a> helped to get Travis execute the tests with Clang's sanitizers.</li> <li><a href="https://github.com/vjon">Jonathan Lee</a> fixed an example in the README file.</li> <li><a href="https://github.com/gnzlbg">gnzlbg</a> supported the implementation of user-defined types.</li> <li><a href="https://github.com/qis">Alexej Harm</a> helped to get the user-defined types working with Visual Studio.</li> <li><a href="https://github.com/jaredgrubb">Jared Grubb</a> supported the implementation of user-defined types.</li> <li><a href="https://github.com/EnricoBilla">EnricoBilla</a> noted a typo in an example.</li> <li><a href="https://github.com/horenmar">Martin Hořeňovský</a> found a way for a 2x speedup for the compilation time of the test suite.</li> <li><a href="https://github.com/ukhegg">ukhegg</a> found proposed an improvement for the examples section.</li> <li><a href="https://github.com/rswanson-ihi">rswanson-ihi</a> noted a typo in the README.</li> <li><a href="https://github.com/stanmihai4">Mihai Stan</a> fixed a bug in the comparison with <code>nullptr</code>s.</li> <li><a href="https://github.com/tusharpm">Tushar Maheshwari</a> added <a href="https://github.com/sakra/cotire">cotire</a> support to speed up the compilation.</li> <li><a href="https://github.com/TedLyngmo">TedLyngmo</a> noted a typo in the README, removed unnecessary bit arithmetic, and fixed some <code>-Weffc++</code> warnings.</li> <li><a href="https://github.com/krzysztofwos">Krzysztof Woś</a> made exceptions more visible.</li> <li><a href="https://github.com/ftillier">ftillier</a> fixed a compiler warning.</li> <li><a href="https://github.com/tinloaf">tinloaf</a> made sure all pushed warnings are properly popped.</li> <li><a href="https://github.com/Fytch">Fytch</a> found a bug in the documentation.</li> <li><a href="https://github.com/Type1J">Jay Sistar</a> implemented a Meson build description.</li> <li><a href="https://github.com/HenryRLee">Henry Lee</a> fixed a warning in ICC and improved the iterator implementation.</li> <li><a href="https://github.com/vthiery">Vincent Thiery</a> maintains a package for the Conan package manager.</li> <li><a href="https://github.com/koemeet">Steffen</a> fixed a potential issue with MSVC and <code>std::min</code>.</li> <li><a href="https://github.com/Chocobo1">Mike Tzou</a> fixed some typos.</li> <li><a href="https://github.com/amrcode">amrcode</a> noted a misleading documentation about comparison of floats.</li> <li><a href="https://github.com/olegendo">Oleg Endo</a> reduced the memory consumption by replacing <code>&lt;iostream&gt;</code> with <code>&lt;iosfwd&gt;</code>.</li> <li><a href="https://github.com/dan-42">dan-42</a> cleaned up the CMake files to simplify including/reusing of the library.</li> <li><a href="https://github.com/himikof">Nikita Ofitserov</a> allowed for moving values from initializer lists.</li> <li><a href="https://github.com/wincent">Greg Hurrell</a> fixed a typo.</li> <li><a href="https://github.com/DmitryKuk">Dmitry Kukovinets</a> fixed a typo.</li> <li><a href="https://github.com/kbthomp1">kbthomp1</a> fixed an issue related to the Intel OSX compiler.</li> <li><a href="https://github.com/daixtrose">Markus Werle</a> fixed a typo.</li> <li><a href="https://github.com/WebProdPP">WebProdPP</a> fixed a subtle error in a precondition check.</li> <li><a href="https://github.com/leha-bot">Alex</a> noted an error in a code sample.</li> <li><a href="https://github.com/tdegeus">Tom de Geus</a> reported some warnings with ICC and helped to fix them.</li> <li><a href="https://github.com/pjkundert">Perry Kundert</a> simplified reading from input streams.</li> <li><a href="https://github.com/sonulohani">Sonu Lohani</a> fixed a small compilation error.</li> <li><a href="https://github.com/jseward">Jamie Seward</a> fixed all MSVC warnings.</li> <li><a href="https://github.com/eld00d">Nate Vargas</a> added a Doxygen tag file.</li> <li><a href="https://github.com/pvleuven">pvleuven</a> helped to fix a warning in ICC.</li> <li><a href="https://github.com/crea7or">Pavel</a> helped to fix some warnings in MSVC.</li> <li><a href="https://github.com/jseward">Jamie Seward</a> avoided unnecessary string copies in <code>find()</code> and <code>count()</code>.</li> <li><a href="https://github.com/Itja">Mitja</a> fixed some typos.</li> <li><a href="https://github.com/jowr">Jorrit Wronski</a> updated the Hunter package links.</li> <li><a href="https://github.com/TinyTinni">Matthias Möller</a> added a <code>.natvis</code> for the MSVC debug view.</li> <li><a href="https://github.com/bogemic">bogemic</a> fixed some C++17 deprecation warnings.</li> <li><a href="https://github.com/erengy">Eren Okka</a> fixed some MSVC warnings.</li> <li><a href="https://github.com/abolz">abolz</a> integrated the Grisu2 algorithm for proper floating-point formatting, allowing more roundtrip checks to succeed.</li> <li><a href="https://github.com/Pipeliner">Vadim Evard</a> fixed a Markdown issue in the README.</li> <li><a href="https://github.com/zerodefect">zerodefect</a> fixed a compiler warning.</li> <li><a href="https://github.com/kaidokert">Kert</a> allowed to template the string type in the serialization and added the possibility to override the exceptional behavior.</li> <li><a href="https://github.com/mark-99">mark-99</a> helped fixing an ICC error.</li> <li><a href="https://github.com/patrikhuber">Patrik Huber</a> fixed links in the README file.</li> <li><a href="https://github.com/johnfb">johnfb</a> found a bug in the implementation of CBOR's indefinite length strings.</li> <li><a href="https://github.com/pfultz2">Paul Fultz II</a> added a note on the cget package manager.</li> <li><a href="https://github.com/wla80">Wilson Lin</a> made the integration section of the README more concise.</li> <li><a href="https://github.com/ralfbielig">RalfBielig</a> detected and fixed a memory leak in the parser callback.</li> <li><a href="https://github.com/agrianius">agrianius</a> allowed to dump JSON to an alternative string type.</li> <li><a href="https://github.com/ktonon">Kevin Tonon</a> overworked the C++11 compiler checks in CMake.</li> <li><a href="https://github.com/ax3l">Axel Huebl</a> simplified a CMake check and added support for the <a href="https://spack.io" rel="nofollow">Spack package manager</a>.</li> <li><a href="https://github.com/coryan">Carlos O'Ryan</a> fixed a typo.</li> <li><a href="https://github.com/jammehcow">James Upjohn</a> fixed a version number in the compilers section.</li> <li><a href="https://github.com/chuckatkins">Chuck Atkins</a> adjusted the CMake files to the CMake packaging guidelines and provided documentation for the CMake integration.</li> <li><a href="https://github.com/dns13">Jan Schöppach</a> fixed a typo.</li> <li><a href="https://github.com/martin-mfg">martin-mfg</a> fixed a typo.</li> <li><a href="https://github.com/TinyTinni">Matthias Möller</a> removed the dependency from <code>std::stringstream</code>.</li> <li><a href="https://github.com/agrianius">agrianius</a> added code to use alternative string implementations.</li> <li><a href="https://github.com/Daniel599">Daniel599</a> allowed to use more algorithms with the <code>items()</code> function.</li> <li><a href="https://github.com/jrakow">Julius Rakow</a> fixed the Meson include directory and fixed the links to <a href="https://cppreference.com" rel="nofollow">cppreference.com</a>.</li> <li><a href="https://github.com/sonulohani">Sonu Lohani</a> fixed the compilation with MSVC 2015 in debug mode.</li> <li><a href="https://github.com/grembo">grembo</a> fixed the test suite and re-enabled several test cases.</li> <li><a href="https://github.com/simnalamburt">Hyeon Kim</a> introduced the macro <code>JSON_INTERNAL_CATCH</code> to control the exception handling inside the library.</li> <li><a href="https://github.com/thyu">thyu</a> fixed a compiler warning.</li> <li><a href="https://github.com/LEgregius">David Guthrie</a> fixed a subtle compilation error with Clang 3.4.2.</li> <li><a href="https://github.com/dennisfischer">Dennis Fischer</a> allowed to call <code>find_package</code> without installing the library.</li> <li><a href="https://github.com/simnalamburt">Hyeon Kim</a> fixed an issue with a double macro definition.</li> <li><a href="https://github.com/rivertam">Ben Berman</a> made some error messages more understandable.</li> <li><a href="https://github.com/zakalibit">zakalibit</a> fixed a compilation problem with the Intel C++ compiler.</li> <li><a href="https://github.com/mandreyel">mandreyel</a> fixed a compilation problem.</li> <li><a href="https://github.com/koponomarenko">Kostiantyn Ponomarenko</a> added version and license information to the Meson build file.</li> <li><a href="https://github.com/henryiii">Henry Schreiner</a> added support for GCC 4.8.</li> <li><a href="https://github.com/knilch0r">knilch</a> made sure the test suite does not stall when run in the wrong directory.</li> <li><a href="https://github.com/antonioborondo">Antonio Borondo</a> fixed an MSVC 2017 warning.</li> <li><a href="https://github.com/dgendreau">Dan Gendreau</a> implemented the <code>NLOHMANN_JSON_SERIALIZE_ENUM</code> macro to quickly define an enum/JSON mapping.</li> <li><a href="https://github.com/efp">efp</a> added line and column information to parse errors.</li> <li><a href="https://github.com/julian-becker">julian-becker</a> added BSON support.</li> <li><a href="https://github.com/pratikpc">Pratik Chowdhury</a> added support for structured bindings.</li> <li><a href="https://github.com/davedissian">David Avedissian</a> added support for Clang 5.0.1 (PS4 version).</li> <li><a href="https://github.com/dumarjo">Jonathan Dumaresq</a> implemented an input adapter to read from <code>FILE*</code>.</li> <li><a href="https://github.com/kjpus">kjpus</a> fixed a link in the documentation.</li> <li><a href="https://github.com/manu-chroma">Manvendra Singh</a> fixed a typo in the documentation.</li> <li><a href="https://github.com/ziggurat29">ziggurat29</a> fixed an MSVC warning.</li> <li><a href="https://github.com/SylvainCorlay">Sylvain Corlay</a> added code to avoid an issue with MSVC.</li> <li><a href="https://github.com/mefyl">mefyl</a> fixed a bug when JSON was parsed from an input stream.</li> <li><a href="https://github.com/mpoquet">Millian Poquet</a> allowed to install the library via Meson.</li> <li><a href="https://github.com/moodboom">Michael Behrns-Miller</a> found an issue with a missing namespace.</li> <li><a href="https://github.com/naszta">Nasztanovics Ferenc</a> fixed a compilation issue with libc 2.12.</li> <li><a href="https://github.com/andreas-schwab">Andreas Schwab</a> fixed the endian conversion.</li> <li><a href="https://github.com/Mark-Dunning">Mark-Dunning</a> fixed a warning in MSVC.</li> <li><a href="https://github.com/garethsb-sony">Gareth Sylvester-Bradley</a> added <code>operator/</code> for JSON Pointers.</li> <li><a href="https://github.com/johnmarkwayve">John-Mark</a> noted a missing header.</li> <li><a href="https://github.com/xvitaly">Vitaly Zaitsev</a> fixed compilation with GCC 9.0.</li> <li><a href="https://github.com/stac47">Laurent Stacul</a> fixed compilation with GCC 9.0.</li> <li><a href="https://github.com/iwanders">Ivor Wanders</a> helped to reduce the CMake requirement to version 3.1.</li> <li><a href="https://github.com/njlr">njlr</a> updated the Buckaroo instructions.</li> <li><a href="https://github.com/lieff">Lion</a> fixed a compilation issue with GCC 7 on CentOS.</li> <li><a href="https://github.com/nickaein">Isaac Nickaein</a> improved the integer serialization performance and implemented the <code>contains()</code> function.</li> <li><a href="https://github.com/past-due">past-due</a> suppressed an unfixable warning.</li> <li><a href="https://github.com/elvisoric">Elvis Oric</a> improved Meson support.</li> <li><a href="https://github.com/Afforix">Matěj Plch</a> fixed an example in the README.</li> <li><a href="https://github.com/wythe">Mark Beckwith</a> fixed a typo.</li> <li><a href="https://github.com/scinart">scinart</a> fixed bug in the serializer.</li> <li><a href="https://github.com/pboettch">Patrick Boettcher</a> implemented <code>push_back()</code> and <code>pop_back()</code> for JSON Pointers.</li> <li><a href="https://github.com/nicoddemus">Bruno Oliveira</a> added support for Conda.</li> <li><a href="https://github.com/skypjack">Michele Caini</a> fixed links in the README.</li> <li><a href="https://github.com/hnkb">Hani</a> documented how to install the library with NuGet.</li> <li><a href="https://github.com/wythe">Mark Beckwith</a> fixed a typo.</li> <li><a href="https://github.com/yann-morin-1998">yann-morin-1998</a> helped to reduce the CMake requirement to version 3.1.</li> <li><a href="https://github.com/podsvirov">Konstantin Podsvirov</a> maintains a package for the MSYS2 software distro.</li> <li><a href="https://github.com/remyabel">remyabel</a> added GNUInstallDirs to the CMake files.</li> <li><a href="https://github.com/taylorhoward92">Taylor Howard</a> fixed a unit test.</li> <li><a href="https://github.com/Macr0Nerd">Gabe Ron</a> implemented the <code>to_string</code> method.</li> <li><a href="https://github.com/heavywatal">Watal M. Iwasaki</a> fixed a Clang warning.</li> <li><a href="https://github.com/onqtam">Viktor Kirilov</a> switched the unit tests from <a href="https://github.com/philsquared/Catch">Catch</a> to <a href="https://github.com/onqtam/doctest">doctest</a></li> <li><a href="https://github.com/ejcjason">Juncheng E</a> fixed a typo.</li> <li><a href="https://github.com/tete17">tete17</a> fixed a bug in the <code>contains</code> function.</li> <li><a href="https://github.com/Xav83">Xav83</a> fixed some cppcheck warnings.</li> <li><a href="https://github.com/0xflotus">0xflotus</a> fixed some typos.</li> <li><a href="https://github.com/chris0x44">Christian Deneke</a> added a const version of <code>json_pointer::back</code>.</li> <li><a href="https://github.com/crazyjul">Julien Hamaide</a> made the <code>items()</code> function work with custom string types.</li> <li><a href="https://github.com/nemequ">Evan Nemerson</a> updated fixed a bug in Hedley and updated this library accordingly.</li> <li><a href="https://github.com/flopp">Florian Pigorsch</a> fixed a lot of typos.</li> <li><a href="https://github.com/cbegue">Camille Bégué</a> fixed an issue in the conversion from <code>std::pair</code> and <code>std::tuple</code> to <code>json</code>.</li> <li><a href="https://github.com/AnthonyVH">Anthony VH</a> fixed a compile error in an enum deserialization.</li> <li><a href="https://github.com/ua-code-dragon">Yuriy Vountesmery</a> noted a subtle bug in a preprocessor check.</li> <li><a href="https://github.com/dota17">Chen</a> fixed numerous issues in the library.</li> <li><a href="https://github.com/aokellermann">Antony Kellermann</a> added a CI step for GCC 10.1.</li> <li><a href="https://github.com/gistrec">Alex</a> fixed an MSVC warning.</li> <li><a href="https://github.com/rvjr">Rainer</a> proposed an improvement in the floating-point serialization in CBOR.</li> <li><a href="https://github.com/FrancoisChabot">Francois Chabot</a> made performance improvements in the input adapters.</li> <li><a href="https://github.com/ArthurSonzogni">Arthur Sonzogni</a> documented how the library can be included via <code>FetchContent</code>.</li> <li><a href="https://github.com/rmisev">Rimas Misevičius</a> fixed an error message.</li> <li><a href="https://github.com/alexandermyasnikov">Alexander Myasnikov</a> fixed some examples and a link in the README.</li> <li><a href="https://github.com/uhoreg">Hubert Chathi</a> made CMake's version config file architecture-independent.</li> <li><a href="https://github.com/OmnipotentEntity">OmnipotentEntity</a> implemented the binary values for CBOR, MessagePack, BSON, and UBJSON.</li> <li><a href="https://github.com/ArtemSarmini">ArtemSarmini</a> fixed a compilation issue with GCC 10 and fixed a leak.</li> <li><a href="https://github.com/sea-kg">Evgenii Sopov</a> integrated the library to the wsjcpp package manager.</li> <li><a href="https://github.com/linev">Sergey Linev</a> fixed a compiler warning.</li> <li><a href="https://github.com/magamig">Miguel Magalhães</a> fixed the year in the copyright.</li> <li><a href="https://github.com/garethsb-sony">Gareth Sylvester-Bradley</a> fixed a compilation issue with MSVC.</li> <li><a href="https://github.com/alex-weej">Alexander “weej” Jones</a> fixed an example in the README.</li> <li><a href="https://github.com/Coeur">Antoine Cœur</a> fixed some typos in the documentation.</li> <li><a href="https://github.com/jothepro">jothepro</a> updated links to the Hunter package.</li> <li><a href="https://github.com/kastiglione">Dave Lee</a> fixed link in the README.</li> <li><a href="https://github.com/Klaim">Joël Lamotte</a> added instruction for using Build2's package manager.</li> <li><a href="https://github.com/pauljurczak">Paul Jurczak</a> fixed an example in the README.</li> <li><a href="https://github.com/sonulohani">Sonu Lohani</a> fixed a warning.</li> <li><a href="https://github.com/gocarlos">Carlos Gomes Martinho</a> updated the Conan package source.</li> <li><a href="https://github.com/podsvirov">Konstantin Podsvirov</a> fixed the MSYS2 package documentation.</li> <li><a href="https://github.com/Tridacnid">Tridacnid</a> improved the CMake tests.</li> <li><a href="https://github.com/MBalszun">Michael</a> fixed MSVC warnings.</li> <li><a href="https://github.com/quentin-dev">Quentin Barbarat</a> fixed an example in the documentation.</li> <li><a href="https://github.com/XyFreak">XyFreak</a> fixed a compiler warning.</li> <li><a href="https://github.com/TotalCaesar659">TotalCaesar659</a> fixed links in the README.</li> <li><a href="https://github.com/tanuj208">Tanuj Garg</a> improved the fuzzer coverage for UBSAN input.</li> <li><a href="https://github.com/AODQ">AODQ</a> fixed a compiler warning.</li> <li><a href="https://github.com/jwittbrodt">jwittbrodt</a> made <code>NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE</code> inline.</li> <li><a href="https://github.com/pfeatherstone">pfeatherstone</a> improved the upper bound of arguments of the <code>NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE</code>/<code>NLOHMANN_DEFINE_TYPE_INTRUSIVE</code> macros.</li> <li><a href="https://github.com/jprochazk">Jan Procházka</a> fixed a bug in the CBOR parser for binary and string values.</li> <li><a href="https://github.com/T0b1-iOS">T0b1-iOS</a> fixed a bug in the new hash implementation.</li> <li><a href="https://github.com/matthewbauer">Matthew Bauer</a> adjusted the CBOR writer to create tags for binary subtypes.</li> <li><a href="https://github.com/gatopeich">gatopeich</a> implemented an ordered map container for <code>nlohmann::ordered_json</code>.</li> <li><a href="https://github.com/ericonr">Érico Nogueira Rolim</a> added support for pkg-config.</li> <li><a href="https://github.com/KonanM">KonanM</a> proposed an implementation for the <code>NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE</code>/<code>NLOHMANN_DEFINE_TYPE_INTRUSIVE</code> macros.</li> <li><a href="https://github.com/gracicot">Guillaume Racicot</a> implemented <code>string_view</code> support and allowed C++20 support.</li> <li><a href="https://github.com/alexreinking">Alex Reinking</a> improved CMake support for <code>FetchContent</code>.</li> <li><a href="https://github.com/ssbssa">Hannes Domani</a> provided a GDB pretty printer.</li> <li>Lars Wirzenius reviewed the README file.</li> <li><a href="https://github.com/ongjunjie">Jun Jie</a> fixed a compiler path in the CMake scripts.</li> <li><a href="https://github.com/rbuch">Ronak Buch</a> fixed typos in the documentation.</li> <li><a href="https://github.com/karzhenkov">Alexander Karzhenkov</a> fixed a move constructor and the Travis builds.</li> <li><a href="https://github.com/leozz37">Leonardo Lima</a> added CPM.Cmake support.</li> <li><a href="https://github.com/jbzdarkid">Joseph Blackman</a> fixed a warning.</li> <li><a href="https://github.com/YarikTH">Yaroslav</a> updated doctest and implemented unit tests.</li> <li><a href="https://github.com/globberwops">Martin Stump</a> fixed a bug in the CMake files.</li> <li><a href="https://github.com/jasujm">Jaakko Moisio</a> fixed a bug in the input adapters.</li> <li><a href="https://github.com/bl-ue">bl-ue</a> fixed some Markdown issues in the README file.</li> <li><a href="https://github.com/wawiesel">William A. Wieselquist</a> fixed an example from the README.</li> <li><a href="https://github.com/abbaswasim">abbaswasim</a> fixed an example from the README.</li> <li><a href="https://github.com/remyjette">Remy Jette</a> fixed a warning.</li> <li><a href="https://github.com/frasermarlow">Fraser</a> fixed the documentation.</li> <li><a href="https://github.com/musicinmybrain">Ben Beasley</a> updated doctest.</li> <li><a href="https://github.com/doronbehar">Doron Behar</a> fixed pkg-config.pc.</li> <li><a href="https://github.com/raduteo">raduteo</a> fixed a warning.</li> <li><a href="https://github.com/theShmoo">David Pfahler</a> added the possibility to compile the library without I/O support.</li> <li><a href="https://github.com/mortenfyhn">Morten Fyhn Amundsen</a> fixed a typo.</li> <li><a href="https://github.com/jpl-mac">jpl-mac</a> allowed to treat the library as a system header in CMake.</li> <li><a href="https://github.com/jasmcaus">Jason Dsouza</a> fixed the indentation of the CMake file.</li> <li><a href="https://github.com/offa">offa</a> added a link to Conan Center to the documentation.</li> <li><a href="https://github.com/TotalCaesar659">TotalCaesar659</a> updated the links in the documentation to use HTTPS.</li> <li><a href="https://github.com/grafail">Rafail Giavrimis</a> fixed the Google Benchmark default branch.</li> <li><a href="https://github.com/ldionne">Louis Dionne</a> fixed a conversion operator.</li> <li><a href="https://github.com/justanotheranonymoususer">justanotheranonymoususer</a> made the examples in the README more consistent.</li> <li><a href="https://github.com/Finkman">Finkman</a> suppressed some <code>-Wfloat-equal</code> warnings.</li> <li><a href="https://github.com/fhuberts">Ferry Huberts</a> fixed <code>-Wswitch-enum</code> warnings.</li> <li><a href="https://github.com/senyai">Arseniy Terekhin</a> made the GDB pretty-printer robust against unset variable names.</li> <li><a href="https://github.com/amirmasoudabdol">Amir Masoud Abdol</a> updated the Homebrew command as nlohmann/json is now in homebrew-core.</li> <li><a href="https://github.com/Hallot">Hallot</a> fixed some <code>-Wextra-semi-stmt warnings</code>.</li> <li><a href="https://github.com/gcerretani">Giovanni Cerretani</a> fixed <code>-Wunused</code> warnings on <code>JSON_DIAGNOSTICS</code>.</li> <li><a href="https://github.com/Kapeli">Bogdan Popescu</a> hosts the <a href="https://github.com/Kapeli/Dash-User-Contributions/tree/master/docsets/JSON_for_Modern_C%2B%2B">docset</a> for offline documentation viewers.</li> <li><a href="https://github.com/carlsmedstad">Carl Smedstad</a> fixed an assertion error when using <code>JSON_DIAGNOSTICS</code>.</li> <li><a href="https://github.com/miikka75">miikka75</a> provided an important fix to compile C++17 code with Clang 9.</li> <li><a href="https://github.com/kernie">Maarten Becker</a> fixed a warning for shadowed variables.</li> <li><a href="https://github.com/axnsan12">Cristi Vîjdea</a> fixed typos in the <code>operator[]</code> documentation.</li> <li><a href="https://github.com/axic">Alex Beregszaszi</a> fixed spelling mistakes in comments.</li> <li><a href="https://github.com/striezel">Dirk Stolle</a> fixed typos in documentation.</li> <li><a href="https://github.com/daniel-kun">Daniel Albuschat</a> corrected the parameter name in the <code>parse</code> documentation.</li> <li><a href="https://github.com/Prince-Mendiratta">Prince Mendiratta</a> fixed a link to the FAQ.</li> <li><a href="https://github.com/falbrechtskirchinger">Florian Albrechtskirchinger</a> implemented <code>std::string_view</code> support for object keys and made dozens of other improvements.</li> <li><a href="https://github.com/fangq">Qianqian Fang</a> implemented the Binary JData (BJData) format.</li> <li><a href="https://github.com/pketelsen">pketelsen</a> added macros <code>NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT</code> and <code>NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT</code>.</li> <li><a href="https://github.com/DarkZeros">DarkZeros</a> adjusted to code to not clash with Arduino defines.</li> <li><a href="https://github.com/flagarde">flagarde</a> fixed the output of <code>meta()</code> for MSVC.</li> <li><a href="https://github.com/gcerretani">Giovanni Cerretani</a> fixed a check for <code>std::filesystem</code>.</li> <li><a href="https://github.com/rex4539">Dimitris Apostolou</a> fixed a typo.</li> <li><a href="https://github.com/fhuberts">Ferry Huberts</a> fixed a typo.</li> <li><a href="https://github.com/heinemml">Michael Nosthoff</a> fixed a typo.</li> <li><a href="https://github.com/jhnlee">JungHoon Lee</a> fixed a typo.</li> <li><a href="https://github.com/fdiblen">Faruk D.</a> fixed the CITATION.CFF file.</li> <li><a href="https://github.com/puffetto">Andrea Cocito</a> added a clarification on macro usage to the documentation.</li> <li><a href="https://github.com/kkarbowiak">Krzysiek Karbowiak</a> refactored the tests to use <code>CHECK_THROWS_WITH_AS</code>.</li> <li><a href="https://github.com/prncoprs">Chaoqi Zhang</a> fixed a typo.</li> <li><a href="https://github.com/ivanovmp">ivanovmp</a> fixed a whitespace error.</li> <li><a href="https://github.com/KsaNL">KsaNL</a> fixed a build error when including <code>&lt;windows.h&gt;</code>.</li> <li><a href="https://github.com/Tachi107">Andrea Pappacoda</a> moved <code>.pc</code> and <code>.cmake</code> files to <code>share</code> directory.</li> <li><a href="https://github.com/wolfv">Wolf Vollprecht</a> added the <code>patch_inplace</code> function.</li> <li><a href="https://github.com/jez">Jake Zimmerman</a> highlighted common usage patterns in the README file.</li> <li><a href="https://github.com/NN---">NN</a> added the Visual Studio output directory to <code>.gitignore</code>.</li> <li><a href="https://github.com/romainreignier">Romain Reignier</a> improved the performance the vector output adapter.</li> <li><a href="https://github.com/Mike-Leo-Smith">Mike</a> fixed the <code>std::iterator_traits</code>.</li> <li><a href="https://github.com/zxey">Richard Hozák</a> added macro <code>JSON_NO_ENUM</code> to disable default enum conversions.</li> <li><a href="https://github.com/vakokako">vakokako</a> fixed tests when compiling with C++20.</li> <li><a href="https://github.com/alexweej">Alexander “weej” Jones</a> fixed an example in the README.</li> <li><a href="https://github.com/eli-schwartz">Eli Schwartz</a> added more files to the <code>include.zip</code> archive.</li> <li><a href="https://github.com/kevinlul">Kevin Lu</a> fixed a compilation issue when typedefs with certain names were present.</li> <li><a href="https://github.com/luxe">Trevor Hickey</a> improved the description of an example.</li> <li><a href="https://github.com/jef">Jef LeCompte</a> updated the year in the README file.</li> <li><a href="https://github.com/ahamez">Alexandre Hamez</a> fixed a warning.</li> <li><a href="https://github.com/mbadhan">Maninderpal Badhan</a> fixed a typo.</li> <li><a href="https://github.com/kevin--">kevin--</a> added a note to an example in the README file.</li> <li><a href="https://github.com/wx257osn2">I</a> fixed a typo.</li> <li><a href="https://github.com/Lord-Kamina">Gregorio Litenstein</a> fixed the Clang detection.</li> <li><a href="https://github.com/andoma">Andreas Smas</a> added a Doozer badge.</li> <li><a href="https://github.com/wancw">WanCW</a> fixed the string conversion with Clang.</li> <li><a href="https://github.com/zhaohuaxishi">zhaohuaxishi</a> fixed a Doxygen error.</li> <li><a href="https://github.com/emvivre">emvivre</a> removed an invalid parameter from CMake.</li> <li><a href="https://github.com/Dobiasd">Tobias Hermann</a> fixed a link in the README file.</li> <li><a href="https://github.com/traits">Michael</a> fixed a warning.</li> <li><a href="https://github.com/ryanjmulder">Ryan Mulder</a> added <code>ensure_ascii</code> to the <code>dump</code> function.</li> <li><a href="https://github.com/murinicanor">Muri Nicanor</a> fixed the <code>sed</code> discovery in the Makefile.</li> <li><a href="https://github.com/dgavedissian">David Avedissian</a> implemented SFINAE-friendly <code>iterator_traits</code>.</li> <li><a href="https://github.com/aqnouch">AQNOUCH Mohammed</a> fixed a typo in the README.</li> <li><a href="https://github.com/garethsb">Gareth Sylvester-Bradley</a> added <code>operator/=</code> and <code>operator/</code> to construct JSON pointers.</li> <li><a href="https://github.com/mykter">Michael Macnair</a> added support for afl-fuzz testing.</li> <li><a href="https://github.com/berkus">Berkus Decker</a> fixed a typo in the README.</li> <li><a href="https://github.com/effolkronium">Illia Polishchuk</a> improved the CMake testing.</li> <li><a href="https://github.com/eltociear">Ikko Ashimine</a> fixed a typo.</li> <li><a href="https://github.com/barcode">Raphael Grimm</a> added the possibility to define a custom base class.</li> <li><a href="https://github.com/tocic">tocic</a> fixed typos in the documentation.</li> <li><a href="https://github.com/Vertexwahn">Vertexwahn</a> added Bazel build support.</li> <li><a href="https://github.com/striezel">Dirk Stolle</a> fixed typos in the documentation.</li> <li><a href="https://github.com/DavidKorczynski">DavidKorczynski</a> added a CIFuzz CI GitHub action.</li> <li><a href="https://github.com/Finkman">Finkman</a> fixed the debug pretty-printer.</li> <li><a href="https://github.com/floriansegginger">Florian Segginger</a> bumped the years in the README.</li> <li><a href="https://github.com/haadfida">haadfida</a> cleaned up the badges of used services.</li> <li><a href="https://github.com/ArsenArsen">Arsen Arsenović</a> fixed a build error.</li> <li><a href="https://github.com/theevilone45">theevilone45</a> fixed a typo in a CMake file.</li> <li><a href="https://github.com/trofi">Sergei Trofimovich</a> fixed the custom allocator support.</li> <li><a href="https://github.com/joycebrum">Joyce</a> fixed some security issues in the GitHub workflows.</li> <li><a href="https://github.com/njakob">Nicolas Jakob</a> add vcpkg version badge.</li> <li><a href="https://github.com/Tomerkm">Tomerkm</a> added tests.</li> <li><a href="https://github.com/tusooa">No.</a> fixed the use of <code>get&lt;&gt;</code> calls.</li> <li><a href="https://github.com/tarolling">taro</a> fixed a typo in the <code>CODEOWNERS</code> file.</li> <li><a href="https://github.com/eltociear">Ikko Eltociear Ashimine</a> fixed a typo.</li> <li><a href="https://github.com/felixonmars">Felix Yan</a> fixed a typo in the README.</li> <li><a href="https://github.com/HO-COOH">HO-COOH</a> fixed a parentheses in the documentation.</li> <li><a href="https://github.com/iwanders">Ivor Wanders</a> fixed the examples to catch exception by <code>const&amp;</code>.</li> <li><a href="https://github.com/miny1233">miny1233</a> fixed a parentheses in the documentation.</li> <li><a href="https://github.com/tomalakgeretkal">tomalakgeretkal</a> fixed a compilation error.</li> <li><a href="https://github.com/ALF-ONE">alferov</a> fixed a compilation error.</li> <li><a href="https://github.com/craigscott-crascit">Craig Scott</a> fixed a deprecation warning in CMake.</li> <li><a href="https://github.com/ZeronSix">Vyacheslav Zhdanovskiy</a> added macros for serialization-only types.</li> <li><a href="https://github.com/mwestphal">Mathieu Westphal</a> fixed typos.</li> <li><a href="https://github.com/scribam">scribam</a> fixed the MinGW workflow.</li> <li><a href="https://github.com/aleksproger">Aleksei Sapitskii</a> added support for Apple's Swift Package Manager.</li> <li><a href="https://github.com/bebuch">Benjamin Buch</a> fixed the installation path in CMake.</li> <li><a href="https://github.com/colbychaskell">Colby Haskell</a> clarified the parse error message in case a file cannot be opened.</li> </ol> <p dir="auto">Thanks a lot for helping out! Please <a href="mailto:mail@nlohmann.me">let me know</a> if I forgot someone.</p> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Used third-party tools</h2><a id="user-content-used-third-party-tools" class="anchor" aria-label="Permalink: Used third-party tools" href="#used-third-party-tools"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The library itself consists of a single header file licensed under the MIT license. However, it is built, tested, documented, and whatnot using a lot of third-party tools and services. Thanks a lot!</p> <ul dir="auto"> <li><a href="https://github.com/edlund/amalgamate"><strong>amalgamate.py - Amalgamate C source and header files</strong></a> to create a single header file</li> <li><a href="https://lcamtuf.coredump.cx/afl/" rel="nofollow"><strong>American fuzzy lop</strong></a> for fuzz testing</li> <li><a href="https://www.appveyor.com" rel="nofollow"><strong>AppVeyor</strong></a> for <a href="https://ci.appveyor.com/project/nlohmann/json" rel="nofollow">continuous integration</a> on Windows</li> <li><a href="http://astyle.sourceforge.net" rel="nofollow"><strong>Artistic Style</strong></a> for automatic source code indentation</li> <li><a href="https://clang.llvm.org" rel="nofollow"><strong>Clang</strong></a> for compilation with code sanitizers</li> <li><a href="https://cmake.org" rel="nofollow"><strong>CMake</strong></a> for build automation</li> <li><a href="https://www.codacy.com" rel="nofollow"><strong>Codacy</strong></a> for further <a href="https://app.codacy.com/gh/nlohmann/json/dashboard" rel="nofollow">code analysis</a></li> <li><a href="https://coveralls.io" rel="nofollow"><strong>Coveralls</strong></a> to measure <a href="https://coveralls.io/github/nlohmann/json" rel="nofollow">code coverage</a></li> <li><a href="https://scan.coverity.com" rel="nofollow"><strong>Coverity Scan</strong></a> for <a href="https://scan.coverity.com/projects/nlohmann-json" rel="nofollow">static analysis</a></li> <li><a href="http://cppcheck.sourceforge.net" rel="nofollow"><strong>cppcheck</strong></a> for static analysis</li> <li><a href="https://github.com/onqtam/doctest"><strong>doctest</strong></a> for the unit tests</li> <li><a href="https://github.com/skywinder/github-changelog-generator"><strong>GitHub Changelog Generator</strong></a> to generate the <a href="https://github.com/nlohmann/json/blob/develop/ChangeLog.md">ChangeLog</a></li> <li><a href="https://github.com/google/benchmark"><strong>Google Benchmark</strong></a> to implement the benchmarks</li> <li><a href="https://nemequ.github.io/hedley/" rel="nofollow"><strong>Hedley</strong></a> to avoid re-inventing several compiler-agnostic feature macros</li> <li><a href="https://github.com/linux-test-project/lcov"><strong>lcov</strong></a> to process coverage information and create an HTML view</li> <li><a href="https://llvm.org/docs/LibFuzzer.html" rel="nofollow"><strong>libFuzzer</strong></a> to implement fuzz testing for OSS-Fuzz</li> <li><a href="https://squidfunk.github.io/mkdocs-material/" rel="nofollow"><strong>Material for MkDocs</strong></a> for the style of the documentation site</li> <li><a href="https://www.mkdocs.org" rel="nofollow"><strong>MkDocs</strong></a> for the documentation site</li> <li><a href="https://github.com/google/oss-fuzz"><strong>OSS-Fuzz</strong></a> for continuous fuzz testing of the library (<a href="https://github.com/google/oss-fuzz/tree/master/projects/json">project repository</a>)</li> <li><a href="https://probot.github.io" rel="nofollow"><strong>Probot</strong></a> for automating maintainer tasks such as closing stale issues, requesting missing information, or detecting toxic comments.</li> <li><a href="https://valgrind.org" rel="nofollow"><strong>Valgrind</strong></a> to check for correct memory management</li> </ul> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Notes</h2><a id="user-content-notes" class="anchor" aria-label="Permalink: Notes" href="#notes"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Character encoding</h3><a id="user-content-character-encoding" class="anchor" aria-label="Permalink: Character encoding" href="#character-encoding"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">The library supports <strong>Unicode input</strong> as follows:</p> <ul dir="auto"> <li>Only <strong>UTF-8</strong> encoded input is supported which is the default encoding for JSON according to <a href="https://tools.ietf.org/html/rfc8259.html#section-8.1" rel="nofollow">RFC 8259</a>.</li> <li><code>std::u16string</code> and <code>std::u32string</code> can be parsed, assuming UTF-16 and UTF-32 encoding, respectively. These encodings are not supported when reading from files or other input containers.</li> <li>Other encodings such as Latin-1 or ISO 8859-1 are <strong>not</strong> supported and will yield parse or serialization errors.</li> <li><a href="https://www.unicode.org/faq/private_use.html#nonchar1" rel="nofollow">Unicode noncharacters</a> will not be replaced by the library.</li> <li>Invalid surrogates (e.g., incomplete pairs such as <code>\uDEAD</code>) will yield parse errors.</li> <li>The strings stored in the library are UTF-8 encoded. When using the default string type (<code>std::string</code>), note that its length/size functions return the number of stored bytes rather than the number of characters or glyphs.</li> <li>When you store strings with different encodings in the library, calling <a href="https://json.nlohmann.me/api/basic_json/dump/" rel="nofollow"><code>dump()</code></a> may throw an exception unless <code>json::error_handler_t::replace</code> or <code>json::error_handler_t::ignore</code> are used as error handlers.</li> <li>To store wide strings (e.g., <code>std::wstring</code>), you need to convert them to a UTF-8 encoded <code>std::string</code> before, see <a href="https://json.nlohmann.me/home/faq/#wide-string-handling" rel="nofollow">an example</a>.</li> </ul> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Comments in JSON</h3><a id="user-content-comments-in-json" class="anchor" aria-label="Permalink: Comments in JSON" href="#comments-in-json"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">This library does not support comments by default. It does so for three reasons:</p> <ol dir="auto"> <li> <p dir="auto">Comments are not part of the <a href="https://tools.ietf.org/html/rfc8259" rel="nofollow">JSON specification</a>. You may argue that <code>//</code> or <code>/* */</code> are allowed in JavaScript, but JSON is not JavaScript.</p> </li> <li> <p dir="auto">This was not an oversight: Douglas Crockford <a href="https://plus.google.com/118095276221607585885/posts/RK8qyGVaGSr" rel="nofollow">wrote on this</a> in May 2012:</p> <blockquote> <p dir="auto">I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it shouldn't.</p> <p dir="auto">Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser.</p> </blockquote> </li> <li> <p dir="auto">It is dangerous for interoperability if some libraries would add comment support while others don't. Please check <a href="https://tools.ietf.org/html/draft-iab-protocol-maintenance-01" rel="nofollow">The Harmful Consequences of the Robustness Principle</a> on this.</p> </li> </ol> <p dir="auto">However, you can pass set parameter <code>ignore_comments</code> to true in the <code>parse</code> function to ignore <code>//</code> or <code>/* */</code> comments. Comments will then be treated as whitespace.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Order of object keys</h3><a id="user-content-order-of-object-keys" class="anchor" aria-label="Permalink: Order of object keys" href="#order-of-object-keys"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">By default, the library does not preserve the <strong>insertion order of object elements</strong>. This is standards-compliant, as the <a href="https://tools.ietf.org/html/rfc8259.html" rel="nofollow">JSON standard</a> defines objects as "an unordered collection of zero or more name/value pairs".</p> <p dir="auto">If you do want to preserve the insertion order, you can try the type <a href="https://github.com/nlohmann/json/issues/2179" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/2179/hovercard"><code>nlohmann::ordered_json</code></a>. Alternatively, you can use a more sophisticated ordered map like <a href="https://github.com/Tessil/ordered-map"><code>tsl::ordered_map</code></a> (<a href="https://github.com/nlohmann/json/issues/546#issuecomment-304447518" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/546/hovercard">integration</a>) or <a href="https://github.com/nlohmann/fifo_map"><code>nlohmann::fifo_map</code></a> (<a href="https://github.com/nlohmann/json/issues/485#issuecomment-333652309" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/485/hovercard">integration</a>).</p> <p dir="auto">See the <a href="https://json.nlohmann.me/features/object_order/" rel="nofollow"><strong>documentation on object order</strong></a> for more information.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Memory Release</h3><a id="user-content-memory-release" class="anchor" aria-label="Permalink: Memory Release" href="#memory-release"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">We checked with Valgrind and the Address Sanitizer (ASAN) that there are no memory leaks.</p> <p dir="auto">If you find that a parsing program with this library does not release memory, please consider the following case, and it may be unrelated to this library.</p> <p dir="auto"><strong>Your program is compiled with glibc.</strong> There is a tunable threshold that glibc uses to decide whether to actually return memory to the system or whether to cache it for later reuse. If in your program you make lots of small allocations and those small allocations are not a contiguous block and are presumably below the threshold, then they will not get returned to the OS. Here is a related issue <a href="https://github.com/nlohmann/json/issues/1924" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/1924/hovercard">#1924</a>.</p> <div class="markdown-heading" dir="auto"><h3 tabindex="-1" class="heading-element" dir="auto">Further notes</h3><a id="user-content-further-notes" class="anchor" aria-label="Permalink: Further notes" href="#further-notes"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <ul dir="auto"> <li>The code contains numerous debug <strong>assertions</strong> which can be switched off by defining the preprocessor macro <code>NDEBUG</code>, see the <a href="https://en.cppreference.com/w/cpp/error/assert" rel="nofollow">documentation of <code>assert</code></a>. In particular, note <a href="https://json.nlohmann.me/api/basic_json/operator%5B%5D/" rel="nofollow"><code>operator[]</code></a> implements <strong>unchecked access</strong> for const objects: If the given key is not present, the behavior is undefined (think of a dereferenced null pointer) and yields an <a href="https://github.com/nlohmann/json/issues/289" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/289/hovercard">assertion failure</a> if assertions are switched on. If you are not sure whether an element in an object exists, use checked access with the <a href="https://json.nlohmann.me/api/basic_json/at/" rel="nofollow"><code>at()</code> function</a>. Furthermore, you can define <code>JSON_ASSERT(x)</code> to replace calls to <code>assert(x)</code>. See the <a href="https://json.nlohmann.me/features/assertions/" rel="nofollow"><strong>documentation on runtime assertions</strong></a> for more information.</li> <li>As the exact number type is not defined in the <a href="https://tools.ietf.org/html/rfc8259.html" rel="nofollow">JSON specification</a>, this library tries to choose the best fitting C++ number type automatically. As a result, the type <code>double</code> may be used to store numbers which may yield <a href="https://github.com/nlohmann/json/issues/181" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/181/hovercard"><strong>floating-point exceptions</strong></a> in certain rare situations if floating-point exceptions have been unmasked in the calling code. These exceptions are not caused by the library and need to be fixed in the calling code, such as by re-masking the exceptions prior to calling library functions.</li> <li>The code can be compiled without C++ <strong>runtime type identification</strong> features; that is, you can use the <code>-fno-rtti</code> compiler flag.</li> <li><strong>Exceptions</strong> are used widely within the library. They can, however, be switched off with either using the compiler flag <code>-fno-exceptions</code> or by defining the symbol <code>JSON_NOEXCEPTION</code>. In this case, exceptions are replaced by <code>abort()</code> calls. You can further control this behavior by defining <code>JSON_THROW_USER</code> (overriding <code>throw</code>), <code>JSON_TRY_USER</code> (overriding <code>try</code>), and <code>JSON_CATCH_USER</code> (overriding <code>catch</code>). Note that <code>JSON_THROW_USER</code> should leave the current scope (e.g., by throwing or aborting), as continuing after it may yield undefined behavior. Note the explanatory <a href="https://en.cppreference.com/w/cpp/error/exception/what" rel="nofollow"><code>what()</code></a> string of exceptions is not available for MSVC if exceptions are disabled, see <a href="https://github.com/nlohmann/json/discussions/2824" data-hovercard-type="discussion" data-hovercard-url="/nlohmann/json/discussions/2824/hovercard">#2824</a>. See the <a href="https://json.nlohmann.me/home/exceptions/" rel="nofollow"><strong>documentation of exceptions</strong></a> for more information.</li> </ul> <div class="markdown-heading" dir="auto"><h2 tabindex="-1" class="heading-element" dir="auto">Execute unit tests</h2><a id="user-content-execute-unit-tests" class="anchor" aria-label="Permalink: Execute unit tests" href="#execute-unit-tests"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div> <p dir="auto">To compile and run the tests, you need to execute</p> <div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="mkdir build cd build cmake .. -DJSON_BuildTests=On cmake --build . ctest --output-on-failure"><pre>mkdir build <span class="pl-c1">cd</span> build cmake .. -DJSON_BuildTests=On cmake --build <span class="pl-c1">.</span> ctest --output-on-failure</pre></div> <p dir="auto">Note that during the <code>ctest</code> stage, several JSON test files are downloaded from an <a href="https://github.com/nlohmann/json_test_data">external repository</a>. If policies forbid downloading artifacts during testing, you can download the files yourself and pass the directory with the test files via <code>-DJSON_TestDataDirectory=path</code> to CMake. Then, no Internet connectivity is required. See <a href="https://github.com/nlohmann/json/issues/2189" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/2189/hovercard">issue #2189</a> for more information.</p> <p dir="auto">If the test suite is not found, several test suites will fail like this:</p> <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="=============================================================================== json/tests/src/make_test_data_available.hpp:21: TEST CASE: check test suite is downloaded json/tests/src/make_test_data_available.hpp:23: FATAL ERROR: REQUIRE( utils::check_testsuite_downloaded() ) is NOT correct! values: REQUIRE( false ) logged: Test data not found in 'json/cmake-build-debug/json_test_data'. Please execute target 'download_test_data' before running this test suite. See &lt;https://github.com/nlohmann/json#execute-unit-tests&gt; for more information. ==============================================================================="><pre class="notranslate"><code>=============================================================================== json/tests/src/make_test_data_available.hpp:21: TEST CASE: check test suite is downloaded json/tests/src/make_test_data_available.hpp:23: FATAL ERROR: REQUIRE( utils::check_testsuite_downloaded() ) is NOT correct! values: REQUIRE( false ) logged: Test data not found in 'json/cmake-build-debug/json_test_data'. Please execute target 'download_test_data' before running this test suite. See &lt;https://github.com/nlohmann/json#execute-unit-tests&gt; for more information. =============================================================================== </code></pre></div> <p dir="auto">In case you have downloaded the library rather than checked out the code via Git, test <code>cmake_fetch_content_configure</code> will fail. Please execute <code>ctest -LE git_required</code> to skip these tests. See <a href="https://github.com/nlohmann/json/issues/2189" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/2189/hovercard">issue #2189</a> for more information.</p> <p dir="auto">Some tests change the installed files and hence make the whole process not reproducible. Please execute <code>ctest -LE not_reproducible</code> to skip these tests. See <a href="https://github.com/nlohmann/json/issues/2324" data-hovercard-type="issue" data-hovercard-url="/nlohmann/json/issues/2324/hovercard">issue #2324</a> for more information. Furthermore, assertions must be switched off to ensure reproducible builds (see <a href="https://github.com/nlohmann/json/discussions/4494" data-hovercard-type="discussion" data-hovercard-url="/nlohmann/json/discussions/4494/hovercard">discussion 4494</a>).</p> <p dir="auto">Note you need to call <code>cmake -LE "not_reproducible|git_required"</code> to exclude both labels. See <a href="https://github.com/nlohmann/json/issues/2596" data-hovercard-type="discussion" data-hovercard-url="/nlohmann/json/discussions/2596/hovercard">issue #2596</a> for more information.</p> <p dir="auto">As Intel compilers use unsafe floating point optimization by default, the unit tests may fail. Use flag <a href="https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/fp-model-fp.html" rel="nofollow"><code>/fp:precise</code></a> then.</p> </article></div></div></div></div></div> <!-- --> <!-- --> <script type="application/json" id="__PRIMER_DATA_:R0:__">{"resolvedServerColorMode":"day"}</script></div> </react-partial> <input type="hidden" data-csrf="true" value="jdI9S9LnMaD5GUN0djayrDDpfguJK/v6eSmnk5347U9lad2wIH/eYVNvOwc/GoMvPQ6x11+jx0PHHDqfK+fZUg==" /> </div> <div data-view-component="true" class="Layout-sidebar"> <div class="BorderGrid about-margin" data-pjax> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <div class="hide-sm hide-md"> <h2 class="mb-3 h4">About</h2> <p class="f4 my-3"> JSON for Modern C++ </p> <div class="my-3 d-flex flex-items-center"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-link flex-shrink-0 mr-2"> <path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path> </svg> <span class="flex-auto min-width-0 css-truncate css-truncate-target width-fit"> <a title="https://json.nlohmann.me" role="link" target="_blank" rel="noopener noreferrer nofollow" class="text-bold" href="https://json.nlohmann.me">json.nlohmann.me</a> </span> </div> <h3 class="sr-only">Topics</h3> <div class="my-3"> <div class="f6"> <a href="/topics/json" title="Topic: json" data-view-component="true" class="topic-tag topic-tag-link"> json </a> <a href="/topics/json-serialization" title="Topic: json-serialization" data-view-component="true" class="topic-tag topic-tag-link"> json-serialization </a> <a href="/topics/msgpack" title="Topic: msgpack" data-view-component="true" class="topic-tag topic-tag-link"> msgpack </a> <a href="/topics/cbor" title="Topic: cbor" data-view-component="true" class="topic-tag topic-tag-link"> cbor </a> <a href="/topics/json-parser" title="Topic: json-parser" data-view-component="true" class="topic-tag topic-tag-link"> json-parser </a> <a href="/topics/header-only" title="Topic: header-only" data-view-component="true" class="topic-tag topic-tag-link"> header-only </a> <a href="/topics/messagepack" title="Topic: messagepack" data-view-component="true" class="topic-tag topic-tag-link"> messagepack </a> <a href="/topics/json-pointer" title="Topic: json-pointer" data-view-component="true" class="topic-tag topic-tag-link"> json-pointer </a> <a href="/topics/json-patch" title="Topic: json-patch" data-view-component="true" class="topic-tag topic-tag-link"> json-patch </a> <a href="/topics/stl-containers" title="Topic: stl-containers" data-view-component="true" class="topic-tag topic-tag-link"> stl-containers </a> <a href="/topics/rfc-6901" title="Topic: rfc-6901" data-view-component="true" class="topic-tag topic-tag-link"> rfc-6901 </a> <a href="/topics/rfc-6902" title="Topic: rfc-6902" data-view-component="true" class="topic-tag topic-tag-link"> rfc-6902 </a> <a href="/topics/rfc-7159" title="Topic: rfc-7159" data-view-component="true" class="topic-tag topic-tag-link"> rfc-7159 </a> <a href="/topics/rfc-7049" title="Topic: rfc-7049" data-view-component="true" class="topic-tag topic-tag-link"> rfc-7049 </a> <a href="/topics/json-diff" title="Topic: json-diff" data-view-component="true" class="topic-tag topic-tag-link"> json-diff </a> <a href="/topics/bson" title="Topic: bson" data-view-component="true" class="topic-tag topic-tag-link"> bson </a> <a href="/topics/ubjson" title="Topic: ubjson" data-view-component="true" class="topic-tag topic-tag-link"> ubjson </a> <a href="/topics/json-merge-patch" title="Topic: json-merge-patch" data-view-component="true" class="topic-tag topic-tag-link"> json-merge-patch </a> <a href="/topics/rfc-8259" title="Topic: rfc-8259" data-view-component="true" class="topic-tag topic-tag-link"> rfc-8259 </a> </div> </div> <h3 class="sr-only">Resources</h3> <div class="mt-2"> <a class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:readme&quot;}" href="#readme-ov-file"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-book mr-2"> <path d="M0 1.75A.75.75 0 0 1 .75 1h4.253c1.227 0 2.317.59 3 1.501A3.743 3.743 0 0 1 11.006 1h4.245a.75.75 0 0 1 .75.75v10.5a.75.75 0 0 1-.75.75h-4.507a2.25 2.25 0 0 0-1.591.659l-.622.621a.75.75 0 0 1-1.06 0l-.622-.621A2.25 2.25 0 0 0 5.258 13H.75a.75.75 0 0 1-.75-.75Zm7.251 10.324.004-5.073-.002-2.253A2.25 2.25 0 0 0 5.003 2.5H1.5v9h3.757a3.75 3.75 0 0 1 1.994.574ZM8.755 4.75l-.004 7.322a3.752 3.752 0 0 1 1.992-.572H14.5v-9h-3.495a2.25 2.25 0 0 0-2.25 2.25Z"></path> </svg> Readme </a> </div> <h3 class="sr-only">License</h3> <div class="mt-2"> <a href="#MIT-1-ov-file" class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:license&quot;}" > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-law mr-2"> <path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path> </svg> MIT license </a> </div> <h3 class="sr-only">Code of conduct</h3> <div class="mt-2"> <a href="#coc-ov-file" class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:code of conduct&quot;}" > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-code-of-conduct mr-2"> <path d="M8.048 2.241c.964-.709 2.079-1.238 3.325-1.241a4.616 4.616 0 0 1 3.282 1.355c.41.408.757.86.996 1.428.238.568.348 1.206.347 1.968 0 2.193-1.505 4.254-3.081 5.862-1.496 1.526-3.213 2.796-4.249 3.563l-.22.163a.749.749 0 0 1-.895 0l-.221-.163c-1.036-.767-2.753-2.037-4.249-3.563C1.51 10.008.007 7.952.002 5.762a4.614 4.614 0 0 1 1.353-3.407C3.123.585 6.223.537 8.048 2.24Zm-1.153.983c-1.25-1.033-3.321-.967-4.48.191a3.115 3.115 0 0 0-.913 2.335c0 1.556 1.109 3.24 2.652 4.813C5.463 11.898 6.96 13.032 8 13.805c.353-.262.758-.565 1.191-.905l-1.326-1.223a.75.75 0 0 1 1.018-1.102l1.48 1.366c.328-.281.659-.577.984-.887L9.99 9.802a.75.75 0 1 1 1.019-1.103l1.384 1.28c.295-.329.566-.661.81-.995L12.92 8.7l-1.167-1.168c-.674-.671-1.78-.664-2.474.03-.268.269-.538.537-.802.797-.893.882-2.319.843-3.185-.032-.346-.35-.693-.697-1.043-1.047a.75.75 0 0 1-.04-1.016c.162-.191.336-.401.52-.623.62-.748 1.356-1.637 2.166-2.417Zm7.112 4.442c.313-.65.491-1.293.491-1.916v-.001c0-.614-.088-1.045-.23-1.385-.143-.339-.357-.633-.673-.949a3.111 3.111 0 0 0-2.218-.915c-1.092.003-2.165.627-3.226 1.602-.823.755-1.554 1.637-2.228 2.45l-.127.154.562.566a.755.755 0 0 0 1.066.02l.794-.79c1.258-1.258 3.312-1.31 4.594-.032.396.394.792.791 1.173 1.173Z"></path> </svg> Code of conduct </a> </div> <h3 class="sr-only">Security policy</h3> <div class="mt-2"> <a href="#security-ov-file" class="Link--muted" data-analytics-event="{&quot;category&quot;:&quot;Repository Overview&quot;,&quot;action&quot;:&quot;click&quot;,&quot;label&quot;:&quot;location:sidebar;file:security policy&quot;}" > <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-law mr-2"> <path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path> </svg> Security policy </a> </div> <include-fragment src="/nlohmann/json/hovercards/citation/sidebar_partial?tree_name=develop"> </include-fragment> <div class="mt-2"> <a href="/nlohmann/json/activity" data-view-component="true" class="Link Link--muted"><svg text="gray" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-pulse mr-2"> <path d="M6 2c.306 0 .582.187.696.471L10 10.731l1.304-3.26A.751.751 0 0 1 12 7h3.25a.75.75 0 0 1 0 1.5h-2.742l-1.812 4.528a.751.751 0 0 1-1.392 0L6 4.77 4.696 8.03A.75.75 0 0 1 4 8.5H.75a.75.75 0 0 1 0-1.5h2.742l1.812-4.529A.751.751 0 0 1 6 2Z"></path> </svg> <span class="color-fg-muted">Activity</span></a> </div> <h3 class="sr-only">Stars</h3> <div class="mt-2"> <a href="/nlohmann/json/stargazers" data-view-component="true" class="Link Link--muted"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-star mr-2"> <path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694Z"></path> </svg> <strong>44.9k</strong> stars</a> </div> <h3 class="sr-only">Watchers</h3> <div class="mt-2"> <a href="/nlohmann/json/watchers" data-view-component="true" class="Link Link--muted"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-eye mr-2"> <path d="M8 2c1.981 0 3.671.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.62 1.62 0 0 1 0 1.798c-.45.678-1.367 1.932-2.637 3.023C11.67 13.008 9.981 14 8 14c-1.981 0-3.671-.992-4.933-2.078C1.797 10.83.88 9.576.43 8.898a1.62 1.62 0 0 1 0-1.798c.45-.677 1.367-1.931 2.637-3.022C4.33 2.992 6.019 2 8 2ZM1.679 7.932a.12.12 0 0 0 0 .136c.411.622 1.241 1.75 2.366 2.717C5.176 11.758 6.527 12.5 8 12.5c1.473 0 2.825-.742 3.955-1.715 1.124-.967 1.954-2.096 2.366-2.717a.12.12 0 0 0 0-.136c-.412-.621-1.242-1.75-2.366-2.717C10.824 4.242 9.473 3.5 8 3.5c-1.473 0-2.825.742-3.955 1.715-1.124.967-1.954 2.096-2.366 2.717ZM8 10a2 2 0 1 1-.001-3.999A2 2 0 0 1 8 10Z"></path> </svg> <strong>755</strong> watching</a> </div> <h3 class="sr-only">Forks</h3> <div class="mt-2"> <a href="/nlohmann/json/forks" data-view-component="true" class="Link Link--muted"><svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-repo-forked mr-2"> <path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"></path> </svg> <strong>6.9k</strong> forks</a> </div> <div class="mt-2"> <a class="Link--muted" href="/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fnlohmann%2Fjson&amp;report=nlohmann+%28user%29"> Report repository </a> </div> </div> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame"> <a href="/nlohmann/json/releases" data-view-component="true" class="Link--primary no-underline Link">Releases <span title="44" data-view-component="true" class="Counter">44</span></a></h2> <a class="Link--primary d-flex no-underline" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/nlohmann/json/releases/tag/v3.11.3"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-tag flex-shrink-0 mt-1 color-fg-success"> <path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"></path> </svg> <div class="ml-2 min-width-0"> <div class="d-flex"> <span class="css-truncate css-truncate-target text-bold mr-2" style="max-width: none;">JSON for Modern C++ version 3.11.3</span> <span title="Label: Latest" data-view-component="true" class="Label Label--success flex-shrink-0"> Latest </span> </div> <div class="text-small color-fg-muted"><relative-time datetime="2023-11-28T21:38:09Z" class="no-wrap">Nov 28, 2023</relative-time></div> </div> </a> <div data-view-component="true" class="mt-3"> <a text="small" data-pjax="#repo-content-pjax-container" data-turbo-frame="repo-content-turbo-frame" href="/nlohmann/json/releases" data-view-component="true" class="Link">+ 43 releases</a></div> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3">Sponsor this project</h2> <include-fragment src="/nlohmann/json/sponsors_list?block_button=false&amp;current_repository=json" aria-busy="true" aria-label="Loading sponsorable links"> <ul class="list-style-none"> <li class="mb-2 d-flex"> <div class="Skeleton avatar avatar-user mr-2" style="width:32px;height:32px;"></div> <div class="Skeleton Skeleton--text flex-1 flex-self-center f4">&nbsp;</div> </li> </ul> </include-fragment> <ul class="list-style-none"> <li class="mb-2 d-flex"> <span class="mr-2 d-flex flex-items-center flex-justify-center" style="min-width:32px;height:32px;"> <svg class="octicon octicon-link color-fg-muted" alt="custom" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg> </span> <span class="flex-self-center flex-auto min-width-0 css-truncate css-truncate-target width-fit"> <a target="_blank" data-ga-click="Dashboard, click, Nav menu - item:org-profile context:organization" data-hydro-click="{&quot;event_type&quot;:&quot;sponsors.repo_funding_links_link_click&quot;,&quot;payload&quot;:{&quot;platform&quot;:{&quot;platform_type&quot;:&quot;CUSTOM&quot;,&quot;platform_url&quot;:&quot;https://paypal.me/nlohmann&quot;},&quot;platforms&quot;:[{&quot;platform_type&quot;:&quot;GITHUB&quot;,&quot;platform_url&quot;:&quot;https://github.com/nlohmann&quot;},{&quot;platform_type&quot;:&quot;CUSTOM&quot;,&quot;platform_url&quot;:&quot;https://paypal.me/nlohmann&quot;}],&quot;repo_id&quot;:11171548,&quot;owner_id&quot;:159488,&quot;user_id&quot;:null,&quot;originating_url&quot;:&quot;https://github.com/nlohmann/json&quot;}}" data-hydro-click-hmac="bb79df84d7be4855c256320bb069aa01d8f993b93d693646c29f1aa3cebf5559" rel="noopener noreferrer" href="https://paypal.me/nlohmann">https://paypal.me/nlohmann</a> </span> </li> </ul> <div class="text-small mt-3"> <a href="/sponsors">Learn more about GitHub Sponsors</a> </div> </div> </div> <div class="BorderGrid-row" hidden> <div class="BorderGrid-cell"> <include-fragment src="/nlohmann/json/used_by_list" accept="text/fragment+html"> </include-fragment> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3"> <a href="/nlohmann/json/graphs/contributors" data-view-component="true" class="Link--primary no-underline Link d-flex flex-items-center">Contributors <span title="298" data-view-component="true" class="Counter ml-1">298</span></a></h2> <ul class="list-style-none d-flex flex-wrap mb-n2"> <li class="mb-2 mr-2" > <a href="https://github.com/nlohmann" class="" data-hovercard-type="user" data-hovercard-url="/users/nlohmann/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/159488?s=64&amp;v=4" alt="@nlohmann" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/theodelrieu" class="" data-hovercard-type="user" data-hovercard-url="/users/theodelrieu/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/15652306?s=64&amp;v=4" alt="@theodelrieu" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/falbrechtskirchinger" class="" data-hovercard-type="user" data-hovercard-url="/users/falbrechtskirchinger/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/320854?s=64&amp;v=4" alt="@falbrechtskirchinger" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/Teemperor" class="" data-hovercard-type="user" data-hovercard-url="/users/Teemperor/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/736001?s=64&amp;v=4" alt="@Teemperor" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/aburgh" class="" data-hovercard-type="user" data-hovercard-url="/users/aburgh/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/191582?s=64&amp;v=4" alt="@aburgh" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/apps/dependabot" class="" > <img src="https://avatars.githubusercontent.com/in/29110?s=64&amp;v=4" alt="@dependabot[bot]" size="32" height="32" width="32" data-view-component="true" class="avatar" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/dota17" class="" data-hovercard-type="user" data-hovercard-url="/users/dota17/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/50514813?s=64&amp;v=4" alt="@dota17" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/nickaein" class="" data-hovercard-type="user" data-hovercard-url="/users/nickaein/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/8047027?s=64&amp;v=4" alt="@nickaein" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/julian-becker" class="" data-hovercard-type="user" data-hovercard-url="/users/julian-becker/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/9198957?s=64&amp;v=4" alt="@julian-becker" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/AnthonyVH" class="" data-hovercard-type="user" data-hovercard-url="/users/AnthonyVH/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/2694786?s=64&amp;v=4" alt="@AnthonyVH" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/t-b" class="" data-hovercard-type="user" data-hovercard-url="/users/t-b/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/1185677?s=64&amp;v=4" alt="@t-b" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/HenryRLee" class="" data-hovercard-type="user" data-hovercard-url="/users/HenryRLee/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/4635853?s=64&amp;v=4" alt="@HenryRLee" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/pfeatherstone" class="" data-hovercard-type="user" data-hovercard-url="/users/pfeatherstone/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/45853521?s=64&amp;v=4" alt="@pfeatherstone" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> <li class="mb-2 mr-2" > <a href="https://github.com/Fiona-J-W" class="" data-hovercard-type="user" data-hovercard-url="/users/Fiona-J-W/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" > <img src="https://avatars.githubusercontent.com/u/554592?s=64&amp;v=4" alt="@Fiona-J-W" size="32" height="32" width="32" data-view-component="true" class="avatar circle" /> </a> </li> </ul> <div data-view-component="true" class="mt-3"> <a text="small" href="/nlohmann/json/graphs/contributors" data-view-component="true" class="Link--inTextBlock Link">+ 284 contributors</a></div> </div> </div> <div class="BorderGrid-row"> <div class="BorderGrid-cell"> <h2 class="h4 mb-3">Languages</h2> <div class="mb-2"> <span data-view-component="true" class="Progress"> <span style="background-color:#f34b7d !important;;width: 97.0%;" itemprop="keywords" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span> <span style="background-color:#DA3434 !important;;width: 1.9%;" itemprop="keywords" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span> <span style="background-color:#3572A5 !important;;width: 0.6%;" itemprop="keywords" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span> <span style="background-color:#427819 !important;;width: 0.3%;" itemprop="keywords" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span> <span style="background-color:#76d275 !important;;width: 0.1%;" itemprop="keywords" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span> <span style="background-color:#a52a22 !important;;width: 0.1%;" itemprop="keywords" data-view-component="true" class="Progress-item color-bg-success-emphasis"></span> </span></div> <ul class="list-style-none"> <li class="d-inline"> <a class="d-inline-flex flex-items-center flex-nowrap Link--secondary no-underline text-small mr-3" href="/nlohmann/json/search?l=c%2B%2B" data-ga-click="Repository, language stats search click, location:repo overview"> <svg style="color:#f34b7d;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> <span class="color-fg-default text-bold mr-1">C++</span> <span>97.0%</span> </a> </li> <li class="d-inline"> <a class="d-inline-flex flex-items-center flex-nowrap Link--secondary no-underline text-small mr-3" href="/nlohmann/json/search?l=cmake" data-ga-click="Repository, language stats search click, location:repo overview"> <svg style="color:#DA3434;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> <span class="color-fg-default text-bold mr-1">CMake</span> <span>1.9%</span> </a> </li> <li class="d-inline"> <a class="d-inline-flex flex-items-center flex-nowrap Link--secondary no-underline text-small mr-3" href="/nlohmann/json/search?l=python" data-ga-click="Repository, language stats search click, location:repo overview"> <svg style="color:#3572A5;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> <span class="color-fg-default text-bold mr-1">Python</span> <span>0.6%</span> </a> </li> <li class="d-inline"> <a class="d-inline-flex flex-items-center flex-nowrap Link--secondary no-underline text-small mr-3" href="/nlohmann/json/search?l=makefile" data-ga-click="Repository, language stats search click, location:repo overview"> <svg style="color:#427819;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> <span class="color-fg-default text-bold mr-1">Makefile</span> <span>0.3%</span> </a> </li> <li class="d-inline"> <a class="d-inline-flex flex-items-center flex-nowrap Link--secondary no-underline text-small mr-3" href="/nlohmann/json/search?l=starlark" data-ga-click="Repository, language stats search click, location:repo overview"> <svg style="color:#76d275;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> <span class="color-fg-default text-bold mr-1">Starlark</span> <span>0.1%</span> </a> </li> <li class="d-inline"> <a class="d-inline-flex flex-items-center flex-nowrap Link--secondary no-underline text-small mr-3" href="/nlohmann/json/search?l=jinja" data-ga-click="Repository, language stats search click, location:repo overview"> <svg style="color:#a52a22;" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-dot-fill mr-2"> <path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path> </svg> <span class="color-fg-default text-bold mr-1">Jinja</span> <span>0.1%</span> </a> </li> </ul> </div> </div> </div> </div> </div></div> </div> </div> </turbo-frame> </main> </div> </div> <footer class="footer pt-8 pb-6 f6 color-fg-muted p-responsive" role="contentinfo" > <h2 class='sr-only'>Footer</h2> <div class="d-flex flex-justify-center flex-items-center flex-column-reverse flex-lg-row flex-wrap flex-lg-nowrap"> <div class="d-flex flex-items-center flex-shrink-0 mx-2"> <a aria-label="Homepage" title="GitHub" class="footer-octicon mr-2" href="https://github.com"> <svg aria-hidden="true" height="24" viewBox="0 0 24 24" version="1.1" width="24" data-view-component="true" class="octicon octicon-mark-github"> <path d="M12 1C5.9225 1 1 5.9225 1 12C1 16.8675 4.14875 20.9787 8.52125 22.4362C9.07125 22.5325 9.2775 22.2025 9.2775 21.9137C9.2775 21.6525 9.26375 20.7862 9.26375 19.865C6.5 20.3737 5.785 19.1912 5.565 18.5725C5.44125 18.2562 4.905 17.28 4.4375 17.0187C4.0525 16.8125 3.5025 16.3037 4.42375 16.29C5.29 16.2762 5.90875 17.0875 6.115 17.4175C7.105 19.0812 8.68625 18.6137 9.31875 18.325C9.415 17.61 9.70375 17.1287 10.02 16.8537C7.5725 16.5787 5.015 15.63 5.015 11.4225C5.015 10.2262 5.44125 9.23625 6.1425 8.46625C6.0325 8.19125 5.6475 7.06375 6.2525 5.55125C6.2525 5.55125 7.17375 5.2625 9.2775 6.67875C10.1575 6.43125 11.0925 6.3075 12.0275 6.3075C12.9625 6.3075 13.8975 6.43125 14.7775 6.67875C16.8813 5.24875 17.8025 5.55125 17.8025 5.55125C18.4075 7.06375 18.0225 8.19125 17.9125 8.46625C18.6138 9.23625 19.04 10.2125 19.04 11.4225C19.04 15.6437 16.4688 16.5787 14.0213 16.8537C14.42 17.1975 14.7638 17.8575 14.7638 18.8887C14.7638 20.36 14.75 21.5425 14.75 21.9137C14.75 22.2025 14.9563 22.5462 15.5063 22.4362C19.8513 20.9787 23 16.8537 23 12C23 5.9225 18.0775 1 12 1Z"></path> </svg> </a> <span> &copy; 2025 GitHub,&nbsp;Inc. </span> </div> <nav aria-label="Footer"> <h3 class="sr-only" id="sr-footer-heading">Footer navigation</h3> <ul class="list-style-none d-flex flex-justify-center flex-wrap mb-2 mb-lg-0" aria-labelledby="sr-footer-heading"> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to Terms&quot;,&quot;label&quot;:&quot;text:terms&quot;}" href="https://docs.github.com/site-policy/github-terms/github-terms-of-service" data-view-component="true" class="Link--secondary Link">Terms</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to privacy&quot;,&quot;label&quot;:&quot;text:privacy&quot;}" href="https://docs.github.com/site-policy/privacy-policies/github-privacy-statement" data-view-component="true" class="Link--secondary Link">Privacy</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to security&quot;,&quot;label&quot;:&quot;text:security&quot;}" href="https://github.com/security" data-view-component="true" class="Link--secondary Link">Security</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to status&quot;,&quot;label&quot;:&quot;text:status&quot;}" href="https://www.githubstatus.com/" data-view-component="true" class="Link--secondary Link">Status</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to docs&quot;,&quot;label&quot;:&quot;text:docs&quot;}" href="https://docs.github.com/" data-view-component="true" class="Link--secondary Link">Docs</a> </li> <li class="mx-2"> <a data-analytics-event="{&quot;category&quot;:&quot;Footer&quot;,&quot;action&quot;:&quot;go to contact&quot;,&quot;label&quot;:&quot;text:contact&quot;}" href="https://support.github.com?tags=dotcom-footer" data-view-component="true" class="Link--secondary Link">Contact</a> </li> <li class="mx-2" > <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;cookies&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;cookies_link_subfooter_footer&quot;}" > Manage cookies </button> </cookie-consent-link> </li> <li class="mx-2"> <cookie-consent-link> <button type="button" class="Link--secondary underline-on-hover border-0 p-0 color-bg-transparent" data-action="click:cookie-consent-link#showConsentManagement" data-analytics-event="{&quot;location&quot;:&quot;footer&quot;,&quot;action&quot;:&quot;dont_share_info&quot;,&quot;context&quot;:&quot;subfooter&quot;,&quot;tag&quot;:&quot;link&quot;,&quot;label&quot;:&quot;dont_share_info_link_subfooter_footer&quot;}" > Do not share my personal information </button> </cookie-consent-link> </li> </ul> </nav> </div> </footer> <ghcc-consent id="ghcc" class="position-fixed bottom-0 left-0" style="z-index: 999999" data-initial-cookie-consent-allowed="" data-cookie-consent-required="false"></ghcc-consent> <div id="ajax-error-message" class="ajax-error-message flash flash-error" hidden> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert"> <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path> </svg> <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> You can’t perform that action at this time. </div> <template id="site-details-dialog"> <details class="details-reset details-overlay details-overlay-dark lh-default color-fg-default hx_rsm" open> <summary role="button" aria-label="Close dialog"></summary> <details-dialog class="Box Box--overlay d-flex flex-column anim-fade-in fast hx_rsm-dialog hx_rsm-modal"> <button class="Box-btn-octicon m-0 btn-octicon position-absolute right-0 top-0" type="button" aria-label="Close dialog" data-close-dialog> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x"> <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path> </svg> </button> <div class="octocat-spinner my-6 js-details-dialog-spinner"></div> </details-dialog> </details> </template> <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;"> <div class="Popover-message Popover-message--bottom-left Popover-message--large Box color-shadow-large" style="width:360px;"> </div> </div> <template id="snippet-clipboard-copy-button"> <div class="zeroclipboard-container position-absolute right-0 top-0"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn js-clipboard-copy m-2 p-0" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon m-2"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none m-2"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> <template id="snippet-clipboard-copy-button-unpositioned"> <div class="zeroclipboard-container"> <clipboard-copy aria-label="Copy" class="ClipboardButton btn btn-invisible js-clipboard-copy m-2 p-0 d-flex flex-justify-center flex-items-center" data-copy-feedback="Copied!" data-tooltip-direction="w"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-copy js-clipboard-copy-icon"> <path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path> </svg> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check js-clipboard-check-icon color-fg-success d-none"> <path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path> </svg> </clipboard-copy> </div> </template> </div> <div id="js-global-screen-reader-notice" class="sr-only mt-n1" aria-live="polite" aria-atomic="true" ></div> <div id="js-global-screen-reader-notice-assertive" class="sr-only mt-n1" aria-live="assertive" aria-atomic="true"></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10