diff --git a/include/onnxruntime/core/session/onnxruntime_cxx_api.h b/include/onnxruntime/core/session/onnxruntime_cxx_api.h index 7c344f57db..dc102b8904 100644 --- a/include/onnxruntime/core/session/onnxruntime_cxx_api.h +++ b/include/onnxruntime/core/session/onnxruntime_cxx_api.h @@ -292,8 +292,8 @@ struct Base> { 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; }