Files
toml11/docs/reference/value/index.html

439 lines
107 KiB
HTML
Raw Permalink Normal View History

<!doctype html><html lang=en dir=ltr><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="
value.hpp
#
value.hpp defines basic_value.
toml::basic_value
#
basic_value is a class that stores TOML values.
namespace toml
{
template <class TypeConfig>
class basic_value;
// Defined in types.hpp
// using value = basic_value<type_config>;
// using table = typename basic_value<type_config>::table_type;
// using array = typename basic_value<type_config>::array_type;
template<typename TC>
bool operator==(const basic_value<TC>&, const basic_value<TC>&);
template<typename TC>
bool operator!=(const basic_value<TC>&, const basic_value<TC>&);
template<typename TC>
bool operator< (const basic_value<TC>&, const basic_value<TC>&);
template<typename TC>
bool operator<=(const basic_value<TC>&, const basic_value<TC>&);
template<typename TC>
bool operator> (const basic_value<TC>&, const basic_value<TC>&);
template<typename TC>
bool operator>=(const basic_value<TC>&, const basic_value<TC>&);
} //toml
Member Types
#
The following member types are defined."><meta name=theme-color media="(prefers-color-scheme: light)" content="#ffffff"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#343a40"><meta name=color-scheme content="light dark"><meta property="og:url" content="https://toruniina.github.io/toml11/docs/reference/value/"><meta property="og:site_name" content="toml11"><meta property="og:title" content="value.hpp"><meta property="og:description" content="value.hpp # value.hpp defines basic_value.
toml::basic_value # basic_value is a class that stores TOML values.
namespace toml { template <class TypeConfig> class basic_value; // Defined in types.hpp // using value = basic_value<type_config>; // using table = typename basic_value<type_config>::table_type; // using array = typename basic_value<type_config>::array_type; template<typename TC> bool operator==(const basic_value<TC>&, const basic_value<TC>&); template<typename TC> bool operator!=(const basic_value<TC>&, const basic_value<TC>&); template<typename TC> bool operator< (const basic_value<TC>&, const basic_value<TC>&); template<typename TC> bool operator<=(const basic_value<TC>&, const basic_value<TC>&); template<typename TC> bool operator> (const basic_value<TC>&, const basic_value<TC>&); template<typename TC> bool operator>=(const basic_value<TC>&, const basic_value<TC>&); } //toml Member Types # The following member types are defined."><meta property="og:locale" content="en"><meta property="og:type" content="article"><meta property="article:section" content="docs"><title>value.hpp | toml11</title><link rel=manifest href=/toml11/manifest.json><link rel=icon href=/toml11/favicon.png><link rel=canonical href=https://toruniina.github.io/toml11/docs/reference/value/><link rel=alternate hreflang=ja href=https://toruniina.github.io/toml11/ja/docs/reference/value/ title=value.hpp><link rel=stylesheet href=/toml11/book.min.6d8037b375fe949eee1b70501c5fb9478914c9c5eb3ef7696163fd3031c69421.css integrity="sha256-bYA3s3X+lJ7uG3BQHF+5R4kUycXrPvdpYWP9MDHGlCE=" crossorigin=anonymous><script defer src=/toml11/fuse.min.js></script><script defer src=/toml11/en.search.min.87bec23503963d7026bfa3a917b92707789d315c9c9e005e23226b35dce643f5.js integrity="sha256-h77CNQOWPXAmv6OpF7knB3idMVycngBeIyJrNdzmQ/U=" crossorigin=anonymous></script></head><body dir=ltr><input type=checkbox class="hidden toggle" id=menu-control>
<input type=checkbox class="hidden toggle" id=toc-control><main class="container flex"><aside class=book-menu><div class=book-menu-content><nav><h2 class=book-brand><a class="flex align-center" href=/toml11/><span>toml11</span></a></h2><div class="book-search hidden"><input type=text id=book-search-input placeholder=Search aria-label=Search maxlength=64 data-hotkeys=s/><div class="book-search-spinner hidden"></div><ul id=book-search-results></ul></div><script>document.querySelector(".book-search").classList.remove("hidden")</script><ul class=book-languages><li><input type=checkbox id=languages class=toggle>
<label for=languages class="flex justify-between"><a role=button class="flex align-center"><img src=/toml11/svg/translate.svg class=book-icon alt=Languages>
English</a></label><ul><li><a href=https://toruniina.github.io/toml11/ja/docs/reference/value/>日本語</a></li></ul></li></ul><ul><li><a href=/toml11/docs/installation/>installation</a><ul></ul></li><li><input type=checkbox id=section-291123c850af98d8b815ccdbb4c33657 class=toggle>
<label for=section-291123c850af98d8b815ccdbb4c33657 class="flex justify-between"><a href=/toml11/docs/features/>features</a></label><ul><li><a href=/toml11/docs/features/parsing_files/>parsing files</a></li><li><a href=/toml11/docs/features/value/>getting values</a></li><li><a href=/toml11/docs/features/error_message/>error message</a></li><li><a href=/toml11/docs/features/serialize/>serializing values</a></li><li><a href=/toml11/docs/features/configure_types/>configuring types</a></li><li><a href=/toml11/docs/features/literal/>toml literal</a></li><li><a href=/toml11/docs/features/toml_spec/>toml spec</a></li><li><a href=/toml11/docs/features/extension/>extension</a></li></ul></li><li><input type=checkbox id=section-e2e812e55021b82e114feaae98f1a02e class=toggle checked>
<label for=section-e2e812e55021b82e114feaae98f1a02e class="flex justify-between"><a href=/toml11/docs/reference/>reference</a></label><ul><li><a href=/toml11/docs/reference/color/>color.hpp</a></li><li><a href=/toml11/docs/reference/comments/>comments.hpp</a></li><li><a href=/toml11/docs/reference/conversion/>conversion.hpp</a></li><li><a href=/toml11/docs/reference/datetime/>datetime.hpp</a></li><li><a href=/toml11/docs/reference/error_info/>error_info.hpp</a></li><li><a href=/toml11/docs/reference/exception/>exception.hpp</a></li><li><a href=/toml11/docs/reference/find/>find.hpp</a></li><li><a href=/toml11/docs/reference/format/>format.hpp</a></li><li><a href=/toml11/docs/reference/from/>from.hpp</a></li><li><a href=/toml11/docs/reference/get/>get.hpp</a></li><li><a href=/toml11/docs/reference/into/>into.hpp</a></li><li><a href=/toml11/docs/reference/literal/>literal.hpp</a></li><li><a href=/toml11/docs/reference/ordered_map/>ordered_map.hpp</a></li><li><a href=/toml11/docs/reference/parser/>parser.hpp</a></li><li><a href=/toml11/docs/reference/result/>result.hpp</a></li><li><a href=/toml11/docs/reference/serializer/>serializer.hpp</a></li><li><a href=/toml11/docs/reference/source_location/>source_location.hpp</a></li><li><a href=/toml11/docs/reference/spec/>spec.hpp</a></li><li><a href=/toml11/docs/reference/toml_fwd/>toml_fwd.hpp</a></li><li><a href=/toml11/docs/reference/toml/>toml.hpp</a></li><li><a href=/toml11/docs/reference/types/>types.hpp</a></li><li><a href=/toml11/docs/reference/value_t/>value_t.hpp</a></li><li><a href=/toml11/docs/reference/value/ class=active>value.hpp</a></li><li><a href=/toml11/docs/reference/version/>version.hpp</a></li><li><a href=/toml11/docs/reference/visit/>visit.hpp</a></li></ul></li><li><a href=/toml11/docs/changelog/>changelog</a><ul></ul></li></ul><ul><li><a href=https://github.com/ToruNiina/toml11 target=_blank rel=noopener>GitHub</a></li></ul></nav><script>(function(){var e=document.querySelector("aside .book-menu-content");addEventListener("beforeunload",function(){localStorage.setItem("menu.scrollTop",e.scrollTop)}),e.scrollTop=localStorage.getItem("menu.scrollTop")})()</script></div></aside><div class=book-page><header class=book-header><div class="flex align-center justify-between"><label for=menu-control><img src=/toml11/svg/menu.svg class=book-icon alt=Menu>
</label><strong>value.hpp</strong>
<label for=toc-control><img src=/toml11/svg/toc.svg class=book-icon alt="Table of Contents"></label></div><aside class="hidden clearfix"><nav id=TableOfContents><ul><li><a href=#valuehpp>value.hpp</a></li><li><a href=#tomlbasic_value><code>toml::basic_value</code></a><ul><li><a href=#member-types>Member Types</a></li><li><a href=#member-functions>Member Functions</a><ul><li><a href=#default-constructor>Default Constructor</a></li><li><a href=#copy-and-move-constructors>Copy and Move Constructors</a></li><li><a href=#copy-and-move-constructors-with-comments>Copy and Move Constructors with Comments</a></li><li><a href=#conversion-constructors>Conversion Constructors</a></li><li><a href=#constructor-boolean>Constructor (boolean)</a></li><li><a href=#constructor-integer>Constructor (integer)</a></li><li><a href=#constructor-floating>Constructor (floating)</a></li><li><a href=#constructor-string>Constructor (string)</a></li><li><a href=#constructor-local_date>Constructor (local_date)</a></li><li><a href=#constructor-local_time>Constructor (local_time)</a></li><li><a href=#constructor-local_datetime>Constructor (local_datetime)</a></li><li><a href=#constructor-offset_datetime>Constructor (offset_datetime)</a></li><li><a href=#constructor-array>Constructor (array)</a></li><li><a href=#constructor-table>Constructor (table)</a></li><li><a href=#constructor-user-defined>Constructor (user-defined)</a></li><li><a href=#operatorbasic_value><code>operator=(basic_value)</code></a></li><li><a href=#operatort><code>operator=(T)</code></a></li><li><a href=#ist><code>is&lt;T>()</code></a></li><li><a href=#istomlvalue_t><code>is(toml::value_t)</code></a></li><li><a href=#is_xxx><code>is_xxx()</code></a></li><li><a href=#is_empty><code>is_empty()</code></a></li><li><a href=#is_array_of_tables><code>is_array_of_tables()</code></a></li><li><a href=#type><code>type()</code></a></li><li><a href=#as_xxx><code>as_xxx()</code></a></li><li><a href=#as_xxxstdnothrow><code>as_xxx(std::nothrow)</code></a></li><li><a href=#as_xxx_fmt><code>as_xxx_fmt()</code></a></li><li><a href=#as_xxx_fmtstdnothrow><code>as_xxx_fmt(std::nothrow)</code></a></li><li><a href=#atkey><code>at(key)</code></a></li><li><a href=#countkey><code>count(key)</code></a></li><li><a href=#containskey><code>contains(key)</code></a></li><li><a href=#atidx><code>at(idx)</code></a></li><li><a href=#operatoridx><code>operator[](idx)</code></a></li><li><a href=#push_backvalue><code>push_back(value)</code></a></li><li><a href=#emplace_backargs><code>emplace_back(args...)</code></a></li><li><a href=#size><code>size()</code></a></li><li><a href=#location><code>location()</code></a></li><li><a href=#comments><code>comments()</code></a></li><li><a href=#accessed><code>accessed()</code></a></li></ul></li><li><a href=#non-member-functions>Non-Member Functions</a><ul><li><a href=#operator><code>operator==</code></a></li><li><a href=#operator-1><code>operator!=</code></a></li><li><a href=#operator-2><code>operator&lt;</code></a></li><li><a href=#operator-3><code>operator&lt;=</code></a></li><li><a href=#operator-4><code>operator></code></a></li><li><a href=#operator-5><code>operator>=</code></a></li></ul></li></ul></li><li><a href=#tomltype_error><code>toml::type_error</code></a></li><li><a href=#tomlmake_error_info><code>toml::make_error_info</code></a></li><li><a href=#tomlformat_error><code>toml::format_error</code></a></li><li><a href=#related>Related</a></li></ul></nav></aside></header><article class="markdown book-article"><h1 id=valuehpp>value.hpp
<a class=anchor href=#valuehpp>#</a></h1><p><code>value.hpp</code> defines <code>basic_value</code>.</p><h1 id=tomlbasic_value><code>toml::basic_value</code>
<a class=anchor href=#tomlbasic_value>#</a></h1><p><code>basic_value</code> is a class that stores TOML values.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>namespace</span> toml
</span></span><span style=display:flex><span>{
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span> <span style=color:#f92672>&lt;</span><span style=color:#66d9ef>class</span> <span style=color:#a6e22e>TypeConfig</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>class</span> <span style=color:#a6e22e>basic_value</span>;
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#75715e>// Defined in types.hpp
</span></span></span><span style=display:flex><span><span style=color:#75715e>// using value = basic_value&lt;type_config&gt;;
</span></span></span><span style=display:flex><span><span style=color:#75715e>// using table = typename basic_value&lt;type_config&gt;::table_type;
</span></span></span><span style=display:flex><span><span style=color:#75715e>// using array = typename basic_value&lt;type_config&gt;::array_type;
</span></span></span><span style=display:flex><span><span style=color:#75715e></span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>==</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>);
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>!=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>);
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>&lt;</span> (<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>);
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>&lt;=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>);
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>&gt;</span> (<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>);
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>&gt;=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>);
</span></span><span style=display:flex><span>} <span style=color:#75715e>//toml
</span></span></span></code></pre></div><h2 id=member-types>Member Types
<a class=anchor href=#member-types>#</a></h2><p>The following member types are defined.</p><p>You can modify the member types using <code>TypeConfig</code>.</p><p>See also: <a href=https://toruniina.github.io/toml11/docs/reference/types/>types.hpp</a></p><table><thead><tr><th style=text-align:left>Name</th><th style=text-align:left>Definition</th></tr></thead><tbody><tr><td style=text-align:left><code>char_type</code></td><td style=text-align:left><code>typename TypeConfig::char_type</code></td></tr><tr><td style=text-align:left><code>key_type</code></td><td style=text-align:left><code>typename TypeConfig::string_type</code></td></tr><tr><td style=text-align:left><code>value_type</code></td><td style=text-align:left><code>basic_value&lt;TypeConfig></code></td></tr><tr><td style=text-align:left><code>boolean_type</code></td><td style=text-align:left><code>typename TypeConfig::boolean_type</code></td></tr><tr><td style=text-align:left><code>integer_type</code></td><td style=text-align:left><code>typename TypeConfig::integer_type</code></td></tr><tr><td style=text-align:left><code>floating_type</code></td><td style=text-align:left><code>typename TypeConfig::floating_type</code></td></tr><tr><td style=text-align:left><code>string_type</code></td><td style=text-align:left><code>typename TypeConfig::string_type</code></td></tr><tr><td style=text-align:left><code>local_time_type</code></td><td style=text-align:left><code>toml::local_time</code></td></tr><tr><td style=text-align:left><code>local_date_type</code></td><td style=text-align:left><code>toml::local_date</code></td></tr><tr><td style=text-align:left><code>local_datetime_type</code></td><td style=text-align:left><code>toml::local_datetime</code></td></tr><tr><td style=text-align:left><code>offset_datetime_type</code></td><td style=text-align:left><code>toml::offset_datetime</code></td></tr><tr><td style=text-align:left><code>array_type</code></td><td style=text-align:left><code>typename TypeConfig::template array_type&lt;value_type></code></td></tr><tr><td style=text-align:left><code>table_type</code></td><td style=text-align:left><code>typename TypeConfig::template table_type&lt;key_type, value_type></code></td></tr><tr><td style=text-align:left><code>comment_type</code></td><td style=text-align:left><code>typename TypeConfig::comment_type</code></td></tr></tbody></table><h2 id=member-functions>Member Functions
<a class=anchor href=#member-functions>#</a></h2><h3 id=default-constructor>Default Constructor
<a class=anchor href=#default-constructor>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value() <span style=color:#66d9ef>noexcept</span>
</span></span></code></pre></div><p>Constructs an empty <code>toml::value</code>.</p><p>The constructed <code>toml::value</code> will be empty.</p><h3 id=copy-and-move-constructors>Copy and Move Constructors
<a class=anchor href=#copy-and-move-constructors>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&amp;</span> v)
</span></span><span style=display:flex><span>basic_value(basic_value<span style=color:#f92672>&amp;&amp;</span> v)
</span></span></code></pre></div><p>Copies or moves all information including values, format information, comments, and file regions.</p><h3 id=copy-and-move-constructors-with-comments>Copy and Move Constructors with Comments
<a class=anchor href=#copy-and-move-constructors-with-comments>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(basic_value v, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Copies or moves the object while overwriting comments.</p><h3 id=conversion-constructors>Conversion Constructors
<a class=anchor href=#conversion-constructors>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TI<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(basic_value<span style=color:#f92672>&lt;</span>TI<span style=color:#f92672>&gt;</span> other)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TI<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(basic_value<span style=color:#f92672>&lt;</span>TI<span style=color:#f92672>&gt;</span> other, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Copies or moves from a <code>basic_value</code> with a different <code>type_config</code>.</p><h3 id=constructor-boolean>Constructor (boolean)
<a class=anchor href=#constructor-boolean>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(boolean_type x)
</span></span><span style=display:flex><span>basic_value(boolean_type x, boolean_format_info fmt)
</span></span><span style=display:flex><span>basic_value(boolean_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(boolean_type x, boolean_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Constructs an object with a <code>bool</code>, its format information, and comments.</p><h3 id=constructor-integer>Constructor (integer)
<a class=anchor href=#constructor-integer>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* std::is_integral&lt;T&gt; is true */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* std::is_integral&lt;T&gt; is true */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, integer_format_info fmt)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* std::is_integral&lt;T&gt; is true */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* std::is_integral&lt;T&gt; is true */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, integer_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Constructs an object with an <code>integer</code>, its format information, and comments.</p><h3 id=constructor-floating>Constructor (floating)
<a class=anchor href=#constructor-floating>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* std::is_floating_point&lt;T&gt; is true */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* std::is_floating_point&lt;T&gt; is true */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, floating_format_info fmt)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* std::is_floating_point&lt;T&gt; is true */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* std::is_floating_point&lt;T&gt; is true */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, floating_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Constructs an object with a <code>floating</code> point number, its format information, and comments.</p><h3 id=constructor-string>Constructor (string)
<a class=anchor href=#constructor-string>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(string_type x)
</span></span><span style=display:flex><span>basic_value(string_type x, string_format_info fmt)
</span></span><span style=display:flex><span>basic_value(string_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(string_type x, string_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> string_type<span style=color:#f92672>::</span>value_type<span style=color:#f92672>*</span> x)
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> string_type<span style=color:#f92672>::</span>value_type<span style=color:#f92672>*</span> x, string_format_info fmt)
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> string_type<span style=color:#f92672>::</span>value_type<span style=color:#f92672>*</span> x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> string_type<span style=color:#f92672>::</span>value_type<span style=color:#f92672>*</span> x, string_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#75715e>// C++17以降
</span></span></span><span style=display:flex><span><span style=color:#75715e></span>basic_value(string_view_type x)
</span></span><span style=display:flex><span>basic_value(string_view_type x, string_format_info fmt)
</span></span><span style=display:flex><span>basic_value(string_view_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(string_view_type x, string_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Constructs an object with a <code>string</code>, its format information, and comments.</p><p><code>string_view_type</code> shares the same <code>value_type</code> and <code>traits_type</code> as <code>string_type</code>.</p><h3 id=constructor-local_date>Constructor (local_date)
<a class=anchor href=#constructor-local_date>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(local_date_type x)
</span></span><span style=display:flex><span>basic_value(local_date_type x, local_date_format_info fmt)
</span></span><span style=display:flex><span>basic_value(local_date_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(local_date_type x, local_date_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Constructs an object with a <code>local_date_type</code>, its format information, and comments.</p><h3 id=constructor-local_time>Constructor (local_time)
<a class=anchor href=#constructor-local_time>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(local_time_type x)
</span></span><span style=display:flex><span>basic_value(local_time_type x, local_time_format_info fmt)
</span></span><span style=display:flex><span>basic_value(local_time_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(local_time_type x, local_time_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> Rep, <span style=color:#66d9ef>typename</span> Period<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>duration<span style=color:#f92672>&lt;</span>Rep, Period<span style=color:#f92672>&gt;&amp;</span> x)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> Rep, <span style=color:#66d9ef>typename</span> Period<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>duration<span style=color:#f92672>&lt;</span>Rep, Period<span style=color:#f92672>&gt;&amp;</span> x, local_time_format_info fmt)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> Rep, <span style=color:#66d9ef>typename</span> Period<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>duration<span style=color:#f92672>&lt;</span>Rep, Period<span style=color:#f92672>&gt;&amp;</span> x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> Rep, <span style=color:#66d9ef>typename</span> Period<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>duration<span style=color:#f92672>&lt;</span>Rep, Period<span style=color:#f92672>&gt;&amp;</span> x, local_time_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Constructs an object with a <code>local_time_type</code>, its format information, and comments.</p><p>For <code>std::chrono::duration</code>, constructs as a time span from <code>00:00:00</code>.</p><h3 id=constructor-local_datetime>Constructor (local_datetime)
<a class=anchor href=#constructor-local_datetime>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(local_datetime_type x)
</span></span><span style=display:flex><span>basic_value(local_datetime_type x, local_date_format_info fmt)
</span></span><span style=display:flex><span>basic_value(local_datetime_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(local_datetime_type x, local_date_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Constructs an object with a <code>local_datetime_type</code>, its format information, and comments.</p><h3 id=constructor-offset_datetime>Constructor (offset_datetime)
<a class=anchor href=#constructor-offset_datetime>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(offset_datetime_type x)
</span></span><span style=display:flex><span>basic_value(offset_datetime_type x, offset_date_format_info fmt)
</span></span><span style=display:flex><span>basic_value(offset_datetime_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(offset_datetime_type x, offset_date_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span>basic_value(std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>system_clock<span style=color:#f92672>::</span>time_point x)
</span></span><span style=display:flex><span>basic_value(std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>system_clock<span style=color:#f92672>::</span>time_point x, offset_date_format_info fmt)
</span></span><span style=display:flex><span>basic_value(std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>system_clock<span style=color:#f92672>::</span>time_point x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>system_clock<span style=color:#f92672>::</span>time_point x, offset_date_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Constructs an object with an <code>offset_datetime_type</code>, its format information, and comments.</p><p>For <code>std::chrono::system_clock::time_point</code>, constructs for the pointed time.</p><h3 id=constructor-array>Constructor (array)
<a class=anchor href=#constructor-array>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(array_type x)
</span></span><span style=display:flex><span>basic_value(array_type x, integer_format_info fmt)
</span></span><span style=display:flex><span>basic_value(array_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(array_type x, integer_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is array-like */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is array-like */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, array_format_info fmt)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is array-like */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is array-like */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, array_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Constructs an object with an <code>array</code>, its format information, and comments.</p><p><code>array-like</code> types must meet the following criteria:</p><ul><li>Has <code>T::iterator</code>.</li><li>Has <code>T::value_type</code>.</li><li>Does <strong>not</strong> have <code>T::key_type</code>.</li><li>Does <strong>not</strong> have <code>T::mapped_type</code>.</li><li>Is <strong>not</strong> <code>std::string</code>.</li><li>Is <strong>not</strong> <code>std::string_view</code> (since C++17).</li></ul><h3 id=constructor-table>Constructor (table)
<a class=anchor href=#constructor-table>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(table_type x)
</span></span><span style=display:flex><span>basic_value(table_type x, integer_format_info fmt)
</span></span><span style=display:flex><span>basic_value(table_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>basic_value(table_type x, integer_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is table-like */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is table-like */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, table_format_info fmt)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is table-like */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is table-like */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(T x, table_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com)
</span></span></code></pre></div><p>Constructs an object with a <code>table</code>, its format information, and comments.</p><p><code>table-like</code> types must meet the following criteria:</p><ul><li>Has <code>T::iterator</code>.</li><li>Has <code>T::value_type</code>.</li><li>Has <code>T::key_type</code>.</li><li>Has <code>T::mapped_type</code>.</li></ul><h3 id=constructor-user-defined>Constructor (user-defined)
<a class=anchor href=#constructor-user-defined>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T <span style=color:#75715e>/* toml::into&lt;T&gt; is defined */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> T<span style=color:#f92672>&amp;</span> ud);
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T <span style=color:#75715e>/* toml::into&lt;T&gt; is defined */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> T<span style=color:#f92672>&amp;</span> ud, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com);
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T <span style=color:#75715e>/* toml::into&lt;T&gt; is not defined, but T{}.into_toml() exists */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> T<span style=color:#f92672>&amp;</span> ud);
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T <span style=color:#75715e>/* toml::into&lt;T&gt; is not defined, but T{}.into_toml() exists */</span><span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> T<span style=color:#f92672>&amp;</span> ud, std<span style=color:#f92672>::</span>vector<span style=color:#f92672>&lt;</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>&gt;</span> com);
</span></span></code></pre></div><p>If <code>toml::into&lt;T></code> is defined, constructs from the result of <code>toml::into&lt;T>(ud)</code>.</p><p>If <code>toml::into&lt;T></code> is not defined but <code>T</code> has a <code>into_toml()</code> member function, constructs from the result of <code>ud.into_toml()</code>.</p><hr><h3 id=operatorbasic_value><code>operator=(basic_value)</code>
<a class=anchor href=#operatorbasic_value>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value<span style=color:#f92672>&amp;</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&amp;</span> v)
</span></span><span style=display:flex><span>basic_value<span style=color:#f92672>&amp;</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(basic_value<span style=color:#f92672>&amp;&amp;</span> v)
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TI<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value<span style=color:#f92672>&amp;</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(basic_value<span style=color:#f92672>&lt;</span>TI<span style=color:#f92672>&gt;</span> other)
</span></span></code></pre></div><p>Assigns the right-hand side <code>basic_value</code> to the current object.</p><h3 id=operatort><code>operator=(T)</code>
<a class=anchor href=#operatort>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> T<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>basic_value<span style=color:#f92672>&amp;</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(T x)
</span></span></code></pre></div><p>Assigns a value corresponding to <code>T</code>.</p><p>The contents pointed to by <code>source_location</code> are discarded.</p><p>If the object already holds a value of the same type, the original format information is retained.</p><hr><h3 id=ist><code>is&lt;T>()</code>
<a class=anchor href=#ist>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> is<span style=color:#f92672>&lt;</span>T<span style=color:#f92672>&gt;</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>
</span></span></code></pre></div><h4 id=requirements>Requirements
<a class=anchor href=#requirements>#</a></h4><p><code>T</code> must be an exact TOML type, meaning it corresponds to one of the <code>toml::value::xxx_type</code>.</p><h4 id=return-value>Return Value
<a class=anchor href=#return-value>#</a></h4><p>Returns <code>true</code> if the stored type matches <code>T</code>, otherwise returns <code>false</code>.</p><hr><h3 id=istomlvalue_t><code>is(toml::value_t)</code>
<a class=anchor href=#istomlvalue_t>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> is(toml<span style=color:#f92672>::</span>value_t t) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>
</span></span></code></pre></div><h4 id=return-value-1>Return Value
<a class=anchor href=#return-value-1>#</a></h4><p>Returns <code>true</code> if the tag of the stored type matches <code>t</code>, otherwise returns <code>false</code>.</p><hr><h3 id=is_xxx><code>is_xxx()</code>
<a class=anchor href=#is_xxx>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_boolean</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_integer</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_floating</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_string</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_offset_datetime</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_local_datetime</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_local_date</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_local_time</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_array</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_table</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span></code></pre></div><h4 id=return-value-2>Return Value
<a class=anchor href=#return-value-2>#</a></h4><p>Returns <code>true</code> if the stored type matches the corresponding type, otherwise returns <code>false</code>.</p><hr><h3 id=is_empty><code>is_empty()</code>
<a class=anchor href=#is_empty>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_empty</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span></code></pre></div><h4 id=return-value-3>Return Value
<a class=anchor href=#return-value-3>#</a></h4><p>Returns <code>true</code> if the object is default constructed and no value is assigned, otherwise returns <code>false</code>.</p><h3 id=is_array_of_tables><code>is_array_of_tables()</code>
<a class=anchor href=#is_array_of_tables>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_array_of_tables</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span></code></pre></div><h4 id=return-value-4>Return Value
<a class=anchor href=#return-value-4>#</a></h4><p>Returns <code>true</code> if the stored type is an array that is not empty and all elements are tables, otherwise returns <code>false</code>.</p><hr><h3 id=type><code>type()</code>
<a class=anchor href=#type>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>toml<span style=color:#f92672>::</span>value_t type() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>
</span></span></code></pre></div><h4 id=return-value-5>Return Value
<a class=anchor href=#return-value-5>#</a></h4><p>Returns the tag corresponding to the stored type.</p><hr><h3 id=as_xxx><code>as_xxx()</code>
<a class=anchor href=#as_xxx>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>boolean_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_boolean () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>integer_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_integer () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>floating_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_floating () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>string_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_string () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>offset_datetime_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_offset_datetime() <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>local_datetime_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_datetime () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>local_date_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_date () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>local_time_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_time () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>array_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_array () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>table_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_table () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span>boolean_type <span style=color:#f92672>&amp;</span> as_boolean ();
</span></span><span style=display:flex><span>integer_type <span style=color:#f92672>&amp;</span> as_integer ();
</span></span><span style=display:flex><span>floating_type <span style=color:#f92672>&amp;</span> as_floating ();
</span></span><span style=display:flex><span>string_type <span style=color:#f92672>&amp;</span> as_string ();
</span></span><span style=display:flex><span>offset_datetime_type<span style=color:#f92672>&amp;</span> as_offset_datetime();
</span></span><span style=display:flex><span>local_datetime_type <span style=color:#f92672>&amp;</span> as_local_datetime ();
</span></span><span style=display:flex><span>local_date_type <span style=color:#f92672>&amp;</span> as_local_date ();
</span></span><span style=display:flex><span>local_time_type <span style=color:#f92672>&amp;</span> as_local_time ();
</span></span><span style=display:flex><span>array_type <span style=color:#f92672>&amp;</span> as_array ();
</span></span><span style=display:flex><span>table_type <span style=color:#f92672>&amp;</span> as_table ();
</span></span></code></pre></div><h4 id=return-value-6>Return Value
<a class=anchor href=#return-value-6>#</a></h4><p>Returns a reference to the value of the specified type.</p><h4 id=exception>Exception
<a class=anchor href=#exception>#</a></h4><p>Throws <code>toml::type_error</code> if the stored value&rsquo;s type does not match the specified type.</p><hr><h3 id=as_xxxstdnothrow><code>as_xxx(std::nothrow)</code>
<a class=anchor href=#as_xxxstdnothrow>#</a></h3><p>Invoke with a <code>std::nothrow</code> object.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>boolean_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_boolean (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>integer_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_integer (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>floating_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_floating (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>string_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_string (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>offset_datetime_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_offset_datetime(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_datetime_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_datetime (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_date_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_date (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_time_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_time (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>array_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_array (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>table_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_table (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span>boolean_type <span style=color:#f92672>&amp;</span> as_boolean (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>integer_type <span style=color:#f92672>&amp;</span> as_integer (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>floating_type <span style=color:#f92672>&amp;</span> as_floating (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>string_type <span style=color:#f92672>&amp;</span> as_string (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>offset_datetime_type<span style=color:#f92672>&amp;</span> as_offset_datetime(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_datetime_type <span style=color:#f92672>&amp;</span> as_local_datetime (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_date_type <span style=color:#f92672>&amp;</span> as_local_date (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_time_type <span style=color:#f92672>&amp;</span> as_local_time (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>array_type <span style=color:#f92672>&amp;</span> as_array (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>table_type <span style=color:#f92672>&amp;</span> as_table (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span></code></pre></div><h4 id=return-value-7>Return Value
<a class=anchor href=#return-value-7>#</a></h4><p>Returns a reference to the value of the specified type.</p><h4 id=note>Note
<a class=anchor href=#note>#</a></h4><p>If the type of the stored value does not match the specified type, the behavior is undefined.</p><hr><h3 id=as_xxx_fmt><code>as_xxx_fmt()</code>
<a class=anchor href=#as_xxx_fmt>#</a></h3><p>Accesses format information.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>boolean_format_info <span style=color:#f92672>&amp;</span> as_boolean_fmt ();
</span></span><span style=display:flex><span>integer_format_info <span style=color:#f92672>&amp;</span> as_integer_fmt ();
</span></span><span style=display:flex><span>floating_format_info <span style=color:#f92672>&amp;</span> as_floating_fmt ();
</span></span><span style=display:flex><span>string_format_info <span style=color:#f92672>&amp;</span> as_string_fmt ();
</span></span><span style=display:flex><span>offset_datetime_format_info<span style=color:#f92672>&amp;</span> as_offset_datetime_fmt();
</span></span><span style=display:flex><span>local_datetime_format_info <span style=color:#f92672>&amp;</span> as_local_datetime_fmt ();
</span></span><span style=display:flex><span>local_date_format_info <span style=color:#f92672>&amp;</span> as_local_date_fmt ();
</span></span><span style=display:flex><span>local_time_format_info <span style=color:#f92672>&amp;</span> as_local_time_fmt ();
</span></span><span style=display:flex><span>array_format_info <span style=color:#f92672>&amp;</span> as_array_fmt ();
</span></span><span style=display:flex><span>table_format_info <span style=color:#f92672>&amp;</span> as_table_fmt ();
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span>boolean_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_boolean_fmt () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>integer_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_integer_fmt () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>floating_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_floating_fmt () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>string_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_string_fmt () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>offset_datetime_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_offset_datetime_fmt() <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>local_datetime_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_datetime_fmt () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>local_date_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_date_fmt () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>local_time_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_time_fmt () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>array_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_array_fmt () <span style=color:#66d9ef>const</span>;
</span></span><span style=display:flex><span>table_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_table_fmt () <span style=color:#66d9ef>const</span>;
</span></span></code></pre></div><h4 id=return-value-8>Return Value
<a class=anchor href=#return-value-8>#</a></h4><p>Returns a reference to the structure holding the format information for the specified type.</p><h4 id=exception-1>Exception
<a class=anchor href=#exception-1>#</a></h4><p>Throws <code>toml::type_error</code> if the stored value&rsquo;s type does not match the specified type.</p><hr><h3 id=as_xxx_fmtstdnothrow><code>as_xxx_fmt(std::nothrow)</code>
<a class=anchor href=#as_xxx_fmtstdnothrow>#</a></h3><p>Invoke with a <code>std::nothrow</code> object.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>boolean_format_info <span style=color:#f92672>&amp;</span> as_boolean_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>integer_format_info <span style=color:#f92672>&amp;</span> as_integer_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>floating_format_info <span style=color:#f92672>&amp;</span> as_floating_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>string_format_info <span style=color:#f92672>&amp;</span> as_string_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>offset_datetime_format_info<span style=color:#f92672>&amp;</span> as_offset_datetime_fmt(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_datetime_format_info <span style=color:#f92672>&amp;</span> as_local_datetime_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_date_format_info <span style=color:#f92672>&amp;</span> as_local_date_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_time_format_info <span style=color:#f92672>&amp;</span> as_local_time_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>array_format_info <span style=color:#f92672>&amp;</span> as_array_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>table_format_info <span style=color:#f92672>&amp;</span> as_table_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span>boolean_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_boolean_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>integer_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_integer_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>floating_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_floating_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>string_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_string_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>offset_datetime_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_offset_datetime_fmt(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_datetime_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_datetime_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_date_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_date_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>local_time_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_local_time_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>array_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_array_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>table_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> as_table_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&amp;</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span></code></pre></div><h4 id=return-value-9>Return Value
<a class=anchor href=#return-value-9>#</a></h4><p>Returns a reference to the structure holding the format information for the specified type.</p><h4 id=note-1>Note
<a class=anchor href=#note-1>#</a></h4><p>If the type of the stored value does not match the specified type, the behavior is undefined.</p><hr><h3 id=atkey><code>at(key)</code>
<a class=anchor href=#atkey>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>value_type<span style=color:#f92672>&amp;</span> at(<span style=color:#66d9ef>const</span> key_type<span style=color:#f92672>&amp;</span> key);
</span></span><span style=display:flex><span>value_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> at(<span style=color:#66d9ef>const</span> key_type<span style=color:#f92672>&amp;</span> key) <span style=color:#66d9ef>const</span>;
</span></span></code></pre></div><h4 id=return-value-10>Return Value
<a class=anchor href=#return-value-10>#</a></h4><p>Casts the current <code>value</code> to a <code>table</code> and returns the element specified by <code>key</code>.</p><h4 id=exception-2>Exception
<a class=anchor href=#exception-2>#</a></h4><p>Throws <code>toml::type_error</code> if the stored value is not a <code>table</code>.</p><p>Throws <code>std::out_of_range</code> if the <code>table</code> does not contain the specified element.</p><hr><h4 id=operatorkey><code>operator[](key)</code>
<a class=anchor href=#operatorkey>#</a></h4><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>value_type<span style=color:#f92672>&amp;</span> <span style=color:#66d9ef>operator</span>[](<span style=color:#66d9ef>const</span> key_type<span style=color:#f92672>&amp;</span> k);
</span></span></code></pre></div><h5 id=return-value-11>Return Value
<a class=anchor href=#return-value-11>#</a></h5><p>Casts the current <code>value</code> to a <code>table</code> and returns a reference to the element specified by <code>key</code>.</p><p>If the element specified by <code>key</code> does not exist, it is default-constructed.</p><h5 id=exception-3>Exception
<a class=anchor href=#exception-3>#</a></h5><p>Throws <code>toml::type_error</code> if the stored value is not a <code>table</code>.</p><hr><h3 id=countkey><code>count(key)</code>
<a class=anchor href=#countkey>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>std<span style=color:#f92672>::</span>size_t count(<span style=color:#66d9ef>const</span> key_type<span style=color:#f92672>&amp;</span> key) <span style=color:#66d9ef>const</span>;
</span></span></code></pre></div><h4 id=return-value-12>Return Value
<a class=anchor href=#return-value-12>#</a></h4><p>Casts the current <code>value</code> to a <code>table</code> and returns <code>1</code> if the element corresponding to <code>key</code> is present, otherwise returns <code>0</code>.</p><h4 id=exception-4>Exception
<a class=anchor href=#exception-4>#</a></h4><p>Throws <code>toml::type_error</code> if the stored value is not a <code>table</code>.</p><hr><h3 id=containskey><code>contains(key)</code>
<a class=anchor href=#containskey>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>contains</span>(<span style=color:#66d9ef>const</span> key_type<span style=color:#f92672>&amp;</span> key) <span style=color:#66d9ef>const</span>;
</span></span></code></pre></div><h4 id=return-value-13>Return Value
<a class=anchor href=#return-value-13>#</a></h4><p>Casts the current <code>value</code> to a <code>table</code> and returns <code>true</code> if the element corresponding to <code>key</code> is present, otherwise returns <code>false</code>.</p><h4 id=exception-5>Exception
<a class=anchor href=#exception-5>#</a></h4><p>Throws <code>toml::type_error</code> if the stored value is not a <code>table</code>.</p><hr><h3 id=atidx><code>at(idx)</code>
<a class=anchor href=#atidx>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>value_type<span style=color:#f92672>&amp;</span> at(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>size_t idx);
</span></span><span style=display:flex><span>value_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> at(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>size_t idx) <span style=color:#66d9ef>const</span>;
</span></span></code></pre></div><h4 id=return-value-14>Return Value
<a class=anchor href=#return-value-14>#</a></h4><p>Casts the current <code>value</code> to an <code>array</code> and returns the element specified by <code>idx</code>.</p><h4 id=exception-6>Exception
<a class=anchor href=#exception-6>#</a></h4><p>Throws <code>toml::type_error</code> if the stored value is not an <code>array</code>.</p><p>Throws <code>std::out_of_range</code> if the specified element does not exist in the <code>array</code>.</p><hr><h3 id=operatoridx><code>operator[](idx)</code>
<a class=anchor href=#operatoridx>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>value_type<span style=color:#f92672>&amp;</span> <span style=color:#66d9ef>operator</span>[](<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>size_t idx) <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>value_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> <span style=color:#66d9ef>operator</span>[](<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>size_t idx) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span></code></pre></div><h4 id=return-value-15>Return Value
<a class=anchor href=#return-value-15>#</a></h4><p>Casts the current <code>value</code> to an <code>array</code> and returns a reference to the element specified by <code>idx</code>.</p><h4 id=note-2>Note
<a class=anchor href=#note-2>#</a></h4><p>Performs no checks. Behavior is undefined if the stored value is not an <code>array</code> or if the specified element does not exist.</p><hr><h3 id=push_backvalue><code>push_back(value)</code>
<a class=anchor href=#push_backvalue>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>push_back</span>(<span style=color:#66d9ef>const</span> value_type<span style=color:#f92672>&amp;</span> x);
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>push_back</span>(value_type<span style=color:#f92672>&amp;&amp;</span> x);
</span></span></code></pre></div><p>Casts the current <code>value</code> to an <code>array</code> and performs <code>push_back</code> on the <code>array</code>.</p><h4 id=return-value-16>Return Value
<a class=anchor href=#return-value-16>#</a></h4><p>None.</p><h4 id=exception-7>Exception
<a class=anchor href=#exception-7>#</a></h4><p>Throws <code>toml::type_error</code> if the stored value is not an <code>array</code>.</p><hr><h3 id=emplace_backargs><code>emplace_back(args...)</code>
<a class=anchor href=#emplace_backargs>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> ... Ts<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>value_type<span style=color:#f92672>&amp;</span> emplace_back(Ts<span style=color:#f92672>&amp;&amp;</span> ... args)
</span></span></code></pre></div><p>Casts the current <code>value</code> to an <code>array</code> and performs <code>emplace_back</code> on the <code>array</code>.</p><h4 id=return-value-17>Return Value
<a class=anchor href=#return-value-17>#</a></h4><p>A reference to the constructed value.</p><h4 id=exception-8>Exception
<a class=anchor href=#exception-8>#</a></h4><p>Throws <code>toml::type_error</code> if the stored value is not an <code>array</code>.</p><hr><h3 id=size><code>size()</code>
<a class=anchor href=#size>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>std<span style=color:#f92672>::</span>size_t size() <span style=color:#66d9ef>const</span>;
</span></span></code></pre></div><h4 id=return-value-18>Return Value
<a class=anchor href=#return-value-18>#</a></h4><p>Casts the current <code>value</code> to an <code>array</code>, <code>string</code>, or <code>table</code> and returns the number of elements. For a <code>string</code>, it returns the number of characters.</p><h4 id=exception-9>Exception
<a class=anchor href=#exception-9>#</a></h4><p>Throws <code>toml::type_error</code> if the stored value is not an <code>array</code>, <code>string</code>, or <code>table</code>.</p><hr><h3 id=location><code>location()</code>
<a class=anchor href=#location>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>source_location <span style=color:#a6e22e>location</span>() <span style=color:#66d9ef>const</span>;
</span></span></code></pre></div><h4 id=return-value-19>Return Value
<a class=anchor href=#return-value-19>#</a></h4><p>Returns a <code>source_location</code> object representing the position within the TOML document where the <code>value</code> is defined.</p><p>If the <code>value</code> was not constructed by parsing a TOML document, returns a <code>source_location</code> that points to nowhere.</p><hr><h3 id=comments><code>comments()</code>
<a class=anchor href=#comments>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>comment_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> comments() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>comment_type<span style=color:#f92672>&amp;</span> comments() <span style=color:#66d9ef>noexcept</span>;
</span></span></code></pre></div><h4 id=return-value-20>Return Value
<a class=anchor href=#return-value-20>#</a></h4><p>Returns a reference to the comment container.</p><hr><h3 id=accessed><code>accessed()</code>
<a class=anchor href=#accessed>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>accessed</span>() <span style=color:#66d9ef>const</span>;
</span></span></code></pre></div><h4 id=return-value-21>Return Value
<a class=anchor href=#return-value-21>#</a></h4><p>Returns <code>true</code> only if the <code>value</code> has been accessed via <code>as_xxx</code> or <code>is_xxx</code>.
Otherwise, it returns <code>false</code>.</p><h4 id=remarks>Remarks
<a class=anchor href=#remarks>#</a></h4><p>It exists only when <code>TOML11_ENABLE_ACCESS_CHECK</code> is defined.</p><h2 id=non-member-functions>Non-Member Functions
<a class=anchor href=#non-member-functions>#</a></h2><h3 id=operator><code>operator==</code>
<a class=anchor href=#operator>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>==</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>);
</span></span></code></pre></div><p>Two <code>basic_value&lt;T></code> instances are considered equal if they satisfy the following conditions:</p><ul><li>The contained type is the same.</li><li>The contained values are identical.</li><li>The comments are identical at the byte level.</li></ul><h3 id=operator-1><code>operator!=</code>
<a class=anchor href=#operator-1>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>!=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span> lhs, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span> rhs)
</span></span><span style=display:flex><span>{
</span></span><span style=display:flex><span> <span style=color:#66d9ef>return</span> <span style=color:#f92672>!</span>(lhs <span style=color:#f92672>==</span> rhs);
</span></span><span style=display:flex><span>}
</span></span></code></pre></div><h3 id=operator-2><code>operator&lt;</code>
<a class=anchor href=#operator-2>#</a></h3><p>Defined only if <code>array_type</code> and <code>table_type</code> have <code>operator&lt;</code>.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>&lt;</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span>);
</span></span></code></pre></div><p>Comparison order:</p><ol><li>TOML type</li><li>If TOML types are the same, their values</li><li>If both the TOML types and values are the same, the comments</li></ol><p>TOML types have the following order (from smallest to largest):</p><ol><li><code>toml::value_t::empty</code></li><li><code>toml::value_t::boolean</code></li><li><code>toml::value_t::integer</code></li><li><code>toml::value_t::floating</code></li><li><code>toml::value_t::string</code></li><li><code>toml::value_t::offset_datetime</code></li><li><code>toml::value_t::local_datetime</code></li><li><code>toml::value_t::local_date</code></li><li><code>toml::value_t::local_time</code></li><li><code>toml::value_t::array</code></li><li><code>toml::value_t::table</code></li></ol><h3 id=operator-3><code>operator&lt;=</code>
<a class=anchor href=#operator-3>#</a></h3><p>Defined only if <code>array_type</code> and <code>table_type</code> have <code>operator&lt;</code>.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>&lt;=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span> lhs, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span> rhs)
</span></span><span style=display:flex><span>{
</span></span><span style=display:flex><span> <span style=color:#66d9ef>return</span> (lhs <span style=color:#f92672>&lt;</span> rhs) <span style=color:#f92672>||</span> (lhs <span style=color:#f92672>==</span> rhs);
</span></span><span style=display:flex><span>}
</span></span></code></pre></div><h3 id=operator-4><code>operator></code>
<a class=anchor href=#operator-4>#</a></h3><p>Defined only if <code>array_type</code> and <code>table_type</code> have <code>operator&lt;</code>.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>&gt;</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span> lhs, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span> rhs)
</span></span><span style=display:flex><span>{
</span></span><span style=display:flex><span> <span style=color:#66d9ef>return</span> <span style=color:#f92672>!</span>(lhs <span style=color:#f92672>&lt;=</span> rhs);
</span></span><span style=display:flex><span>}
</span></span></code></pre></div><h3 id=operator-5><code>operator>=</code>
<a class=anchor href=#operator-5>#</a></h3><p>Defined only if <code>array_type</code> and <code>table_type</code> have <code>operator&lt;</code>.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>&gt;=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span> lhs, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span> rhs)
</span></span><span style=display:flex><span>{
</span></span><span style=display:flex><span> <span style=color:#66d9ef>return</span> <span style=color:#f92672>!</span>(lhs <span style=color:#f92672>&lt;</span> rhs);
</span></span><span style=display:flex><span>}
</span></span></code></pre></div><h1 id=tomltype_error><code>toml::type_error</code>
<a class=anchor href=#tomltype_error>#</a></h1><p>Exception thrown in case of a type error.</p><p>Contains the location information of the value that caused the type error.</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>struct</span> <span style=color:#a6e22e>type_error</span> <span style=color:#66d9ef>final</span> <span style=color:#f92672>:</span> <span style=color:#66d9ef>public</span> <span style=color:#f92672>::</span>toml<span style=color:#f92672>::</span>exception
</span></span><span style=display:flex><span>{
</span></span><span style=display:flex><span> <span style=color:#66d9ef>public</span><span style=color:#f92672>:</span>
</span></span><span style=display:flex><span> type_error(std<span style=color:#f92672>::</span>string what_arg, source_location loc);
</span></span><span style=display:flex><span> <span style=color:#f92672>~</span>type_error() <span style=color:#66d9ef>noexcept</span> <span style=color:#66d9ef>override</span> <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>char</span><span style=color:#f92672>*</span> <span style=color:#a6e22e>what</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span> <span style=color:#66d9ef>override</span>;
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span> source_location <span style=color:#66d9ef>const</span><span style=color:#f92672>&amp;</span> location() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
</span></span><span style=display:flex><span>};
</span></span></code></pre></div><h1 id=tomlmake_error_info><code>toml::make_error_info</code>
<a class=anchor href=#tomlmake_error_info>#</a></h1><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC, <span style=color:#66d9ef>typename</span> ... Ts<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>error_info make_error_info(
</span></span><span style=display:flex><span> std<span style=color:#f92672>::</span>string title, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span> v, std<span style=color:#f92672>::</span>string msg, Ts<span style=color:#f92672>&amp;&amp;</span> ... tail);
</span></span></code></pre></div><p>Calls <code>location()</code> on a <code>basic_value</code>, passes the resulting <code>source_location</code> to
<a href=https://toruniina.github.io/toml11/docs/reference/error_info/#make_error_info><code>make_error_info</code></a>
to create an <code>error_info</code>.</p><p>Refer to <a href=https://toruniina.github.io/toml11/docs/reference/error_info/><code>error_info</code></a> for more details.</p><h1 id=tomlformat_error><code>toml::format_error</code>
<a class=anchor href=#tomlformat_error>#</a></h1><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672>&lt;</span><span style=color:#66d9ef>typename</span> TC, <span style=color:#66d9ef>typename</span> ... Ts<span style=color:#f92672>&gt;</span>
</span></span><span style=display:flex><span>std<span style=color:#f92672>::</span>string format_error(std<span style=color:#f92672>::</span>string title,
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&lt;</span>TC<span style=color:#f92672>&gt;&amp;</span> v, std<span style=color:#f92672>::</span>string msg, Ts<span style=color:#f92672>&amp;&amp;</span> ... tail);
</span></span></code></pre></div><p>Calls <code>location()</code> on a <code>basic_value</code>, passes the resulting <code>source_location</code> to
<a href=https://toruniina.github.io/toml11/docs/reference/error_info/#format_error><code>format_error</code></a>
to create an <code>error_info</code>, then converts it to a string and returns it.</p><p>Refer to <a href=https://toruniina.github.io/toml11/docs/reference/error_info/><code>error_info</code></a> for more details.</p><h1 id=related>Related
<a class=anchor href=#related>#</a></h1><ul><li><a href=https://toruniina.github.io/toml11/docs/reference/comments/>comments.hpp</a></li><li><a href=https://toruniina.github.io/toml11/docs/reference/source_location/>source_location.hpp</a></li><li><a href=https://toruniina.github.io/toml11/docs/reference/types/>types.hpp</a></li><li><a href=https://toruniina.github.io/toml11/docs/reference/visit/>visit.hpp</a></li></ul></article><footer class=book-footer><div class="flex flex-wrap justify-between"></div><script>(function(){function e(e){const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}document.querySelectorAll("pre code").forEach(t=>{t.addEventListener("click",function(){if(window.getSelection().toString())return;e(t.parentElement),navigator.clipboard&&navigator.clipboard.writeText(t.parentElement.textContent)})})})()</script></footer><label for=menu-control class="hidden book-menu-overlay"></label></div><aside class=book-toc><div class=book-toc-content><nav id=TableOfContents><ul><li><a href=#valuehpp>value.hpp</a></li><li><a href=#tomlbasic_value><code>toml::basic_value</code></a><ul><li><a href=#member-types>Member Types</a></li><li><a href=#member-functions>Member Functions</a><ul><li><a href=#default-constructor>Default Constructor</a></li><li><a href=#copy-and-move-constructors>Copy and Move Constructors</a></li><li><a href=#copy-and-move-constructors-with-comments>Copy and Move Constructors with Comments</a></li><li><a href=#conversion-constructors>Conversion Constructors</a></li><li><a href=#constructor-boolean>Constructor (boolean)</a></li><li><a href=#constructor-integer>Constructor (integer)</a></li><li><a href=#constructor-floating>Constructor (floating)</a></li><li><a href=#constructor-string>Constructor (string)</a></li><li><a href=#constructor-local_date>Constructor (local_date)</a></li><li><a href=#constructor-local_time>Constructor (local_time)</a></li><li><a href=#constructor-local_datetime>Constructor (local_datetime)</a></li><li><a href=#constructor-offset_datetime>Constructor (offset_datetime)</a></li><li><a href=#constructor-array>Constructor (array)</a></li><li><a href=#constructor-table>Constructor (table)</a></li><li><a href=#constructor-user-defined>Constructor (user-defined)</a></li><li><a href=#operatorbasic_value><code>operator=(basic_value)</code></a></li><li><a href=#operatort><code>operator=(T)</code></a></li><li><a href=#ist><code>is&lt;T>()</code></a></li><li><a href=#istomlvalue_t><code>is(toml::value_t)</code></a></li><li><a href=#is_xxx><code>is_xxx()</code></a></li><li><a href=#is_empty><code>is_empty()</code></a></li><li><a href=#is_array_of_tables><code>is_array_of_tables()</code></a></li><li><a href=#type><code>type()</code></a></li><li><a href=#as_xxx><code>as_xxx()</code></a></li><li><a href=#as_xxxstdnothrow><code>as_xxx(std::nothrow)</code></a></li><li><a href=#as_xxx_fmt><code>as_xxx_fmt()</code></a></li><li><a href=#as_xxx_fmtstdnothrow><code>as_xxx_fmt(std::nothrow)</code></a></li><li><a href=#atkey><code>at(key)</code></a></li><li><a href=#countkey><code>count(key)</code></a></li><li><a href=#containskey><code>contains(key)</code></a></li><li><a href=#atidx><code>at(idx)</code></a></li><li><a href=#operatoridx><code>operator[](idx)</code></a></li><li><a href=#push_backvalue><code>push_back(value)</code></a></li><li><a href=#emplace_backargs><code>emplace_back(args...)</code></a></li><li><a href=#size><code>size()</code></a></li><li><a href=#location><code>location()</code></a></li><li><a href=#comments><code>comments()</code></a></li><li><a href=#accessed><code>accessed()</code></a></li></ul></li><li><a href=#non-member-functions>Non-Member Functions</a><ul><li><a href=#operator><code>operator==</code></a></li><li><a href=#operator-1><code>operator!=</code></a></li><li><a href=#operator-2><code>operator&lt;</code></a></li><li><a href=#operator-3><code>operator&lt;=</code></a></li><li><a href=#operator-4><code>operator></code></a></li><li><a href=#operator-5><code>operator>=</code></a></li></ul></li></ul></li>