From 0cbdc88dbe630996af73790360de8ecb038e6941 Mon Sep 17 00:00:00 2001 From: program-- Date: Mon, 10 Jul 2023 11:22:32 -0700 Subject: [PATCH] rev: delete sqlite copy constructor/assignment Copy constructor/assignment operator are not used for the `sqlite` class, and should subsequently be deleted. This change is implemented per https://github.com/NOAA-OWP/ngen/pull/522#discussion_r1258676455. --- include/geopackage/NGen_SQLite.hpp | 5 +++-- src/geopackage/sqlite/database.cpp | 13 ------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/include/geopackage/NGen_SQLite.hpp b/include/geopackage/NGen_SQLite.hpp index 1bc0b53038..191522eef5 100644 --- a/include/geopackage/NGen_SQLite.hpp +++ b/include/geopackage/NGen_SQLite.hpp @@ -170,8 +170,9 @@ class sqlite */ sqlite(const std::string& path); - sqlite(sqlite& db); - sqlite& operator=(sqlite& db); + sqlite(sqlite& db) = delete; + + sqlite& operator=(sqlite& db) = delete; /** * Take ownership of a sqlite3 database diff --git a/src/geopackage/sqlite/database.cpp b/src/geopackage/sqlite/database.cpp index 7145f35642..4fdb0f6cd1 100644 --- a/src/geopackage/sqlite/database.cpp +++ b/src/geopackage/sqlite/database.cpp @@ -36,19 +36,6 @@ sqlite::sqlite(const std::string& path) this->conn = sqlite_t(conn); } -sqlite::sqlite(sqlite& db) -{ - this->conn = std::move(db.conn); - this->stmt = db.stmt; -} - -sqlite& sqlite::operator=(sqlite& db) -{ - this->conn = std::move(db.conn); - this->stmt = db.stmt; - return *this; -} - sqlite::sqlite(sqlite&& db) { this->conn = std::move(db.conn);