From d293180eb16816b2d47d995aafa0ada2cf950e6b Mon Sep 17 00:00:00 2001 From: Jie Date: Wed, 26 Mar 2025 17:50:15 +0800 Subject: [PATCH] fix move operator= function --- include/sqlConnection.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/sqlConnection.h b/include/sqlConnection.h index 575da41..bb3798f 100644 --- a/include/sqlConnection.h +++ b/include/sqlConnection.h @@ -84,8 +84,7 @@ public: SqlConnection& operator=(SqlConnection&& other){ if(this != &other){ - auto temp = SqlConnection{}; - temp.Connect(other.ip, other.port, other.username, other.password, other.database_name); + this->Connect(other.ip, other.port, other.username, other.password, other.database_name); other.Close(); } return *this;