ORIGINAL
|
std::formatter specialization for printable types More...
#include <printable.h>
Static Public Member Functions | |
static constexpr auto | parse (format_parse_context &ctx) |
Parses the format specification for printable types. | |
static auto | format (const T &p, format_context &ctx) |
Formats the printable object using its string conversion. | |
std::formatter specialization for printable types
T | Type derived from printable |
Enables use of printable-derived types with C++20 std::format. Uses the object's string conversion operators for consistent formatting across all output mechanisms.
Example usage:
|
static |
Formats the printable object using its string conversion.
p | Printable object to format |
ctx | Format context |
Converts the printable object to string using its explicit conversion operator, then delegates to the std::string formatter for actual formatting.
|
staticconstexpr |
Parses the format specification for printable types.
ctx | Format parse context |
Currently accepts any format specification and delegates parsing to the underlying string formatter.