mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-07-05 18:01:42 +02:00
Add ctor to error_t taking errno and add noexcept specifiers
This commit is contained in:
parent
8b64a341ac
commit
3e3fe85b33
5
zmq.hpp
5
zmq.hpp
@ -250,12 +250,13 @@ typedef zmq_pollitem_t pollitem_t;
|
|||||||
class error_t : public std::exception
|
class error_t : public std::exception
|
||||||
{
|
{
|
||||||
public:
|
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
|
virtual const char *what() const ZMQ_NOTHROW ZMQ_OVERRIDE
|
||||||
{
|
{
|
||||||
return zmq_strerror(errnum);
|
return zmq_strerror(errnum);
|
||||||
}
|
}
|
||||||
int num() const { return errnum; }
|
int num() const ZMQ_NOTHROW { return errnum; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int errnum;
|
int errnum;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user