[zeromq-dev] "No throw" alternative version of zmq.hpp

Martin Sustrik sustrik at 250bpm.com
Tue Jul 13 14:22:43 CEST 2010


Hi Matt,

> It looks like I'm going to have to write (branch) a "no throw" version  
> of the C++ wrappers for our blended (C/C++) environment.
> 
> I hate maintaining alternative forks, but IMO it's better to expect a  
> return value consistently, and the "value of destruction" is too great.
> 
> I presume I'll get rights to submit it.  Will anyone else find it  
> useful?

Why not use raw C API then? The C++ API does basically nothing aside of 
converting POSIX error codes into C++ exceptions.

> Any preference on returning bool vs. int for status? Why?

Because EAGAIN as returned by zmq_send and zmq_recv is not a real error 
that should be turned into exception, rather it is success status saying 
"everything is OK, but the action cannot be accomplished immediately, 
try again later".

Martin



More information about the zeromq-dev mailing list