-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Remove unneeded check if (this != _STD addressof(_Right))
#3540
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a move assignment above the one you fixed. Can you delete it?
Line 3256 in 994f941
_CONSTEXPR23 unique_ptr& operator=(unique_ptr<_Ty2, _Dx2>&& _Right) noexcept { |
No. Look at https://eel.is/c++draft/unique.ptr.single.asgn We must have 3 assignment operators. constexpr unique_ptr& operator=(unique_ptr&& u) noexcept;
Lines 3262 to 3269 in 994f941
template<class U, class E> constexpr unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept;
Lines 3252 to 3260 in 994f941
constexpr unique_ptr& operator=(nullptr_t) noexcept; Lines 3212 to 3215 in 994f941
|
I see, appreciate it |
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for eliminating this branch in a widely used member function! 🌴 🪓 😸 |
Fixes #3538