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

Added MSVC checking for support for string_view. #578

Merged
merged 1 commit into from
Oct 9, 2017

Conversation

mwinterb
Copy link
Contributor

@mwinterb mwinterb commented Oct 8, 2017

Microsoft allows customizing the standard version the compiler will target, so a simple _MSC_VER check is inadequate, but __has_include support was added after string_view, so _MSC_VER is still needed.

Also, adding "override" to destructors that are virtual by inheritance.

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great & thanks for the PR!
One small request: could you split the long line for readability?

Also, driveby adding "override" to classes with inherited virtual destructors.
@mwinterb
Copy link
Contributor Author

mwinterb commented Oct 8, 2017

I've fixed that, but I've noticed that the CStringRefTest.Ctor test does not compile with MSVC now. https://github.com/fmtlib/fmt/blob/master/test/format-test.cc#L177
But I don't think that it should compile regardless? If it is compiling, it would appear it's converting from:
string_view -> string -> CStringRef. But the string_view -> string conversion is supposed to be explicit:
string.cons.
In fact, both gcc and clang also do not compile this: https://godbolt.org/g/dEVCQV.

@vitaut vitaut merged commit 933a33a into fmtlib:master Oct 9, 2017
@vitaut
Copy link
Contributor

vitaut commented Oct 9, 2017

Merged, thanks!

@mwinterb mwinterb deleted the string_view_msvc branch October 16, 2017 22:53
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