Daily bit(e) of C++ | Custom formatters for std::format
Daily bit(e) of C++ #457, Enabling support for formatting user types using std::format by implementing custom formatters.
When enabling formatting for custom types through std::format and std::print, we have to specify not only how to print our type but also how to parse the format string.
While printing is a runtime operation, format parsing is done during compile-time, requiring a constexpr implementation.