Fix move Base::operator= (#13355)

### Description
Base::operator= move is broken, loses a valid ptr.

### Motivation and Context
Address
https://github.com/microsoft/onnxruntime/pull/13215#discussion_r997814275
This commit is contained in:
Dmitri Smirnov 2022-10-18 13:07:40 -07:00 committed by GitHub
parent f96f222526
commit f5e3165cc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,8 +292,8 @@ struct Base<Unowned<T>> {
Base(Base&& v) noexcept : p_{v.p_} { v.p_ = nullptr; }
Base& operator=(Base&& v) noexcept {
auto t = nullptr;
std::swap(t, v.p_);
p_ = nullptr;
std::swap(p_, v.p_);
return *this;
}