std::formatter specialization for printable types
More...
#include <printable.h>
|
static constexpr auto | parse (format_parse_context &ctx) |
| Parses the format specification.
|
|
static auto | format (const T &p, format_context &ctx) |
| Formats the printable object.
|
|
std::formatter specialization for printable types
- Template Parameters
-
T | Type derived from printable |
Enables use of printable-derived types with std::format. Uses the toString() method for formatting.
MyClass obj;
auto s = std::format("{}", obj);
◆ format()
template<typename T>
auto std::formatter< T >::format |
( |
const T & | p, |
|
|
format_context & | ctx ) |
|
static |
Formats the printable object.
- Parameters
-
p | Printable object to format |
ctx | Format context |
- Returns
- Iterator past the formatted output
◆ parse()
template<typename T>
auto std::formatter< T >::parse |
( |
format_parse_context & | ctx | ) |
|
|
staticconstexpr |
Parses the format specification.
- Parameters
-
- Returns
- Iterator past the parsed format specification
The documentation for this struct was generated from the following file: