-
Notifications
You must be signed in to change notification settings - Fork 2.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
Formatting of custom types is broken #650
Comments
Moreover, this logic is questionable in the first place, since it shadows the primary convert_to_int template instead of extending it. . The comment says:
But what what the code actually does is:
Which means that |
Good catch, fixed in 91721ca.
I'm not a big fan of this approach either. Suggestions on how to improve it are welcome.
Not really, because of an enum check in template <typename C, typename T>
inline typename std::enable_if<
convert_to_int<T, typename C::char_type>::value && std::is_enum<T>::value,
typed_value<C, int_type>>::type
make_value(const T &val) { return static_cast<int>(val); } All this is basically needed to handle enums properly because they (1) can be implicitly convertible to int and (2) can have overloaded operator<<. |
Thank you!
Shouldn't |
Good idea. Done in 0ee4273. |
If a custom type only provides streaming to std::wostream, this code in ostream.h breaks the compilation, as it only tests std::ostream:
fmt supports wide streams in all other places and this worked fine before and works now if the code above is commented.
The text was updated successfully, but these errors were encountered: