Uh oh!
There was an error while loading. Please reload this page.
Implement P2445R1 forward_like() - #2974
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nicole mazzuca (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>;
ifconstexpr (is_const_v<_UnrefT>) {
// _Copy_const = const _UnrefUifconstexpr (is_rvalue_reference_v<_Ty&&>) {
returnstatic_cast<const _UnrefU&&>(_Ux);
} else {
returnstatic_cast<const _UnrefU&>(_Ux);
}
} else {
// _Copy_const = _UnrefUifconstexpr (is_rvalue_reference_v<_Ty&&>) {
returnstatic_cast<_UnrefU&&>(_Ux);
} else {
returnstatic_cast<_UnrefU&>(_Ux);
}
}Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
A. Jiang (@frederick-vs-ja)Casey Carter (@CaseyCarter)nicole mazzuca (@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). |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for implementing this feature - I like to see the STL moving forward! 😹 😻 🚀 |
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Fixes#2931.
Intentionally don't call
std::move,std::forward, orstd::as_const. Also move_Can_referenceto<utility>for error message.