A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../error/error_code/../../../cpp/io/vprint_unicode.html below:

std::vprint_unicode, std::vprint_unicode_buffered - cppreference.com

Format args according to the format string fmt, and writes the result to the output stream.

1)

Performs the following operations in order:

  1. Locks stream.
  2. Let out denote the character representation of formatting arguments provided by args formatted according to specifications given in fmt.
  3. Writes out to stream:

Unconditionally unlocks stream on function exit.

If any of the following conditions is satisfied, the behavior is undefined:

3) Equivalent to std::vprint_unicode_buffered(stdout, fmt, args).

[edit] Parameters stream - output file stream to write to fmt - an object that represents the format string. The format string consists of

Each replacement field has the following format:

{ arg-id (optional) } (1) { arg-id (optional) : format-spec } (2)

1) replacement field without a format specification

2) replacement field with a format specification

arg-id - specifies the index of the argument in args whose value is to be used for formatting; if it is omitted, the arguments are used in order.

The arg-id s in a format string must all be present or all be omitted. Mixing manual and automatic indexing is an error.

format-spec - the format specification defined by the std::formatter specialization for the corresponding argument. Cannot start with }. args - arguments to be formatted [edit] Exceptions [edit] Notes

The C++ standard encourages the implementers to produce a diagnostic message if out contains invalid Unicode code units.

On POSIX, writing to a terminal is done using the usual standard I/O functions, so there is no need to treat a terminal differently to any other file stream.

On Windows, the stream refers to a terminal if GetConsoleMode(_get_osfhandle(_fileno(stream))) returns nonzero (see Windows documentation for GetConsoleMode, _get_osfhandle, and _fileno). The native Unicode API on Windows is WriteConsoleW.

If invoking the native Unicode API requires transcoding, the invalid code units are substituted with U+FFFD REPLACEMENT CHARACTER (see "The Unicode Standard - Core Specification", Chapter 3.9).

[edit] Example [edit] Defect reports

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 by stream can display Unicode only used if the terminal can only use
the native Unicode API to display Unicode P3107R5 C++23 printing operations were always buffered provides unbuffered printing operations P3235R3 C++23 the names of the functions added
by P3107R5 were misleading changed the function names [edit] See also [edit] External links

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4