Skip to content

P1989R2 Range Constructor For string_view - #2000

Merged
Stephan T. Lavavej (StephanTLavavej) merged 21 commits into
microsoft:mainfrom
celonymire:cxx23_string_view_range_ctor
Jun 29, 2021
Merged

P1989R2 Range Constructor For string_view#2000
Stephan T. Lavavej (StephanTLavavej) merged 21 commits into
microsoft:mainfrom
celonymire:cxx23_string_view_range_ctor

Conversation

@celonymire

@celonymire Sam Huang (celonymire) commented Jun 10, 2021

Copy link
Copy Markdown
Contributor

Fixes #1977

  • Add tests
  • Add deduction guide

@celonymire
Sam Huang (celonymire) marked this pull request as ready for review June 11, 2021 01:35
@celonymire
Sam Huang (celonymire) requested a review from a team as a code owner June 11, 2021 01:35
Comment thread stl/inc/xstring Outdated
Co-authored-by: timsong-cpp <rs2740@gmail.com>
Comment thread stl/inc/xstring Outdated
Comment thread stl/inc/xstring Outdated
Comment thread tests/std/tests/P0220R1_string_view/test.cpp Outdated
Comment thread tests/std/tests/P0220R1_string_view/test.cpp
Comment thread stl/inc/xstring

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just one little nitpicky thing that I'll go ahead and apply.

Comment thread stl/inc/xstring Outdated
Remove extraneous `std`-qualification on `size_t`.
@CaseyCarter Casey Carter (CaseyCarter) removed their assignment Jun 11, 2021
@StephanTLavavej

Copy link
Copy Markdown
Member

This PR needs to merge main and resolve a conflict in yvals_core.h.

@celonymire

Copy link
Copy Markdown
Contributor Author

This PR needs to merge main and resolve a conflict in yvals_core.h.

On it.

@celonymire

Copy link
Copy Markdown
Contributor Author

Merge fixed.

Comment thread tests/std/tests/P0220R1_string_view/test.cpp Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

@sam20908 Casey Carter (@CaseyCarter) After looking at the Standardese one more time, I added a bit more test coverage to exercise the various constraints. Some of them simply disambiguate other constructors so they didn't need additional testing. The one constraint that isn't exercised is sized_range but since it's in the product code I'm happy.

@StephanTLavavej

This comment has been minimized.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 6fe02ac into microsoft:main Jun 29, 2021
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for implementing this C++23 feature - a major usability improvement that tons of programmers will enjoy! 🎉 😻 🚀

@celonymire
Sam Huang (celonymire) deleted the cxx23_string_view_range_ctor branch June 30, 2021 13:46
@StephanTLavavej

Copy link
Copy Markdown
Member

Reported LLVM-51018 "C++23 makes constructing StringRef from SmallString ambiguous".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cxx23 C++23 feature ranges C++20/23 ranges

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P1989R2 Range Constructor For string_view

4 participants