From 697929cfbe250afb8bb3569be1fb9fe6ef95bfc4 Mon Sep 17 00:00:00 2001 From: fekir Date: Fri, 18 Aug 2017 18:31:23 +0200 Subject: [PATCH 1/2] Remove noexcept since std::string constructor may throw --- include/SQLiteCpp/Column.h | 2 +- src/Column.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SQLiteCpp/Column.h b/include/SQLiteCpp/Column.h index 041a9a9..9fa32db 100644 --- a/include/SQLiteCpp/Column.h +++ b/include/SQLiteCpp/Column.h @@ -111,7 +111,7 @@ public: * * Note this correctly handles strings that contain null bytes. */ - std::string getString() const noexcept; // nothrow + std::string getString() const; /** * @brief Return the type of the value of the column diff --git a/src/Column.cpp b/src/Column.cpp index ee95e55..c52f520 100644 --- a/src/Column.cpp +++ b/src/Column.cpp @@ -90,7 +90,7 @@ const void* Column::getBlob() const noexcept // nothrow } // Return a std::string to a TEXT or BLOB column -std::string Column::getString() const noexcept // nothrow +std::string Column::getString() const { // Note: using sqlite3_column_blob and not sqlite3_column_text // - no need for sqlite3_column_text to add a \0 on the end, as we're getting the bytes length directly From db156e6282dc54b8d6e9bff8a44e381aa3b44a4b Mon Sep 17 00:00:00 2001 From: fekir Date: Fri, 18 Aug 2017 19:03:58 +0200 Subject: [PATCH 2/2] Remove noexcept from setBusyTimeout since it may throw (it is also documented) --- include/SQLiteCpp/Database.h | 2 +- src/Database.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SQLiteCpp/Database.h b/include/SQLiteCpp/Database.h index b7d87bd..60781ec 100644 --- a/include/SQLiteCpp/Database.h +++ b/include/SQLiteCpp/Database.h @@ -142,7 +142,7 @@ public: * * @throw SQLite::Exception in case of error */ - void setBusyTimeout(const int aBusyTimeoutMs) noexcept; // nothrow + void setBusyTimeout(const int aBusyTimeoutMs); /** * @brief Shortcut to execute one or multiple statements without results. diff --git a/src/Database.cpp b/src/Database.cpp index 164f3e3..4ac1bd9 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -117,7 +117,7 @@ Database::~Database() noexcept // nothrow * * @throw SQLite::Exception in case of error */ -void Database::setBusyTimeout(const int aBusyTimeoutMs) noexcept // nothrow +void Database::setBusyTimeout(const int aBusyTimeoutMs) { const int ret = sqlite3_busy_timeout(mpSQLite, aBusyTimeoutMs); check(ret);