mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-12-16 03:08:52 +08:00
319 lines
88 KiB
HTML
319 lines
88 KiB
HTML
|
|
<!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="
|
||
|
|
comments.hpp
|
||
|
|
#
|
||
|
|
|
||
|
|
In comments.hpp, comment containers are provided.
|
||
|
|
|
||
|
|
toml::preserve_comments
|
||
|
|
#
|
||
|
|
|
||
|
|
preserve_comments is a container that preserves comments.
|
||
|
|
It has all the member functions of std::vector<std::string>.
|
||
|
|
Comments are preserved as std::string.
|
||
|
|
If the comment does not start with #, it will be prefixed with # during output.
|
||
|
|
However, this prefixing is not done when adding comments to the container.
|
||
|
|
Spaces are not automatically added, so if you want a space immediately after #,
|
||
|
|
either start the comment with a space or pass the comment with #."><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/comments/"><meta property="og:site_name" content="toml11"><meta property="og:title" content="comments.hpp"><meta property="og:description" content="comments.hpp # In comments.hpp, comment containers are provided.
|
||
|
|
toml::preserve_comments # preserve_comments is a container that preserves comments.
|
||
|
|
It has all the member functions of std::vector<std::string>.
|
||
|
|
Comments are preserved as std::string. If the comment does not start with #, it will be prefixed with # during output. However, this prefixing is not done when adding comments to the container.
|
||
|
|
Spaces are not automatically added, so if you want a space immediately after #, either start the comment with a space or pass the comment with #."><meta property="og:locale" content="en"><meta property="og:type" content="article"><meta property="article:section" content="docs"><title>comments.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/comments/><link rel=alternate hreflang=ja href=https://toruniina.github.io/toml11/ja/docs/reference/comments/ title=comments.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/comments/>日本語</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/ class=active>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/>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>comments.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=#commentshpp>comments.hpp</a></li><li><a href=#tomlpreserve_comments><code>toml::preserve_comments</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=#constructor-stdvectorstdstring>Constructor (<code>std::vector<std::string></code>)</a></li><li><a href=#constructor-discard_comments>Constructor (<code>discard_comments</code>)</a></li><li><a href=#constructor-iterator>Constructor (<code>Iterator</code>)</a></li><li><a href=#constructor-stdinitializer_list>Constructor (<code>std::initializer_list</code>)</a></li><li><a href=#constructor-size-specified>Constructor (Size Specified)</a></li><li><a href=#destructor>Destructor</a></li><li><a href=#operatorpreserve_comments><code>operator=(preserve_comments)</code></a></li><li><a href=#operatorstdvectorstdstring><code>operator=(std::vector<std::string>)</code></a></li><li><a href=#assign><code>assign</code></a></li><li><a href=#insert><code>insert</code></a></li><li><a href=#emplace><code>emplace</code></a></li><li><a href=#erase><code>erase</code></a></li><li><a href=#swap><code>swap</code></a></li><li><a href=#push_back><code>push_back</code></a></li><li><a href=#pop_back><code>pop_back</code></a></li><li><a href=#emplace_back><code>emplace_back</code></a></li><li><a href=#clear><code>clear</code></a></li><li><a href=#size><code>size</code></a></li><li><a href=#max_size><code>max_size</code></a></li><li><a href=#capacity><code>capacity</code></a></li><li><a href=#empty><code>empty</code></a></li><li><a href=#reserve><code>reserve</code></a></li><li><a href=#resize><code>resize</code></a></li><li><a href=#shrink_to_fit><code>shrink_to_fit</code></a></li><li><a href=#operator><code>operator[]</code></a></li><li><a href=#at><code>at</code></a></li><li><a href=#front><code>front</code></a></li><li><a href=#back><code>back</code></a></li><li><a href=#data><code>data</code></a></li><li><a href=#beginend><code>begin/end</code></a></li><li><a href=#rbeginrend><code>rbegin/rend</code></a></li></ul></li><li><a href=#non-member-functions>non-member functions</a><ul><li><a href=#comparison-operator>Comparison operator</a></li><li><a href=#swap-1><code>swap</code></a></li><li><a href=#stream-operator>Stream operator</a></li></ul></li></ul></li><li><a href=#tomldiscard_comments><code>toml::discard_comments</code></a><ul><li><a href=#member-types-1>Member types</a><ul><li><a href=#default-constructor-1>Default Constructor</a></li><li><a href=#copy--move-constructor>Copy / Move Constructor</a></li><li><a href=#constructorstdvectorstdstring>Constructor(<code>std::vector<std::string></code>)</a></li><li><a href=#constructorpreserve_comments>Constructor(<code>preserve_comments</code>)</a></li><li><a href=#constructoriterator>Constructor(<code>Iterator</code>)</a></li><li><a href=#constructorstdinitializer_list>Constructor(<code>std::initializer_list</code>)</a></li><li><a href=#constructorサイズ指定>Constructor(サイズ指定)</a></li><li><a href=#destructor-1>Destructor</a></li><li><a href=#operatordiscard_comments><code>operator=(discard_comments)</code></a></li><li><a href=#operatorstdvectorstdstring-1><code>operator=(std::vector<std::string>)</code></a></li><li><a href=#assign-1><code>assign</code></a></li><li><a href=#insert-1><code>insert</code></a></li><li><a href=#emplace-1><code>emplace</code></a></li><li><a href=#erase-1><code>erase</code></a></li><li><a href=#swap-2><code>swap</code></a></li><li><a href=#push_back-1><code>push_back</code></a></li><li><a href=#pop_back-1><code>pop_back</code></a></li><li><a href=#emplace_back-1><code>emplace_back</code></a></li><li><a href=#clear-1><code>clear</code></a></li><li><a href=#size-1><code>size</code></a></li><li><a href=#max_size-1><code>ma
|
||
|
|
<a class=anchor href=#commentshpp>#</a></h1><p>In <code>comments.hpp</code>, comment containers are provided.</p><h1 id=tomlpreserve_comments><code>toml::preserve_comments</code>
|
||
|
|
<a class=anchor href=#tomlpreserve_comments>#</a></h1><p><code>preserve_comments</code> is a container that preserves comments.</p><p>It has all the member functions of <code>std::vector<std::string></code>.</p><p>Comments are preserved as <code>std::string</code>.
|
||
|
|
If the comment does not start with <code>#</code>, it will be prefixed with <code>#</code> during output.
|
||
|
|
However, this prefixing is not done when adding comments to the container.</p><p>Spaces are not automatically added, so if you want a space immediately after <code>#</code>,
|
||
|
|
either start the comment with a space or pass the comment with <code>#</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>namespace</span> toml
|
||
|
|
</span></span><span style=display:flex><span>{
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>class</span> <span style=color:#a6e22e>preserve_comments</span>;
|
||
|
|
</span></span><span style=display:flex><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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span><span style=display:flex><span>
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>swap</span>(preserve_comments<span style=color:#f92672>&</span>, preserve_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>swap</span>(preserve_comments<span style=color:#f92672>&</span>, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&</span>);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>swap</span>(std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&</span>, preserve_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span><span style=display:flex><span>
|
||
|
|
</span></span><span style=display:flex><span>std<span style=color:#f92672>::</span>ostream<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672><<</span>(std<span style=color:#f92672>::</span>ostream<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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><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>using</span> container_type <span style=color:#f92672>=</span> std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span>;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> size_type <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>size_type;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> difference_type <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>difference_type;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> value_type <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>value_type;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> reference <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>reference;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> const_reference <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>const_reference;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> pointer <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>pointer;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> const_pointer <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>const_pointer;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> iterator <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>iterator;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> const_iterator <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>const_iterator;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> reverse_iterator <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>reverse_iterator;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> const_reverse_iterator <span style=color:#f92672>=</span> container_type<span style=color:#f92672>::</span>const_reverse_iterator;
|
||
|
|
</span></span></code></pre></div><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>preserve_comments() <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span></code></pre></div><p>Constructs an empty <code>preserve_comments</code>.</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>preserve_comments(preserve_comments <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span>) <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span><span style=display:flex><span>preserve_comments(preserve_comments <span style=color:#f92672>&&</span>) <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span></code></pre></div><p>Constructs a <code>preserve_comments</code> by copying or moving.</p><h3 id=constructor-stdvectorstdstring>Constructor (<code>std::vector<std::string></code>)
|
||
|
|
<a class=anchor href=#constructor-stdvectorstdstring>#</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>explicit</span> <span style=color:#a6e22e>preserve_comments</span>(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&</span> c);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>explicit</span> <span style=color:#a6e22e>preserve_comments</span>(std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&&</span> c);
|
||
|
|
</span></span></code></pre></div><p>Constructs a <code>preserve_comments</code> holding the contents of <code>std::vector<std::string></code>.</p><h3 id=constructor-discard_comments>Constructor (<code>discard_comments</code>)
|
||
|
|
<a class=anchor href=#constructor-discard_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><span style=color:#66d9ef>explicit</span> <span style=color:#a6e22e>preserve_comments</span>(<span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span></code></pre></div><p>Constructs an empty <code>preserve_comments</code>.</p><h3 id=constructor-iterator>Constructor (<code>Iterator</code>)
|
||
|
|
<a class=anchor href=#constructor-iterator>#</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><</span><span style=color:#66d9ef>typename</span> InputIterator<span style=color:#f92672>></span>
|
||
|
|
</span></span><span style=display:flex><span>preserve_comments(InputIterator first, InputIterator last);
|
||
|
|
</span></span></code></pre></div><p>Constructs a <code>preserve_comments</code> from the range represented by <code>InputIterator</code> pointing to <code>std::string</code>.</p><h3 id=constructor-stdinitializer_list>Constructor (<code>std::initializer_list</code>)
|
||
|
|
<a class=anchor href=#constructor-stdinitializer_list>#</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>preserve_comments(std<span style=color:#f92672>::</span>initializer_list<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> x);
|
||
|
|
</span></span></code></pre></div><p>Constructs a <code>preserve_comments</code> from the range represented by <code>std::initializer_list<std::string></code>.</p><h3 id=constructor-size-specified>Constructor (Size Specified)
|
||
|
|
<a class=anchor href=#constructor-size-specified>#</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>explicit</span> <span style=color:#a6e22e>preserve_comments</span>(size_type n);
|
||
|
|
</span></span><span style=display:flex><span>preserve_comments(size_type n, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> x);
|
||
|
|
</span></span></code></pre></div><p>Constructs a <code>preserve_comments</code> with <code>n</code> comments.</p><p>If a <code>std::string</code> is passed, it replicates that comment <code>n</code> times.</p><h3 id=destructor>Destructor
|
||
|
|
<a class=anchor href=#destructor>#</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:#f92672>~</span>preserve_comments() <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span></code></pre></div><p>Destroys the <code>preserve_comments</code>.</p><h3 id=operatorpreserve_comments><code>operator=(preserve_comments)</code>
|
||
|
|
<a class=anchor href=#operatorpreserve_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>preserve_comments<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(preserve_comments <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span>) <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span><span style=display:flex><span>preserve_comments<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(preserve_comments <span style=color:#f92672>&&</span>) <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span></code></pre></div><p>Assigns a <code>preserve_comments</code> by copying or moving.</p><h3 id=operatorstdvectorstdstring><code>operator=(std::vector<std::string>)</code>
|
||
|
|
<a class=anchor href=#operatorstdvectorstdstring>#</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>preserve_comments<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&</span> c);
|
||
|
|
</span></span><span style=display:flex><span>preserve_comments<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&&</span> c);
|
||
|
|
</span></span></code></pre></div><p>Assigns a <code>std::vector<std::string></code> by copying or moving.</p><h3 id=assign><code>assign</code>
|
||
|
|
<a class=anchor href=#assign>#</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><</span><span style=color:#66d9ef>typename</span> InputIterator<span style=color:#f92672>></span>
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> assign(InputIterator first, InputIterator last);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>assign</span>(std<span style=color:#f92672>::</span>initializer_list<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> ini);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>assign</span>(size_type n, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> val);
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::assign</code>.</p><h3 id=insert><code>insert</code>
|
||
|
|
<a class=anchor href=#insert>#</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>iterator <span style=color:#a6e22e>insert</span>(const_iterator p, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> x);
|
||
|
|
</span></span><span style=display:flex><span>iterator <span style=color:#a6e22e>insert</span>(const_iterator p, std<span style=color:#f92672>::</span>string<span style=color:#f92672>&&</span> x);
|
||
|
|
</span></span><span style=display:flex><span>iterator <span style=color:#a6e22e>insert</span>(const_iterator p, size_type n, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> x);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> InputIterator<span style=color:#f92672>></span>
|
||
|
|
</span></span><span style=display:flex><span>iterator insert(const_iterator p, InputIterator first, InputIterator last);
|
||
|
|
</span></span><span style=display:flex><span>iterator <span style=color:#a6e22e>insert</span>(const_iterator p, std<span style=color:#f92672>::</span>initializer_list<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> ini);
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::insert</code>.</p><h3 id=emplace><code>emplace</code>
|
||
|
|
<a class=anchor href=#emplace>#</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><</span><span style=color:#66d9ef>typename</span> ... Ts<span style=color:#f92672>></span>
|
||
|
|
</span></span><span style=display:flex><span>iterator emplace(const_iterator p, Ts<span style=color:#f92672>&&</span> ... args);
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::emplace</code>.</p><h3 id=erase><code>erase</code>
|
||
|
|
<a class=anchor href=#erase>#</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>iterator <span style=color:#a6e22e>erase</span>(const_iterator pos);
|
||
|
|
</span></span><span style=display:flex><span>iterator <span style=color:#a6e22e>erase</span>(const_iterator first, const_iterator last);
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::erase</code>.</p><h3 id=swap><code>swap</code>
|
||
|
|
<a class=anchor href=#swap>#</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>swap</span>(preserve_comments<span style=color:#f92672>&</span> other);
|
||
|
|
</span></span></code></pre></div><p>Swaps the comments.</p><h3 id=push_back><code>push_back</code>
|
||
|
|
<a class=anchor href=#push_back>#</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> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> v);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>push_back</span>(std<span style=color:#f92672>::</span>string<span style=color:#f92672>&&</span> v);
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::push_back</code>.</p><h3 id=pop_back><code>pop_back</code>
|
||
|
|
<a class=anchor href=#pop_back>#</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>pop_back</span>();
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::pop_back</code>.</p><h3 id=emplace_back><code>emplace_back</code>
|
||
|
|
<a class=anchor href=#emplace_back>#</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><</span><span style=color:#66d9ef>typename</span> ... Ts<span style=color:#f92672>></span>
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> emplace_back(Ts<span style=color:#f92672>&&</span> ... args);
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::emplace_back</code>.</p><h3 id=clear><code>clear</code>
|
||
|
|
<a class=anchor href=#clear>#</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>clear</span>();
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::clear</code>.</p><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>size_type <span style=color:#a6e22e>size</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::size</code>.</p><h3 id=max_size><code>max_size</code>
|
||
|
|
<a class=anchor href=#max_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>size_type <span style=color:#a6e22e>max_size</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::max_size</code>.</p><h3 id=capacity><code>capacity</code>
|
||
|
|
<a class=anchor href=#capacity>#</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>size_type <span style=color:#a6e22e>capacity</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::capacity</code>.</p><h3 id=empty><code>empty</code>
|
||
|
|
<a class=anchor href=#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>empty</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::empty</code>.</p><h3 id=reserve><code>reserve</code>
|
||
|
|
<a class=anchor href=#reserve>#</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>reserve</span>(size_type n);
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::reserve</code>.</p><h3 id=resize><code>resize</code>
|
||
|
|
<a class=anchor href=#resize>#</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>resize</span>(size_type n);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>resize</span>(size_type n, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> c);
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::resize</code>.</p><h3 id=shrink_to_fit><code>shrink_to_fit</code>
|
||
|
|
<a class=anchor href=#shrink_to_fit>#</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>shrink_to_fit</span>();
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::shrink_to_fit</code>.</p><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>reference <span style=color:#66d9ef>operator</span>[](<span style=color:#66d9ef>const</span> size_type n) <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reference <span style=color:#66d9ef>operator</span>[](<span style=color:#66d9ef>const</span> size_type n) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::operator[]</code>.</p><h3 id=at><code>at</code>
|
||
|
|
<a class=anchor href=#at>#</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>reference <span style=color:#a6e22e>at</span>(<span style=color:#66d9ef>const</span> size_type n) ;
|
||
|
|
</span></span><span style=display:flex><span>const_reference <span style=color:#a6e22e>at</span>(<span style=color:#66d9ef>const</span> size_type n) <span style=color:#66d9ef>const</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::at</code>.</p><h3 id=front><code>front</code>
|
||
|
|
<a class=anchor href=#front>#</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>reference <span style=color:#a6e22e>front</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reference <span style=color:#a6e22e>front</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::front</code>.</p><h3 id=back><code>back</code>
|
||
|
|
<a class=anchor href=#back>#</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>reference <span style=color:#a6e22e>back</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reference <span style=color:#a6e22e>back</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::back</code>.</p><h3 id=data><code>data</code>
|
||
|
|
<a class=anchor href=#data>#</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>pointer <span style=color:#a6e22e>data</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_pointer <span style=color:#a6e22e>data</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::data</code>.</p><h3 id=beginend><code>begin/end</code>
|
||
|
|
<a class=anchor href=#beginend>#</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>iterator <span style=color:#a6e22e>begin</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>iterator <span style=color:#a6e22e>end</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_iterator <span style=color:#a6e22e>begin</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_iterator <span style=color:#a6e22e>end</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_iterator <span style=color:#a6e22e>cbegin</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_iterator <span style=color:#a6e22e>cend</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::begin/end</code>.</p><h3 id=rbeginrend><code>rbegin/rend</code>
|
||
|
|
<a class=anchor href=#rbeginrend>#</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>reverse_iterator <span style=color:#a6e22e>rbegin</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>reverse_iterator <span style=color:#a6e22e>rend</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reverse_iterator <span style=color:#a6e22e>rbegin</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reverse_iterator <span style=color:#a6e22e>rend</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reverse_iterator <span style=color:#a6e22e>crbegin</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reverse_iterator <span style=color:#a6e22e>crend</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>The same as <code>std::vector<std::string>::rbegin/rend</code></p><h2 id=non-member-functions>non-member functions
|
||
|
|
<a class=anchor href=#non-member-functions>#</a></h2><h3 id=comparison-operator>Comparison operator
|
||
|
|
<a class=anchor href=#comparison-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>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>==</span>(<span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</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> preserve_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span></code></pre></div><p>It compares two <code>preserve_comments</code> in the same way as <code>std::vector<std::string></code>.</p><h3 id=swap-1><code>swap</code>
|
||
|
|
<a class=anchor href=#swap-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>void</span> <span style=color:#a6e22e>swap</span>(preserve_comments<span style=color:#f92672>&</span>, preserve_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>swap</span>(preserve_comments<span style=color:#f92672>&</span>, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&</span>);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>swap</span>(std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&</span>, preserve_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span></code></pre></div><h3 id=stream-operator>Stream operator
|
||
|
|
<a class=anchor href=#stream-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>std<span style=color:#f92672>::</span>ostream<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672><<</span>(std<span style=color:#f92672>::</span>ostream<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span></code></pre></div><p>Outputs as TOML comments.</p><p>If the first character is not <code>#</code>, it adds <code>#</code>.</p><h1 id=tomldiscard_comments><code>toml::discard_comments</code>
|
||
|
|
<a class=anchor href=#tomldiscard_comments>#</a></h1><p><code>discard_comments</code> serves as a container for discarding comments.</p><p>It encompasses all the member functions of <code>std::vector<std::string></code>, but invoking functions that modify the content has no effect, leaving it perpetually empty.</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>class</span> <span style=color:#a6e22e>discard_comments</span>;
|
||
|
|
</span></span><span style=display:flex><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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span><span style=display:flex><span>
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>swap</span>(discard_comments<span style=color:#f92672>&</span>, discard_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span><span style=display:flex><span>
|
||
|
|
</span></span><span style=display:flex><span>std<span style=color:#f92672>::</span>ostream<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672><<</span>(std<span style=color:#f92672>::</span>ostream<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span><span style=display:flex><span>} <span style=color:#75715e>//toml
|
||
|
|
</span></span></span></code></pre></div><h2 id=member-types-1>Member types
|
||
|
|
<a class=anchor href=#member-types-1>#</a></h2><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:#75715e>// container_type is not defined
|
||
|
|
</span></span></span><span style=display:flex><span><span style=color:#75715e></span><span style=color:#66d9ef>using</span> size_type <span style=color:#f92672>=</span> std<span style=color:#f92672>::</span>size_t;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> difference_type <span style=color:#f92672>=</span> std<span style=color:#f92672>::</span>ptrdiff_t;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> value_type <span style=color:#f92672>=</span> std<span style=color:#f92672>::</span>string;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> reference <span style=color:#f92672>=</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span>;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> const_reference <span style=color:#f92672>=</span> std<span style=color:#f92672>::</span>string <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span>;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> pointer <span style=color:#f92672>=</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>*</span>;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> const_pointer <span style=color:#f92672>=</span> std<span style=color:#f92672>::</span>string <span style=color:#66d9ef>const</span><span style=color:#f92672>*</span>;
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> iterator <span style=color:#f92672>=</span> <span style=color:#75715e>/* internal type: empty-iterator */</span>
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> const_iterator <span style=color:#f92672>=</span> <span style=color:#75715e>/* internal type: empty-iterator */</span>
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> reverse_iterator <span style=color:#f92672>=</span> <span style=color:#75715e>/* internal type: empty-iterator */</span>
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>using</span> const_reverse_iterator <span style=color:#f92672>=</span> <span style=color:#75715e>/* internal type: empty-iterator */</span>
|
||
|
|
</span></span></code></pre></div><h3 id=default-constructor-1>Default Constructor
|
||
|
|
<a class=anchor href=#default-constructor-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>discard_comments() <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span></code></pre></div><p>Constructs an empty <code>discard_comments</code>.</p><h3 id=copy--move-constructor>Copy / Move Constructor
|
||
|
|
<a class=anchor href=#copy--move-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>discard_comments(discard_comments <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span>) <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span><span style=display:flex><span>discard_comments(discard_comments <span style=color:#f92672>&&</span>) <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span></code></pre></div><p>Constructs a <code>discard_comments</code> by copying or moving.</p><h3 id=constructorstdvectorstdstring>Constructor(<code>std::vector<std::string></code>)
|
||
|
|
<a class=anchor href=#constructorstdvectorstdstring>#</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>explicit</span> <span style=color:#a6e22e>discard_comments</span>(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&</span> c);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>explicit</span> <span style=color:#a6e22e>discard_comments</span>(std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&&</span> c);
|
||
|
|
</span></span></code></pre></div><p>Constructs an empty <code>discard_comments</code>. Arguments are ignored.</p><h3 id=constructorpreserve_comments>Constructor(<code>preserve_comments</code>)
|
||
|
|
<a class=anchor href=#constructorpreserve_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><span style=color:#66d9ef>explicit</span> <span style=color:#a6e22e>discard_comments</span>(<span style=color:#66d9ef>const</span> preserve_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span></code></pre></div><p>Constructs an empty <code>discard_comments</code>. Arguments are ignored.</p><h3 id=constructoriterator>Constructor(<code>Iterator</code>)
|
||
|
|
<a class=anchor href=#constructoriterator>#</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><</span><span style=color:#66d9ef>typename</span> InputIterator<span style=color:#f92672>></span>
|
||
|
|
</span></span><span style=display:flex><span>discard_comments(InputIterator first, InputIterator last);
|
||
|
|
</span></span></code></pre></div><p>Constructs an empty <code>discard_comments</code>. Arguments are ignored.</p><h3 id=constructorstdinitializer_list>Constructor(<code>std::initializer_list</code>)
|
||
|
|
<a class=anchor href=#constructorstdinitializer_list>#</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>discard_comments(std<span style=color:#f92672>::</span>initializer_list<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> x);
|
||
|
|
</span></span></code></pre></div><p>Constructs an empty <code>discard_comments</code>. Arguments are ignored.</p><h3 id=constructorサイズ指定>Constructor(サイズ指定)
|
||
|
|
<a class=anchor href=#constructor%e3%82%b5%e3%82%a4%e3%82%ba%e6%8c%87%e5%ae%9a>#</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>explicit</span> <span style=color:#a6e22e>discard_comments</span>(size_type n);
|
||
|
|
</span></span><span style=display:flex><span>discard_comments(size_type n, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> x);
|
||
|
|
</span></span></code></pre></div><p>Constructs an empty <code>discard_comments</code>. Arguments are ignored.</p><h3 id=destructor-1>Destructor
|
||
|
|
<a class=anchor href=#destructor-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:#f92672>~</span>discard_comments() <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span></code></pre></div><p>Destroys <code>discard_comments</code>.</p><h3 id=operatordiscard_comments><code>operator=(discard_comments)</code>
|
||
|
|
<a class=anchor href=#operatordiscard_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>discard_comments<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(discard_comments <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span>) <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span><span style=display:flex><span>discard_comments<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(discard_comments <span style=color:#f92672>&&</span>) <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
||
|
|
</span></span></code></pre></div><p>Assigns <code>discard_comments</code> by copying or moving.</p><h3 id=operatorstdvectorstdstring-1><code>operator=(std::vector<std::string>)</code>
|
||
|
|
<a class=anchor href=#operatorstdvectorstdstring-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>discard_comments<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&</span> c);
|
||
|
|
</span></span><span style=display:flex><span>discard_comments<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>>&&</span> c);
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=assign-1><code>assign</code>
|
||
|
|
<a class=anchor href=#assign-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><</span><span style=color:#66d9ef>typename</span> InputIterator<span style=color:#f92672>></span>
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> assign(InputIterator first, InputIterator last);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>assign</span>(std<span style=color:#f92672>::</span>initializer_list<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> ini);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>assign</span>(size_type n, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> val);
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=insert-1><code>insert</code>
|
||
|
|
<a class=anchor href=#insert-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>iterator <span style=color:#a6e22e>insert</span>(const_iterator p, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> x);
|
||
|
|
</span></span><span style=display:flex><span>iterator <span style=color:#a6e22e>insert</span>(const_iterator p, std<span style=color:#f92672>::</span>string<span style=color:#f92672>&&</span> x);
|
||
|
|
</span></span><span style=display:flex><span>iterator <span style=color:#a6e22e>insert</span>(const_iterator p, size_type n, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> x);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> InputIterator<span style=color:#f92672>></span>
|
||
|
|
</span></span><span style=display:flex><span>iterator insert(const_iterator p, InputIterator first, InputIterator last);
|
||
|
|
</span></span><span style=display:flex><span>iterator <span style=color:#a6e22e>insert</span>(const_iterator p, std<span style=color:#f92672>::</span>initializer_list<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> ini);
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=emplace-1><code>emplace</code>
|
||
|
|
<a class=anchor href=#emplace-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><</span><span style=color:#66d9ef>typename</span> ... Ts<span style=color:#f92672>></span>
|
||
|
|
</span></span><span style=display:flex><span>iterator emplace(const_iterator p, Ts<span style=color:#f92672>&&</span> ... args);
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=erase-1><code>erase</code>
|
||
|
|
<a class=anchor href=#erase-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>iterator <span style=color:#a6e22e>erase</span>(const_iterator pos);
|
||
|
|
</span></span><span style=display:flex><span>iterator <span style=color:#a6e22e>erase</span>(const_iterator first, const_iterator last);
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=swap-2><code>swap</code>
|
||
|
|
<a class=anchor href=#swap-2>#</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>swap</span>(discard_comments<span style=color:#f92672>&</span> other);
|
||
|
|
</span></span></code></pre></div><p>Swaps two <code>discard_comments</code>. Effectively it does nothing.</p><h3 id=push_back-1><code>push_back</code>
|
||
|
|
<a class=anchor href=#push_back-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>void</span> <span style=color:#a6e22e>push_back</span>(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> v);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>push_back</span>(std<span style=color:#f92672>::</span>string<span style=color:#f92672>&&</span> v);
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=pop_back-1><code>pop_back</code>
|
||
|
|
<a class=anchor href=#pop_back-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>void</span> <span style=color:#a6e22e>pop_back</span>();
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=emplace_back-1><code>emplace_back</code>
|
||
|
|
<a class=anchor href=#emplace_back-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><</span><span style=color:#66d9ef>typename</span> ... Ts<span style=color:#f92672>></span>
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> emplace_back(Ts<span style=color:#f92672>&&</span> ... args);
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=clear-1><code>clear</code>
|
||
|
|
<a class=anchor href=#clear-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>void</span> <span style=color:#a6e22e>clear</span>();
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=size-1><code>size</code>
|
||
|
|
<a class=anchor href=#size-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>size_type <span style=color:#a6e22e>size</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>Returns <code>0</code>.</p><h3 id=max_size-1><code>max_size</code>
|
||
|
|
<a class=anchor href=#max_size-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>size_type <span style=color:#a6e22e>max_size</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>Returns <code>0</code>.</p><h3 id=capacity-1><code>capacity</code>
|
||
|
|
<a class=anchor href=#capacity-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>size_type <span style=color:#a6e22e>capacity</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>Returns <code>0</code>.</p><h3 id=empty-1><code>empty</code>
|
||
|
|
<a class=anchor href=#empty-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>bool</span> <span style=color:#a6e22e>empty</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>Returns <code>true</code>.</p><h3 id=reserve-1><code>reserve</code>
|
||
|
|
<a class=anchor href=#reserve-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>void</span> <span style=color:#a6e22e>reserve</span>(size_type n);
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=resize-1><code>resize</code>
|
||
|
|
<a class=anchor href=#resize-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>void</span> <span style=color:#a6e22e>resize</span>(size_type n);
|
||
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>resize</span>(size_type n, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> c);
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><h3 id=shrink_to_fit-1><code>shrink_to_fit</code>
|
||
|
|
<a class=anchor href=#shrink_to_fit-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>void</span> <span style=color:#a6e22e>shrink_to_fit</span>();
|
||
|
|
</span></span></code></pre></div><p>Does nothing.</p><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>reference <span style=color:#66d9ef>operator</span>[](<span style=color:#66d9ef>const</span> size_type n) <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reference <span style=color:#66d9ef>operator</span>[](<span style=color:#66d9ef>const</span> size_type n) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>Causes undefined behavior.</p><h3 id=at-1><code>at</code>
|
||
|
|
<a class=anchor href=#at-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>reference <span style=color:#a6e22e>at</span>(<span style=color:#66d9ef>const</span> size_type n) ;
|
||
|
|
</span></span><span style=display:flex><span>const_reference <span style=color:#a6e22e>at</span>(<span style=color:#66d9ef>const</span> size_type n) <span style=color:#66d9ef>const</span>;
|
||
|
|
</span></span></code></pre></div><p>Throws <code>std::out_of_range</code>.</p><h3 id=front-1><code>front</code>
|
||
|
|
<a class=anchor href=#front-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>reference <span style=color:#a6e22e>front</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reference <span style=color:#a6e22e>front</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>Causes undefined behavior.</p><h3 id=back-1><code>back</code>
|
||
|
|
<a class=anchor href=#back-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>reference <span style=color:#a6e22e>back</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reference <span style=color:#a6e22e>back</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>Causes undefined behavior.</p><h3 id=data-1><code>data</code>
|
||
|
|
<a class=anchor href=#data-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>pointer <span style=color:#a6e22e>data</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_pointer <span style=color:#a6e22e>data</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>Returns <code>nullptr</code>.</p><h3 id=beginend-1><code>begin/end</code>
|
||
|
|
<a class=anchor href=#beginend-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>iterator <span style=color:#a6e22e>begin</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>iterator <span style=color:#a6e22e>end</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_iterator <span style=color:#a6e22e>begin</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_iterator <span style=color:#a6e22e>end</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_iterator <span style=color:#a6e22e>cbegin</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_iterator <span style=color:#a6e22e>cend</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>Returns an internally defined <code>empty-iterator</code>.</p><p>The <code>empty-iterator</code> remains at the same value after incrementing or decrementing and all values are equivalent.</p><p>Accessing the target of the <code>empty-iterator</code> always calls <code>std::terminate</code>.</p><h3 id=rbeginrend-1><code>rbegin/rend</code>
|
||
|
|
<a class=anchor href=#rbeginrend-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>reverse_iterator <span style=color:#a6e22e>rbegin</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>reverse_iterator <span style=color:#a6e22e>rend</span>() <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reverse_iterator <span style=color:#a6e22e>rbegin</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reverse_iterator <span style=color:#a6e22e>rend</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reverse_iterator <span style=color:#a6e22e>crbegin</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span><span style=display:flex><span>const_reverse_iterator <span style=color:#a6e22e>crend</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
||
|
|
</span></span></code></pre></div><p>Returns an internally defined <code>empty-iterator</code>.</p><p>The <code>empty-iterator</code> remains at the same value after incrementing or decrementing and all values are equivalent.</p><p>Accessing the target of the <code>empty-iterator</code> always calls <code>std::terminate</code>.</p><h2 id=non-member-functions-1>non-member functions
|
||
|
|
<a class=anchor href=#non-member-functions-1>#</a></h2><h3 id=comparison-operator-1>Comparison operator
|
||
|
|
<a class=anchor href=#comparison-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>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>==</span>(<span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</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> discard_comments<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span></code></pre></div><p>All the instances of <code>discard_comments</code> are the same value. <code>operator==</code> returns <code>true</code>, <code>operator=!</code> returns <code>false</code>.</p><h3 id=swap-3><code>swap</code>
|
||
|
|
<a class=anchor href=#swap-3>#</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>swap</span>(discard_comments<span style=color:#f92672>&</span>, discard_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span></code></pre></div><p>Swaps <code>discard_comments</code>. Effectively it does nothing.</p><h3 id=stream-operator-1>Stream operator
|
||
|
|
<a class=anchor href=#stream-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>std<span style=color:#f92672>::</span>ostream<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672><<</span>(std<span style=color:#f92672>::</span>ostream<span style=color:#f92672>&</span>, <span style=color:#66d9ef>const</span> discard_comments<span style=color:#f92672>&</span>);
|
||
|
|
</span></span></code></pre></div><p>Outputs nothing.</p><h1 id=related>Related
|
||
|
|
<a class=anchor href=#related>#</a></h1><ul><li><a href=https://toruniina.github.io/toml11/docs/reference/value/>value.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=#commentshpp>comments.hpp</a></li><li><a href=#tomlpreserve_comments><code>toml::preserve_comments</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=#constructor-stdvectorstdstring>Constructor (<code>std::vector<std::string></code>)</a></li><li><a href=#constructor-discard_comments>Constructor (<code>discard_comments</code>)</a></li><li><a href=#constructor-iterator>Constructor (<code>Iterator</code>)</a></li><li><a href=#constructor-stdinitializer_list>Constructor (<code>std::initializer_list</code>)</a></li><li><a href=#constructor-size-specified>Constructor (Size Specified)</a></li><li><a href=#destructor>Destructor</a></li><li><a href=#operatorpreserve_comments><code>operator=(preserve_comments)</code></a></li><li><a href=#operatorstdvectorstdstring><code>operator=(std::vector<std::string>)</code></a></li><li><a href=#assign><code>assign</code></a></li><li><a href=#insert><code>insert</code></a></li><li><a href=#emplace><code>emplace</code></a></li><li><a href=#erase><code>erase</code></a></li><li><a href=#swap><code>swap</code></a></li><li><a href=#push_back><code>push_back</code></a></li><li><a href=#pop_back><code>pop_back</code></a></li><li><a href=#emplace_back><code>emplace_back</code></a></li><li><a href=#clear><code>clear</code></a></li><li><a href=#size><code>size</code></a></li><li><a href=#max_size><code>max_size</code></a></li><li><a href=#capacity><code>capacity</code></a></li><li><a href=#empty><code>empty</code></a></li><li><a href=#reserve><code>reserve</code></a></li><li><a href=#resize><code>resize</code></a></li><li><a href=#shrink_to_fit><code>shrink_to_fit</code></a></li><li><a href=#operator><code>operator[]</code></a></li><li><a href=#at><code>at</code></a></li><li><a href=#front><code>front</code></a></li><li><a href=#back><code>back</code></a></li><li><a href=#data><code>data</code></a></li><li><a href=#beginend><code>begin/end</code></a></li><li><a href=#rbeginrend><code>rbegin/rend</code></a></li></ul></li><li><a href=#non-member-functions>non-member functions</a><ul><li><a href=#comparison-operator>Comparison operator</a></li><li><a href=#swap-1><code>swap</code></a></li><li><a href=#stream-operator>Stream operator</a></li></ul></li></ul></li><li><a href=#tomldiscard_comments><code>toml::discard_comments</code></a><ul><li><a href=#member-types-1>Member types</a><ul><li><a href=#default-constructor-1>Default Constructor</a></li><li><a href=#copy--move-constructor>Copy / Move Constructor</a></li><li><a href=#constructorstdvectorstdstring>Constructor(<code>std::vector<std::string></code>)</a></li><li><a href=#constructorpreserve_comments>Constructor(<code>preserve_comments</code>)</a></li><li><a href=#constructoriterator>Constructor(<code>Iterator</code>)</a></li><li><a href=#constructorstdinitializer_list>Constructor(<code>std::initializer_list</code>)</a></li><li><a href=#constructorサイズ指定>Constructor(サイズ指定)</a></li><li><a href=#destructor-1>Destructor</a></li><li><a href=#operatordiscard_comments><code>operator=(discard_comments)</code></a></li><li><a href=#operatorstdvectorstdstrin
|