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

Make <string_view> slimmer by default #4633

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frederick-vs-ja
Copy link
Contributor

The new header <__msvc_string_view.hpp> provides char_traits and basic_string_view and related utilities. <string_view> shouldn't provide other utilities in <xstring>. Fixes #4625.

<ranges> seemingly still need to include <xmemory> in C++23 due to elements_of whose default template argument depends on allocator (see #4620).

Escape hatch _LEGACY_CODE_ASSUMES_STRING_VIEW_INCLUDES_XSTRING is provided to restore legacy inclusion.

MSVC-internal changes are needed due to the new internal header.

The new header `<__msvc_string_view.hpp>` provides `char_traits` and
`basic_string_view` and related utilities. `<string_view>` shouldn't
provide other utilities in `<xstring>`.

`<ranges>` seemingly still need to include `<xmemory>` in C++23
due to `elements_of` whose default template argument depends on
`allocator`.

Escape hatch `_LEGACY_CODE_ASSUMES_STRING_VIEW_INCLUDES_XSTRING` is
added to restore legacy inclusion.

MSVC-internal changes are needed due to the new internal header.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner April 27, 2024 11:14
@StephanTLavavej StephanTLavavej added the throughput Must compile faster label Apr 27, 2024
@StephanTLavavej StephanTLavavej self-assigned this Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
throughput Must compile faster
Projects
Status: Initial Review
Development

Successfully merging this pull request may close these issues.

Is it by design that <string_view> provides most contents of <string>?
2 participants