From 61af40b05edc9227e9faf2d45f8feb505c3188fd Mon Sep 17 00:00:00 2001 From: yangacer Date: Sun, 4 Jun 2017 04:38:14 +0800 Subject: [PATCH] Inline exception class for avoiding C4275 link warning. --- sqlite3cpp.cpp | 5 ----- sqlite3cpp.h | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sqlite3cpp.cpp b/sqlite3cpp.cpp index 7aed438..e682b56 100644 --- a/sqlite3cpp.cpp +++ b/sqlite3cpp.cpp @@ -37,11 +37,6 @@ namespace sqlite3cpp { - -char const *error::what() const noexcept { - return sqlite3_errstr(code); -} - /** * row_iter impl */ diff --git a/sqlite3cpp.h b/sqlite3cpp.h index 4de0118..7819d9d 100644 --- a/sqlite3cpp.h +++ b/sqlite3cpp.h @@ -75,9 +75,11 @@ struct aggregate; C_STYLE_DELETER(sqlite3, sqlite3_close); C_STYLE_DELETER(sqlite3_stmt, sqlite3_finalize); -struct SQLITE3CPP_EXPORT error : std::exception { +struct error : std::exception { error(int code) noexcept : code(code) {} - char const *what() const noexcept; + char const *what() const noexcept { + return sqlite3_errstr(code); + } int code; };