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

Forward declare is_string<FILE*> specializations #1086

Merged
merged 1 commit into from
Mar 19, 2019
Merged

Forward declare is_string<FILE*> specializations #1086

merged 1 commit into from
Mar 19, 2019

Conversation

riccozzz
Copy link
Contributor

Not sure if this is the ideal or correct solution, but this is how I got around issue #1085

I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.

@vitaut
Copy link
Contributor

vitaut commented Mar 19, 2019

Thanks for the PR. I think the root cause is that we allow anything as a character type, so a better solution would be to only provide overloads of to_string_view for const char* and const wchar_t* instead of

inline basic_string_view<Char> to_string_view(const Char* s) {
and remove those weird specializations in
template <> struct is_string<std::FILE*> : std::false_type {};
.

@riccozzz
Copy link
Contributor Author

only provide overloads of to_string_view for const char* and const wchar_t*

Correct me if I'm wrong, but wouldn't you at least need char16_t and char32_t as well just to pass unit tests? (and nullptr_t would become ambiguous). Also, wouldn't this be a breaking change for anyone doing something with weird char types?

@vitaut vitaut merged commit 6d416cf into fmtlib:master Mar 19, 2019
@vitaut
Copy link
Contributor

vitaut commented Mar 19, 2019

Hmm, you are right. It's not enough to handle char and wchar_t, we need some kind of is_char trait. Anyway, I'll merge your workaround for now to unbreak master. Thanks again!

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

Successfully merging this pull request may close these issues.

2 participants