Skip to content

Commit f70c9f7

Browse files
committed
Fix compilation: Revert "Use transparent comparator in mColumnNames to avoid creating std::string when comparing"
1 parent c7cffad commit f70c9f7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/SQLiteCpp/Statement.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ class Statement
7878
Statement(const Statement&) = delete;
7979
Statement& operator=(const Statement&) = delete;
8080

81+
// TODO: Change Statement move constructor to default
8182
Statement(Statement&& aStatement) noexcept;
8283
Statement& operator=(Statement&& aStatement) noexcept = default;
83-
// TODO: Change Statement move constructor to default
8484

8585
/// Finalize and unregister the SQL query from the SQLite Database Connection.
8686
/// The finalization will be done by the destructor of the last shared pointer
@@ -703,7 +703,7 @@ class Statement
703703
bool mbDone = false; //!< true when the last executeStep() had no more row to fetch
704704

705705
/// Map of columns index by name (mutable so getColumnIndex can be const)
706-
mutable std::map<std::string, int, std::less<>> mColumnNames;
706+
mutable std::map<std::string, int> mColumnNames;
707707
};
708708

709709

src/Statement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ int Statement::getColumnIndex(const char* apName) const
275275
for (int i = 0; i < mColumnCount; ++i)
276276
{
277277
const char* pName = sqlite3_column_name(getPreparedStatement(), i);
278-
mColumnNames.emplace(pName, i);
278+
mColumnNames[pName] = i;
279279
}
280280
}
281281

0 commit comments

Comments
 (0)