mirror of
https://github.com/nlohmann/json.git
synced 2026-10-07 06:57:14 +00:00
deploy: 734fd305a1
This commit is contained in:
1 parent
57c8031f9d
commit
66e5a65087
256 files changed
+263
-263
No files matched your search
@@ -7,4 +7,4 @@
|
||||
|
||||
<span class=n>std</span><span class=o>::</span><span class=n>ifstream</span><span class=w> </span><span class=n>f</span><span class=p>(</span><span class=s>"example.json"</span><span class=p>);</span>
|
||||
<span class=n>json</span><span class=w> </span><span class=n>data</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=n>json</span><span class=o>::</span><span class=n>parse</span><span class=p>(</span><span class=n>f</span><span class=p>);</span>
|
||||
</code></pre></div></p> <h2 id=modules-do-not-export-macros>Modules do not export macros<a class=headerlink href=#modules-do-not-export-macros title="Permanent link">¶</a></h2> <p>It should be noted that as modules do not export macros, the <code>nlohmann.json</code> module will not export any macros.</p> <h2 id=exported-symbols>Exported symbols<a class=headerlink href=#exported-symbols title="Permanent link">¶</a></h2> <p>Only the following symbols are exported from <code>nlohmann.json</code>:</p> <ul> <li><code>nlohmann::adl_serializer</code></li> <li><code>nlohmann::basic_json</code></li> <li><code>nlohmann::json</code></li> <li><code>nlohmann::json_pointer</code></li> <li><code>nlohmann::ordered_json</code></li> <li><code>nlohmann::ordered_map</code></li> <li><code>nlohmann::to_string</code></li> <li><code>nlohmann::literals::json_literals::operator""_json</code></li> <li><code>nlohmann::literals::json_literals::operator""_json_pointer</code></li> </ul> <p>Additionally, the following <code>nlohmann::detail</code> symbols are exported, solely to work around an <abbr title="Microsoft Visual C++">MSVC</abbr> compilation issue (<a href="https://github.com/nlohmann/json/issues/3970">#3970</a>). They are implementation details, not part of the public <abbr title="Application Programming Interfaces">API</abbr>, and should not be used directly:</p> <ul> <li><code>nlohmann::detail::json_sax_dom_callback_parser</code></li> <li><code>nlohmann::detail::unknown_size</code></li> </ul> <h2 id=known-issues>Known issues<a class=headerlink href=#known-issues title="Permanent link">¶</a></h2> <p>C++20 modules support is exercised in <abbr title="Continuous Integration">CI</abbr> against current <abbr title="GNU Compiler Collection">GCC</abbr> and Clang on Ubuntu, and the default <abbr title="Microsoft Visual C++">MSVC</abbr> toolset on Windows Server 2022 — there is no documented minimum compiler version, unlike feature-test-macro-gated features such as <a href=../../api/macros/json_has_ranges/ ><code>JSON_HAS_RANGES</code></a>.</p> <div class="admonition info"> <p class=admonition-title>Known compiler issues</p> <ul> <li><strong><abbr title="GNU Compiler Collection">GCC</abbr></strong> may emit "redefinition" errors when <code>#include <nlohmann/json.hpp></code> appears in a module preamble together with other imports. This is an upstream <abbr title="GNU Compiler Collection">GCC</abbr> bug, not yet resolved as of <abbr title="GNU Compiler Collection">GCC</abbr> 16. Workarounds: include <code>nlohmann/json.hpp</code> before other <code>#include</code>s, use <code>import nlohmann.json;</code> instead, or upgrade <abbr title="GNU Compiler Collection">GCC</abbr>. (<a href="https://github.com/nlohmann/json/issues/5103">issue #5103</a>)</li> <li><strong><abbr title="Microsoft Visual C++">MSVC</abbr></strong> could fail with <code>C2039: 'json_sax_dom_callback_parser' is not a member of ... detail</code>; fixed by exporting the required internal symbols from <code>json.cppm</code> (see <a href=#exported-symbols>Exported symbols</a> above). (<a href="https://github.com/nlohmann/json/issues/3970">issue #3970</a>)</li> </ul> <p>If you hit a different module-related build failure, search <a href="https://github.com/nlohmann/json/issues?q=is%3Aissue+modules">existing issues</a> before filing a new one.</p> </div> <!-- https://squidfunk.github.io/mkdocs-material/reference/tooltips/#adding-a-glossary --> <aside class=md-source-file> <span class=md-source-file__fact> <span class=md-icon title="Last update"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg> </span> <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="August 20, 2026 10:32:34 UTC">August 20, 2026</span> </span> </aside> </article> </div> <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__iLine truncated
|
||||
</code></pre></div></p> <h2 id=modules-do-not-export-macros>Modules do not export macros<a class=headerlink href=#modules-do-not-export-macros title="Permanent link">¶</a></h2> <p>It should be noted that as modules do not export macros, the <code>nlohmann.json</code> module will not export any macros.</p> <h2 id=exported-symbols>Exported symbols<a class=headerlink href=#exported-symbols title="Permanent link">¶</a></h2> <p>Only the following symbols are exported from <code>nlohmann.json</code>:</p> <ul> <li><code>nlohmann::adl_serializer</code></li> <li><code>nlohmann::basic_json</code></li> <li><code>nlohmann::json</code></li> <li><code>nlohmann::json_pointer</code></li> <li><code>nlohmann::ordered_json</code></li> <li><code>nlohmann::ordered_map</code></li> <li><code>nlohmann::to_string</code></li> <li><code>nlohmann::literals::json_literals::operator""_json</code></li> <li><code>nlohmann::literals::json_literals::operator""_json_pointer</code></li> </ul> <p>Additionally, the following <code>nlohmann::detail</code> symbols are exported, solely to work around an <abbr title="Microsoft Visual C++">MSVC</abbr> compilation issue (<a href="https://github.com/nlohmann/json/issues/3970">#3970</a>). They are implementation details, not part of the public <abbr title="Application Programming Interfaces">API</abbr>, and should not be used directly:</p> <ul> <li><code>nlohmann::detail::json_sax_dom_callback_parser</code></li> <li><code>nlohmann::detail::unknown_size</code></li> </ul> <h2 id=known-issues>Known issues<a class=headerlink href=#known-issues title="Permanent link">¶</a></h2> <p>C++20 modules support is exercised in <abbr title="Continuous Integration">CI</abbr> against current <abbr title="GNU Compiler Collection">GCC</abbr> and Clang on Ubuntu, and the default <abbr title="Microsoft Visual C++">MSVC</abbr> toolset on Windows Server 2022 — there is no documented minimum compiler version, unlike feature-test-macro-gated features such as <a href=../../api/macros/json_has_ranges/ ><code>JSON_HAS_RANGES</code></a>.</p> <div class="admonition info"> <p class=admonition-title>Known compiler issues</p> <ul> <li><strong><abbr title="GNU Compiler Collection">GCC</abbr></strong> may emit "redefinition" errors when <code>#include <nlohmann/json.hpp></code> appears in a module preamble together with other imports. This is an upstream <abbr title="GNU Compiler Collection">GCC</abbr> bug, not yet resolved as of <abbr title="GNU Compiler Collection">GCC</abbr> 16. Workarounds: include <code>nlohmann/json.hpp</code> before other <code>#include</code>s, use <code>import nlohmann.json;</code> instead, or upgrade <abbr title="GNU Compiler Collection">GCC</abbr>. (<a href="https://github.com/nlohmann/json/issues/5103">issue #5103</a>)</li> <li><strong><abbr title="Microsoft Visual C++">MSVC</abbr></strong> could fail with <code>C2039: 'json_sax_dom_callback_parser' is not a member of ... detail</code>; fixed by exporting the required internal symbols from <code>json.cppm</code> (see <a href=#exported-symbols>Exported symbols</a> above). (<a href="https://github.com/nlohmann/json/issues/3970">issue #3970</a>)</li> </ul> <p>If you hit a different module-related build failure, search <a href="https://github.com/nlohmann/json/issues?q=is%3Aissue+modules">existing issues</a> before filing a new one.</p> </div> <!-- https://squidfunk.github.io/mkdocs-material/reference/tooltips/#adding-a-glossary --> <aside class=md-source-file> <span class=md-source-file__fact> <span class=md-icon title="Last update"> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M21 13.1c-.1 0-.3.1-.4.2l-1 1 2.1 2.1 1-1c.2-.2.2-.6 0-.8l-1.3-1.3c-.1-.1-.2-.2-.4-.2m-1.9 1.8-6.1 6V23h2.1l6.1-6.1zM12.5 7v5.2l4 2.4-1 1L11 13V7zM11 21.9c-5.1-.5-9-4.8-9-9.9C2 6.5 6.5 2 12 2c5.3 0 9.6 4.1 10 9.3-.3-.1-.6-.2-1-.2s-.7.1-1 .2C19.6 7.2 16.2 4 12 4c-4.4 0-8 3.6-8 8 0 4.1 3.1 7.5 7.1 7.9l-.1.2z"/></svg> </span> <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date" title="August 20, 2026 10:32:50 UTC">August 20, 2026</span> </span> </aside> </article> </div> <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script> <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__iLine truncated
|
||||
Reference in new issue
Block a user