| Localization library | |||||||||||||||||||||||||
| Regular expressions library(C++11) | |||||||||||||||||||||||||
| Formatting library(C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
| |||||||||||||||||||||||||
| Standard format specification | ||||
| Formatting functions | ||||
(C++20) | ||||
(C++20) | ||||
(C++20) | ||||
(C++20) | ||||
(C++20) | ||||
(C++20) | ||||
| Format strings | ||||
(C++20)(C++20)(C++20) | ||||
(C++26) | ||||
| Formatting concepts | ||||
(C++23) | ||||
| Formatter | ||||
(C++20) | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
enable_nonlocking_formatter_optimization (C++23) | ||||
(C++20)(C++20)(C++20) | ||||
(C++20)(C++20)(C++20) | ||||
(C++23) | ||||
(C++23) | ||||
| Formatting arguments | ||||
(C++20) | ||||
(C++20) | ||||
(C++20)(C++20)(C++20) | ||||
(C++20)(deprecated in C++26) | ||||
(C++20)(C++20) | ||||
| Format error | ||||
(C++20) |
Defined in header <format> | ||
template<class T> constexprbool enable_nonlocking_formatter_optimization=false; | (since C++23) | |
This template can be used by implementations to enable efficient implementations ofstd::print andstd::println.
Ifstd::enable_nonlocking_formatter_optimization<T> istrue, printing an argument of typeT can be performed in a more efficient way (seestd::print for details).std::enable_nonlocking_formatter_optimization specializations can betrue in the following cases:
T is one of the types wherestd::formatter<T, CharT> is abasic standard specialization orstandard specialization for a library type (see below).T. Such specializations must beusable in constant expressions and have typeconstbool.Contents |
In the following list,CharT is eitherchar orwchar_t,ArithmeticT is any cv-unqualified arithmetic type other thanchar,wchar_t,char8_t,char16_t, orchar32_t:
Nonlocking flag for character formatters | ||
template<> constexprbool enable_nonlocking_formatter_optimization<CharT>=true; | (1) | |
Nonlocking flag for string formatters | ||
template<> constexprbool enable_nonlocking_formatter_optimization<CharT*>=true; | (2) | |
template<> constexprbool enable_nonlocking_formatter_optimization<const CharT*>=true; | (3) | |
template<std::size_t N> constexprbool enable_nonlocking_formatter_optimization<CharT[N]>=true; | (4) | |
template<class Traits,class Alloc> constexprbool enable_nonlocking_formatter_optimization | (5) | |
template<class Traits> constexprbool enable_nonlocking_formatter_optimization | (6) | |
Nonlocking flag for arithmetic formatters | ||
template<> constexprbool enable_nonlocking_formatter_optimization<ArithmeticT>=true; | (7) | |
Nonlocking flag for pointer formatters | ||
template<> constexprbool enable_nonlocking_formatter_optimization<std::nullptr_t>=true; | (8) | |
template<> constexprbool enable_nonlocking_formatter_optimization<void*>=true; | (9) | |
template<> constexprbool enable_nonlocking_formatter_optimization<constvoid*>=true; | (10) | |
Specializations ofenable_nonlocking_formatter_optimization for all specializations of the following standard templates are defined astrue:
TimeZonePtr isconststd::chrono::time_zone*Specializations ofenable_nonlocking_formatter_optimization for all specializations of the following standard templates are defined as conditionallytrue:
Specialization ofenable_nonlocking_formatter_optimization for allformattable range types are always defined asfalse for which the range format kind is notstd::range_format::disabled.
| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_lib_print | 202403L | (C++26) (DR23) | Formatted output with stream locking |
202406L | (C++26) (DR23) | Enabling nonlocking formatter optimization for more formattable types |
(C++20) | defines formatting rules for a given type (class template)[edit] |
(C++23) | prints tostdout or a file stream usingformatted representation of the arguments (function template)[edit] |
(C++23) | same asstd::print except that each print is terminated by additional new line (function template)[edit] |