diff --git a/CHANGELOG.md b/CHANGELOG.md index 6235ce1..e5ac362 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -127,4 +127,8 @@ Version 2.3.0 - March 3 2019 - Added tests for all MSVC compilers available on AppVeyor (2013, 2015, 2017) #169 - Update VariadicBind.h #172 - Better CMake compatibility #170 -- Add implicit cast operator to char and short types #179 #180 \ No newline at end of file +- Add implicit cast operator to char and short types #179 #180 + +Version ? +- #191 CMake Warning line 299 +- #190 Implement move constructors diff --git a/include/SQLiteCpp/Database.h b/include/SQLiteCpp/Database.h index c471e9b..9f1b5cb 100644 --- a/include/SQLiteCpp/Database.h +++ b/include/SQLiteCpp/Database.h @@ -120,7 +120,7 @@ public: const int aBusyTimeoutMs = 0, const std::string& aVfs = ""); -#if __cplusplus >= 201103L +#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600) /** * @brief Move an SQLite database connection. * diff --git a/tests/Database_test.cpp b/tests/Database_test.cpp index c5e7684..7e548e7 100644 --- a/tests/Database_test.cpp +++ b/tests/Database_test.cpp @@ -63,6 +63,23 @@ TEST(Database, ctorExecCreateDropExist) { remove("test.db3"); } +#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600) +TEST(Database, moveConstructor) { + remove("test.db3"); + { + // Create a new database + SQLite::Database db("test.db3", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE); + EXPECT_FALSE(db.tableExists("test")); + EXPECT_TRUE(db.getHandle() != NULL); + SQLite::Database moved = std::move(db); + EXPECT_TRUE(db.getHandle() == NULL); + EXPECT_TRUE(moved.getHandle() != NULL); + EXPECT_FALSE(moved.tableExists("test")); + } // Close DB test.db3 + remove("test.db3"); +} +#endif + TEST(Database, createCloseReopen) { remove("test.db3"); {