| I/O manipulators | ||||
| Print functions(C++23) | ||||
| C-style I/O | ||||
| Buffers | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++20) | ||||
| Streams | ||||
| Abstractions | ||||
| File I/O | ||||
| String I/O | ||||
| Array I/O | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
(C++98/26*) | ||||
| Synchronized Output | ||||
(C++20) | ||||
| Types | ||||
| Error category interface | ||||
(C++11) | ||||
(C++11) |
| Global objects | ||||
| Member functions | ||||
(C++11) | ||||
| Formatted output | ||||
| Unformatted output | ||||
| Positioning | ||||
| Miscellaneous | ||||
(C++11) | ||||
| Member classes | ||||
| Non-member functions | ||||
(C++23) | ||||
(C++23) | ||||
vprint_unicode(std::ostream) (C++23) | ||||
Defined in header <ostream> | ||
void vprint_unicode(std::ostream& os, std::string_view fmt,std::format_args args); | (since C++23) | |
Formatargs according to the format stringfmt, and writes the result to the output streamos. Behaves asFormattedOutputFunction ofos, except that some details of error reportingdiffer.
Performs the following operations in order:
[out.begin(), out.end()) intoos.If writing to the terminal or inserting intoos fails, callsos.setstate(std::ios_base::badbit).
After writing characters toos, establishes anobservable checkpoint. | (since C++26) |
Ifout contains invalid Unicodecode units when the native Unicode API is used, the behavior is undefined.
Contents |
| os | - | output stream to insert data into | ||||||||||||||||||||||||||||||||||||||||||||||
| fmt | - | an object that represents the format string. The format string consists of
Each replacement field has the following format:
1) replacement field without a format specification 2) replacement field with a format specification
| ||||||||||||||||||||||||||||||||||||||||||||||
| args | - | arguments to be formatted | ||||||||||||||||||||||||||||||||||||||||||||||
If invoking the native Unicode API requires transcoding, the invalid code units are substituted withU+FFFD REPLACEMENT CHARACTER (see "The Unicode Standard - Core Specification",Chapter 3.9).
| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_lib_print | 202207L | (C++23) | Formatted output |
__cpp_lib_format | 202207L | (C++23) | Exposingstd::basic_format_string |
| This section is incomplete Reason: no example |
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 4044 | C++23 | the native Unicode API was always used if the terminal referred to byos can display Unicode | only used if the terminal can only use the native Unicode API to display Unicode |
| outputs character data usingtype-erased argument representation (function)[edit] | |
(C++23) | outputsformatted representation of the arguments (function template)[edit] |
| inserts character data or insert into rvalue stream (function template)[edit] | |
| prints to Unicode capablestdout or a file stream usingtype-erased argument representation (function)[edit] | |
(C++20) | stores formatted representation of the arguments in a new string (function template)[edit] |
| 1. | Unicode — Wikipedia |
| 2. | The Unicode Standard Version 14.0 — Core Specification |