-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix libfmt errors from not finding enum formatter #2022
Conversation
Thanks for the fix, I think that @vitaut Do you have recommendations? |
Agreed, I just wasn't sure if this is already in libfmt 8.x which folly currently lists in its build manifest. At least libfmt 10.x defines |
As documented, |
@ot, if |
Folly has folly::to_underlying which does this without the need to worry about C++ language versions, or where |
Recent versions of libfmt have become more strict and require `enum` types to be formattable: static assertion failed due to requirement 'formattable': Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt This is a quick fix to simply use the underlying type.
d47eb44
to
d783a64
Compare
Updated PR using |
@ot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: Recent versions of libfmt have become more strict and require `enum` types to be formattable: static assertion failed due to requirement 'formattable': Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt This is a quick fix to simply use the underlying type. X-link: facebook/folly#2022 Reviewed By: yfeldblum Differential Revision: D46973532 Ninja: Flaky land-time Pulled By: ot fbshipit-source-id: 49b64e3885703c2157e66979e0523b5245a9470a
This change is patterned after facebook/folly#2022. An alternative fix would be to provide a formatter specialisation[^1] for `quic::LocalErrorCode`, but that's a bit more involved. [^1]: See https://fmt.dev/10.0.0/api.html#udt.
Recent versions of libfmt have become more strict and require
enum
types to be formattable:This is a quick fix to simply use the underlying type.