aboutsummaryrefslogtreecommitdiff
path: root/source/20-codegen-compiler
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-07-30 22:20:45 -0700
committerrtk0c <[email protected]>2022-07-30 22:20:45 -0700
commit92d01f21e420f41b3319431331af54011aa88af6 (patch)
treea28aeffdf5554eca7de0948f5635e74d7efdf810 /source/20-codegen-compiler
parentfbb26deb27909f5603746739822c0d9c338955b9 (diff)
Changeset: 89 Add fmtlib and spdlog deps from conan, fix compile errors to 88
Diffstat (limited to 'source/20-codegen-compiler')
-rw-r--r--source/20-codegen-compiler/SQLiteHelper.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/20-codegen-compiler/SQLiteHelper.hpp b/source/20-codegen-compiler/SQLiteHelper.hpp
index c33c2a3..5e6222d 100644
--- a/source/20-codegen-compiler/SQLiteHelper.hpp
+++ b/source/20-codegen-compiler/SQLiteHelper.hpp
@@ -111,11 +111,11 @@ struct SQLiteRunningStatement {
}
template <typename... Ts>
- void BindArguments(Ts... args) {
+ void BindArguments(Ts&&... args) {
// NOTE: SQLite3 argument index starts at 1
size_t idx = 1;
- auto HandleEachArgument = [this, &idx](auto arg) {
- BindArgument(idx, arg);
+ auto HandleEachArgument = [this, &idx]<typename T>(T&& arg) {
+ BindArgument(idx, std::forward<T>(arg));
++idx;
};
(HandleEachArgument(std::forward<Ts>(args)), ...);
@@ -139,6 +139,7 @@ struct SQLiteRunningStatement {
sqlite3_errmsg(sqlite3_db_handle(stmt)));
throw std::runtime_error(msg);
}
+ return err;
}
void StepUntilDone() {
@@ -171,9 +172,9 @@ struct SQLiteRunningStatement {
auto value = sqlite3_column_int64(stmt, column);
return static_cast<T>(value);
} else if constexpr (std::is_same_v<T, int>) {
- return sqlite3_column_int(stmt, column);
+ return (int)sqlite3_column_int(stmt, column);
} else if constexpr (std::is_same_v<T, int64_t>) {
- return sqlite3_column_int64(stmt, column);
+ return (int64_t)sqlite3_column_int64(stmt, column);
} else if constexpr (std::is_same_v<T, const char*>) {
return (const char*)sqlite3_column_text(stmt, column);
} else if constexpr (std::is_same_v<T, std::string> || std::is_same_v<T, std::string_view>) {