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

fix: string-view-lite: Include <string> before using std::basic_string #4695

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

StephanTLavavej
Copy link
Contributor

I work on MSVC's STL, and we regularly build popular open-source projects, including yours, with development builds of the MSVC toolset. This allows us to find and fix toolset regressions before they affect users, and also allows us to provide advance notice of breaking changes, which is the case here.

We recently merged microsoft/STL#4633 which will ship in VS 2022 17.11 Preview 3. This improved build throughput by refactoring <string_view> so that it no longer drags in std::basic_string. Your third-party dependency string-view-lite was affected by this source-breaking change, as it wasn't properly including <string>. When built with our updated STL, this will emit a compiler error:

C:/gitP/VowpalWabbit/vowpal_wabbit/ext_libs/string-view-lite\nonstd/string_view.hpp(134): error C2039: 'basic_string': is not a member of 'std'

The fix is simple and portable: simply include the necessary header, immediately before it's needed. I've submitted this upstream as martinmoene/string-view-lite#58 .

@StephanTLavavej StephanTLavavej changed the title string-view-lite: Include <string> before using std::basic_string fix: string-view-lite: Include <string> before using std::basic_string Jun 6, 2024
@jackgerrits
Copy link
Member

Thanks for the fix @StephanTLavavej, and for all the work you do on the STL!

@bassmang bassmang merged commit ae37e6c into VowpalWabbit:master Jun 20, 2024
111 checks passed
@StephanTLavavej StephanTLavavej deleted the include-string branch June 20, 2024 17:51
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.

3 participants