From 3e3fe85b332633b722d5f6005fcc5859635e1f37 Mon Sep 17 00:00:00 2001 From: Gudmundur Adalsteinsson Date: Sun, 6 Sep 2020 13:24:21 +0000 Subject: [PATCH] Add ctor to error_t taking errno and add noexcept specifiers --- zmq.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zmq.hpp b/zmq.hpp index 260d5aa..6ae6180 100644 --- a/zmq.hpp +++ b/zmq.hpp @@ -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;