Skip to content
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

Overloaded std::ostream operators for enum types are not being used #232

Closed
vitaut opened this issue Nov 24, 2015 · 1 comment
Closed

Overloaded std::ostream operators for enum types are not being used #232

vitaut opened this issue Nov 24, 2015 · 1 comment

Comments

@vitaut
Copy link
Contributor

vitaut commented Nov 24, 2015

From @Razorx1989:

If someone tries to implement output operators for enum types (for much more informative output) then spdlog just implicitly casts the enum to int and gives the operator no chance. This can be fixed by changing the IsConvertibleToInt type trait.

enum { value = !std::is_enum::value && (sizeof(convert(get())) == sizeof(yes)) };
@vitaut
Copy link
Contributor Author

vitaut commented Nov 24, 2015

Fixed in 6cff6d8 after some struggle with clang =).

@vitaut vitaut closed this as completed Nov 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant