Skip to content

Commit 9667c52

Browse files
authored
Merge pull request SRombauts#157 from hubslave/patch-1
Add a move constructor to Database
2 parents 8901553 + 65f719d commit 9667c52

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

include/SQLiteCpp/Database.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,20 @@ class Database
120120
const int aBusyTimeoutMs = 0,
121121
const std::string& aVfs = "");
122122

123+
#if __cplusplus >= 201103L
124+
/**
125+
* @brief Move an SQLite database connection.
126+
*
127+
* @param[in] aDb Database to move
128+
*/
129+
inline Database(Database&& aDb) noexcept :
130+
mpSQLite(aDb.mpSQLite),
131+
mFilename(std::move(aDb.mFilename))
132+
{
133+
aDb.mpSQLite = nullptr;
134+
}
135+
#endif
136+
123137
/**
124138
* @brief Close the SQLite database connection.
125139
*

0 commit comments

Comments
 (0)