Make system_error(ec) explicit, return by value from system_error::code()

This commit is contained in:
Peter Dimov
2018-10-03 01:15:43 +03:00
parent d13fa54450
commit 504fb05c2f

View File

@ -24,7 +24,7 @@ namespace boost
// library can be caught. See svn.boost.org/trac/boost/ticket/3697 // library can be caught. See svn.boost.org/trac/boost/ticket/3697
{ {
public: public:
system_error( error_code ec ) explicit system_error( error_code ec )
: std::runtime_error(""), m_error_code(ec) {} : std::runtime_error(""), m_error_code(ec) {}
system_error( error_code ec, const std::string & what_arg ) system_error( error_code ec, const std::string & what_arg )
@ -46,8 +46,8 @@ namespace boost
virtual ~system_error() BOOST_NOEXCEPT_OR_NOTHROW {} virtual ~system_error() BOOST_NOEXCEPT_OR_NOTHROW {}
const error_code & code() const BOOST_NOEXCEPT_OR_NOTHROW { return m_error_code; } error_code code() const BOOST_NOEXCEPT { return m_error_code; }
const char * what() const BOOST_NOEXCEPT_OR_NOTHROW; const char * what() const BOOST_NOEXCEPT_OR_NOTHROW;
private: private:
error_code m_error_code; error_code m_error_code;