Skip to content

Commit

Permalink
Fix compilation: Revert "Use transparent comparator in mColumnNames t…
Browse files Browse the repository at this point in the history
…o avoid creating std::string when comparing"
  • Loading branch information
SRombauts committed Sep 18, 2022
1 parent c7cffad commit f70c9f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/SQLiteCpp/Statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<std::string, int, std::less<>> mColumnNames;
mutable std::map<std::string, int> mColumnNames;
};


Expand Down
2 changes: 1 addition & 1 deletion src/Statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit f70c9f7

Please sign in to comment.