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

ICU-22843 Disambiguate UnicodeString::readOnlyAlias() for MSVC #3150

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

roubert
Copy link
Member

@roubert roubert commented Sep 11, 2024

Both std::u16string_view and std::wstring_view are possible matches for UnicodeString as a template parameter, but adding an explicit overload avoids both having to make that choice and taking the detour through creating any string view at all.

Checklist
  • Required: Issue filed: https://unicode-org.atlassian.net/browse/ICU-22843
  • Required: The PR title must be prefixed with a JIRA Issue number.
  • Required: The PR description must include the link to the Jira Issue, for example by completing the URL in the first checklist item
  • Required: Each commit message must be prefixed with a JIRA Issue number.
  • Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • API docs and/or User Guide docs changed or added, if applicable

ALLOW_MANY_COMMITS=true

@roubert roubert marked this pull request as draft September 11, 2024 17:25
@roubert roubert changed the title ICU-22843 Add a test case that's ambiguous to MSVC and fails to compile ICU-22843 Disambiguate UnicodeString::readOnlyAlias() for MSVC Sep 11, 2024
@roubert roubert marked this pull request as ready for review September 11, 2024 18:01
@roubert
Copy link
Member Author

roubert commented Sep 11, 2024

The test case in the first commit fails like this with MSVC:

https://github.com/unicode-org/icu/actions/runs/10816568529/job/30008039132?pr=3150

The fix in the second commit makes the test case work also with MSVC.

@markusicu
Copy link
Member

@richgillam FYI

@markusicu
Copy link
Member

The test case in the first commit fails like this with MSVC:

good catch!

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/common/unicode/unistr.h is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

Both std::u16string_view and std::wstring_view are possible matches for
UnicodeString as a template parameter, but adding an explicit overload
avoids both having to make that choice and taking the detour through
creating any string view at all.
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • icu4c/source/common/unicode/unistr.h is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@roubert roubert merged commit 0cb5bc6 into unicode-org:main Sep 11, 2024
94 checks passed
@roubert roubert deleted the 22843-alias branch September 11, 2024 22:36
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