Skip to content

Commit 3e3fe85

Browse files
committed
Add ctor to error_t taking errno and add noexcept specifiers
1 parent 8b64a34 commit 3e3fe85

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

zmq.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,13 @@ typedef zmq_pollitem_t pollitem_t;
250250
class error_t : public std::exception
251251
{
252252
public:
253-
error_t() : errnum(zmq_errno()) {}
253+
error_t() ZMQ_NOTHROW : errnum(zmq_errno()) {}
254+
explicit error_t(int err) ZMQ_NOTHROW : errnum(err) {}
254255
virtual const char *what() const ZMQ_NOTHROW ZMQ_OVERRIDE
255256
{
256257
return zmq_strerror(errnum);
257258
}
258-
int num() const { return errnum; }
259+
int num() const ZMQ_NOTHROW { return errnum; }
259260

260261
private:
261262
int errnum;

0 commit comments

Comments
 (0)