Refactoring around tuple-like, pair-like, and subrange
#4983
+48
−54
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Effectively mirrors LLVM-85206.
In the current standard wording, the "
pair-likebut notsubrange" pattern is used more often than plainpair-like. So it's probably worthwhile to carve out the_Pair_like_non_subrangeconcept._Tuple_like_non_subrangeseems less worthwhile, but it should be helpful in the constructors oftuple.Moreover, with
_Pair_like_non_subrangecarved out, we can put the definitions of_Pair_likein C++20 & 23 modes together in<xutility>._Pair_like_non_subrangeshould be also helpful for extracting the key object from pair-like construction argument via_In_place_key_extract_map(since C++23). I think this can be done in a future PR.Other changes: Renaming the template parameter of
subrange's conversion function to_PairLike, making the identifier_Pair_likein MSVC STL always mean the concept.