Fix compilation: Revert "Use transparent comparator in mColumnNames to avoid creating std::string when comparing"

This commit is contained in:
Sébastien Rombauts 2022-09-18 14:26:41 +02:00
parent c7cffad617
commit f70c9f7a7b
2 changed files with 3 additions and 3 deletions

View File

@ -78,9 +78,9 @@ public:
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 @@ private:
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<std::string, int, std::less<>> mColumnNames;
mutable std::map<std::string, int> mColumnNames;
};

View File

@ -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;
}
}