You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Formats <code>args</code> according to specifications in <code>fmt</code>, writes the result to the output iterator <code>out</code> and returns the iterator past the end of the output range. <code>format_to</code> does not append a terminating null character.</p>
819
819
<p><b>Example</b>: <pre><codeclass="language-cpp">auto out = std::vector<char>();
<p>A view of a collection of formatting arguments. To avoid lifetime issues it should only be used as a parameter type in type-erased functions such as <code>vformat</code>: <pre><codeclass="language-cpp">void vlog(fmt::string_view fmt, fmt::format_args args); // OK
<p>A dynamically growing memory buffer for trivially copyable/constructible types with the first <code>SIZE</code> elements stored in the object itself. Most commonly used via the <code>memory_buffer</code> alias for <code>char</code>.</p>
1353
1353
<p><b>Example</b>: <pre><codeclass="language-cpp">auto out = fmt::memory_buffer();
1354
1354
fmt::format_to(std::back_inserter(out), "The answer is {}.", 42);
1355
-
</code></pre> This will append "The answer is 42." to <code>out</code>. The buffer content can be converted to <code>std::string</code> with <code>to_string(out)</code>. </p>
1355
+
</code> This will append "The answer is 42." to </pre><code>out</code>. The buffer content can be converted to <code>std::string</code> with <code>to_string(out)</code>. </p>
<p>Formats an error message for an error returned by an operating system or a language runtime, for example a file opening error, and writes it to <code>out</code>. The format is the same as the one used by <code>std::system_error(ec, message)</code> where <code>ec</code> is <code>std::error_code(error_code, std::generic_category())</code>. It is implementation-defined but normally looks like: <pre><codeclass="language-cpp"><message>: <system-message>
1410
-
</code></pre> where <code><message></code> is the passed message and <code><system-message></code> is the system message corresponding to the error code. <code>error_code</code> is a system error code as given by <code>errno</code>. </p>
1410
+
</code> where </pre><code><message></code> is the passed message and <code><system-message></code> is the system message corresponding to the error code. <code>error_code</code> is a system error code as given by <code>errno</code>. </p>
<p>Constructs a legacy compile-time format string from a string literal <code>s</code>.</p>
1486
1486
<p><b>Example</b>: <pre><codeclass="language-cpp">// A compile-time error because 'd' is an invalid specifier for strings.
1487
1487
std::string s = fmt::format(FMT_STRING("{:d}"), "foo");
1488
-
</code></pre></p>
1488
+
</code></pre></p>
1489
1489
</div>
1490
1490
</div>
1491
1491
<p>To force the use of legacy compile-time checks, define the preprocessor
@@ -1514,9 +1514,9 @@ <h2 id="range-and-tuple-formatting">Range and Tuple Formatting</h2>
1514
1514
<p><b>Example</b>: <pre><codeclass="language-cpp">auto v = std::vector<int>{1, 2, 3};
1515
1515
fmt::print("{}", fmt::join(v, ", "));
1516
1516
// Output: 1, 2, 3
1517
-
</code></pre><code>fmt::join</code> applies passed format specifiers to the range elements: <pre><codeclass="language-cpp">fmt::print("{:02}", fmt::join(v, ", "));
1517
+
</code></pre><code>fmt::join</code> applies passed format specifiers to the range elements: <pre><codeclass="language-cpp">fmt::print("{:02}", fmt::join(v, ", "));
1518
1518
// Output: 01, 02, 03
1519
-
</code></pre></p>
1519
+
</code></pre></p>
1520
1520
</div>
1521
1521
</div>
1522
1522
<divclass="docblock">
@@ -1537,7 +1537,7 @@ <h2 id="range-and-tuple-formatting">Range and Tuple Formatting</h2>
1537
1537
<p>Returns an object that formats <code>std::initializer_list</code> with elements separated by <code>sep</code>.</p>
<p>Constructs a <code>std::system_error</code> object with the description of the form <pre><codeclass="language-cpp"><message>: <system-message>
1797
-
</code></pre> where <code><message></code> is the formatted message and <code><system-message></code> is the system message corresponding to the error code. <code>error_code</code> is a Windows error code as given by <code>GetLastError</code>. If <code>error_code</code> is not a valid error code such as -1, the system message will look like "error -1".</p>
1797
+
</code> where </pre><code><message></code> is the formatted message and <code><system-message></code> is the system message corresponding to the error code. <code>error_code</code> is a Windows error code as given by <code>GetLastError</code>. If <code>error_code</code> is not a valid error code such as -1, the system message will look like "error -1".</p>
1798
1798
<p><b>Example</b>: <pre><codeclass="language-cpp">// This throws a system_error with the description
1799
1799
// cannot open file 'foo': The system cannot find the file specified.
1800
1800
// or similar (system message may vary) if the file doesn't exist.
0 commit comments