-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
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
Support for {0:02X}, 'y' #57
Comments
I was able to patch it with this horrible code. If for some reason you like it, I can make a pull request. diff --git a/format.cc b/format.cc
index f57c0db..8e8cd42 100644
--- a/format.cc
+++ b/format.cc
@@ -440,8 +440,12 @@ class fmt::internal::ArgFormatter :
default:
internal::ReportUnknownType(spec_.type_, "char");
}
- }
- if (spec_.align_ == ALIGN_NUMERIC || spec_.flags_ != 0)
+ }
+ else {
+ if(spec_.align_ == ALIGN_NUMERIC)
+ throw FormatError("invalid format specifier for char");
+ }
+ if (spec_.flags_ != 0)
throw FormatError("invalid format specifier for char");
typedef typename fmt::BasicWriter<Char>::CharPtr CharPtr;
CharPtr out = CharPtr(); |
Fixed, sorry for the inconvenience (I forgot to test the previous fix and of course it was not working as expected). |
Thanks again! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm still getting an error here when calling
fmt::format("{0:02X}", 'x');
and I think it's because it's not liking the number alignment, but...'x'
is a number in this case.The text was updated successfully, but these errors were encountered: