Skip to content

Commit

Permalink
avoid a string copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Mar 21, 2017
1 parent d261178 commit 9d4aa0e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/database.hpp
Expand Up @@ -45,18 +45,18 @@ class Database {

class DisabledSQLiteError : Error {
public:
explicit DisabledSQLiteError(std::string msg_) : msg(msg_) {}
virtual ~DisabledSQLiteError() {}
virtual std::string what() const { return msg; }
explicit DisabledSQLiteError(const std::string& msg_) : msg(msg_) {}
virtual ~DisabledSQLiteError() = default;
std::string what() const override { return msg; }
private:
std::string msg;
};

class SQLiteReadError : Error {
public:
explicit SQLiteReadError(std::string msg_) : msg(msg_) {}
virtual ~SQLiteReadError() {}
virtual std::string what() const { return msg; }
explicit SQLiteReadError(const std::string& msg_) : msg(msg_) {}
virtual ~SQLiteReadError() = default;
std::string what() const override { return msg; }
private:
std::string msg;
};
Expand Down

0 comments on commit 9d4aa0e

Please sign in to comment.