Skip to content

Commit

Permalink
Add ctor to error_t taking errno and add noexcept specifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
gummif committed Sep 6, 2020
1 parent 8b64a34 commit 3e3fe85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3e3fe85

Please sign in to comment.