std::formattable
| 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 | ||||
formattable (C++23) | ||||
| Formatter | ||||
(C++20) | ||||
(C++23) | ||||
(C++23) | ||||
(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, class CharT > concept formattable = /* formattable_with */< |
(1) | (since C++23) |
| Helper templates |
||
| template< class CharT > using /* fmt_iter_for */ = /* unspecified */; |
(2) | (exposition only*) |
| template< class T, class Context, class Formatter = |
(3) | (exposition only*) |
The concept formattable specifies that std::formatter<std::remove_cvref_t<T>, CharT> meets the requirements of BasicFormatter and Formatter (if std::remove_reference_t<T> is const-qualified).
The exposition-only alias template /* fmt_iter_for */ yields an unspecified type that satisfies std::output_iterator<const CharT&>.
[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 3925 | C++23 | the second template argument of std::basic_format_context was not provided | provided |
[edit] See also
| (C++20) |
defines formatting rules for a given type (class template) [edit] |
| (C++20) |
abstracts formatting operations for a given formatting argument type and character type (named requirement) |
| (C++20) |
defines functions used by the formatting library (named requirement) |