Add ctor to error_t taking errno and add noexcept specifiers

This commit is contained in:
Gudmundur Adalsteinsson 2020-09-06 13:24:21 +00:00
parent 8b64a341ac
commit 3e3fe85b33

View File

@ -250,12 +250,13 @@ typedef zmq_pollitem_t pollitem_t;
class error_t : public std::exception
{
public:
error_t() : errnum(zmq_errno()) {}
error_t() ZMQ_NOTHROW : errnum(zmq_errno()) {}
explicit error_t(int err) ZMQ_NOTHROW : errnum(err) {}
virtual const char *what() const ZMQ_NOTHROW ZMQ_OVERRIDE
{
return zmq_strerror(errnum);
}
int num() const { return errnum; }
int num() const ZMQ_NOTHROW { return errnum; }
private:
int errnum;