Implement P2445R1 forward_like()#2974
Merged
StephanTLavavej merged 16 commits intomicrosoft:mainfrom Aug 5, 2022
Merged
Conversation
CaseyCarter
suggested changes
Aug 2, 2022
CaseyCarter
suggested changes
Aug 2, 2022
Contributor
strega-nil-ms
left a comment
There was a problem hiding this comment.
I don't really have a "problem" with how it's written right now, but I would prefer it if this was written closer to the wording of the paper; something like:
using _UnrefT = remove_reference_t<_Ty>;
using _UnrefU = remove_reference_t<_Uty>;
if constexpr (is_const_v<_UnrefT>) {
// _Copy_const = const _UnrefU
if constexpr (is_rvalue_reference_v<_Ty&&>) {
return static_cast<const _UnrefU&&>(_Ux);
} else {
return static_cast<const _UnrefU&>(_Ux);
}
} else {
// _Copy_const = _UnrefU
if constexpr (is_rvalue_reference_v<_Ty&&>) {
return static_cast<_UnrefU&&>(_Ux);
} else {
return static_cast<_UnrefU&>(_Ux);
}
}
StephanTLavavej
approved these changes
Aug 4, 2022
Member
|
@frederick-vs-ja @CaseyCarter @strega-nil-ms Thanks, this looks good! I added a preprocessor comment and slightly expanded the test coverage (mostly out of principle, not any real concern about library or compiler bugs). |
CaseyCarter
approved these changes
Aug 4, 2022
strega-nil-ms
approved these changes
Aug 4, 2022
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
|
Thanks for implementing this feature - I like to see the STL moving forward! 😹 😻 🚀 |
strega-nil
pushed a commit
to strega-nil/stl
that referenced
this pull request
Aug 6, 2022
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
fsb4000
pushed a commit
to fsb4000/STL
that referenced
this pull request
Aug 13, 2022
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2931.
Intentionally don't call
std::move,std::forward, orstd::as_const. Also move_Can_referenceto<utility>for error message.