We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code using a custom formatter example from the documentation fails to compile:
#include <fmt/format.h> enum class color { red, green, blue }; template <> struct fmt::formatter<color> : formatter<string_view> { // parse is inherited from formatter<string_view>. auto format(color c, format_context& ctx) const -> format_parse_context::iterator; }; auto fmt::formatter<color>::format(color c, format_context& ctx) const -> format_parse_context::iterator { string_view name = "unknown"; switch (c) { case color::red: name = "red"; break; case color::green: name = "green"; break; case color::blue: name = "blue"; break; } return formatter<string_view>::format(name, ctx); } auto foo(color c) { return fmt::format("{}", c); }
https://godbolt.org/z/ojKnYf4ad
The text was updated successfully, but these errors were encountered:
Good catch, thanks. Fixed in #3895.
Sorry, something went wrong.
Thanks for the lightning-fast fix!
No branches or pull requests
The following code using a custom formatter example from the documentation fails to compile:
https://godbolt.org/z/ojKnYf4ad
The text was updated successfully, but these errors were encountered: