From f70c9f7a7b949247d3d1850f72264f8e2c51008a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Sun, 18 Sep 2022 14:26:41 +0200 Subject: [PATCH] Fix compilation: Revert "Use transparent comparator in mColumnNames to avoid creating std::string when comparing" --- include/SQLiteCpp/Statement.h | 4 ++-- src/Statement.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/SQLiteCpp/Statement.h b/include/SQLiteCpp/Statement.h index ce958937..17317c12 100644 --- a/include/SQLiteCpp/Statement.h +++ b/include/SQLiteCpp/Statement.h @@ -78,9 +78,9 @@ class Statement Statement(const Statement&) = delete; Statement& operator=(const Statement&) = delete; + // TODO: Change Statement move constructor to default Statement(Statement&& aStatement) noexcept; Statement& operator=(Statement&& aStatement) noexcept = default; - // TODO: Change Statement move constructor to default /// Finalize and unregister the SQL query from the SQLite Database Connection. /// The finalization will be done by the destructor of the last shared pointer @@ -703,7 +703,7 @@ class Statement bool mbDone = false; //!< true when the last executeStep() had no more row to fetch /// Map of columns index by name (mutable so getColumnIndex can be const) - mutable std::map> mColumnNames; + mutable std::map mColumnNames; }; diff --git a/src/Statement.cpp b/src/Statement.cpp index bef22b0e..b91de7bf 100644 --- a/src/Statement.cpp +++ b/src/Statement.cpp @@ -275,7 +275,7 @@ int Statement::getColumnIndex(const char* apName) const for (int i = 0; i < mColumnCount; ++i) { const char* pName = sqlite3_column_name(getPreparedStatement(), i); - mColumnNames.emplace(pName, i); + mColumnNames[pName] = i; } }