mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-01 10:59:02 +08:00
google-explicit-constructor
This commit is contained in:
@@ -106,7 +106,6 @@ using level_hasher = std::hash<int>;
|
||||
|
||||
} //level
|
||||
|
||||
|
||||
//
|
||||
// Async overflow policy - block by default.
|
||||
//
|
||||
@@ -139,12 +138,14 @@ std::string errno_str(int err_num);
|
||||
class spdlog_ex : public std::exception
|
||||
{
|
||||
public:
|
||||
spdlog_ex(const std::string& msg):_msg(msg)
|
||||
explicit spdlog_ex(std::string msg) : _msg(std::move(msg))
|
||||
{}
|
||||
|
||||
spdlog_ex(const std::string& msg, int last_errno)
|
||||
{
|
||||
_msg = msg + ": " + details::os::errno_str(last_errno);
|
||||
}
|
||||
|
||||
const char* what() const SPDLOG_NOEXCEPT override
|
||||
{
|
||||
return _msg.c_str();
|
||||
@@ -163,5 +164,4 @@ using filename_t = std::wstring;
|
||||
using filename_t = std::string;
|
||||
#endif
|
||||
|
||||
|
||||
} //spdlog
|
||||
|
Reference in New Issue
Block a user