On this page
C++ named requirements: Formatter (since C++20)
Formatter is a type that abstracts formatting operations for a given formatting argument type and character type. Specializations of std::formatter provided by the standard library are required to meet the requirements of Formatter except as noted otherwise.
A Formatter is able to format both const and non-const arguments, typically by providing a format member function that takes a const reference.
Requirements
A type satisfies Formatter if it satisfies BasicFormatter and given
Arg, a formatting argument typeCharT, a character typeFormatter, a Formatter type for typesArgandCharTOutputIt, a LegacyOutputIterator typef, a value of type (possibly const)Formatterg, a value of typeFormatterarg, an lvalue of typeArgt, a value of type convertible to (possibly const)ArgParseContext, an alias ofstd::basic_format_parse_context<CharT>FormatContext, an alias ofstd::basic_format_context<OutputIt, CharT>parse_ctx, an lvalue of typeParseContextformat_ctx, an lvalue of typeFormatContext
| Expression | Return type | Semantics |
|---|---|---|
f.format(t, format_ctx) |
FormatContext::iterator |
|
f.format(arg, format_ctx) |
FormatContext::iterator |
As above, but does not modify |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/named_req/Formatter