Add an rvalue overload for socket_t::send

This lets you create functions that return message_t's by value, and
pass them to send() with no copy.
This commit is contained in:
Todd Neal 2015-03-05 11:15:08 -06:00
parent f141cf5bfc
commit 67b216681d

View File

@ -441,6 +441,13 @@ namespace zmq
throw error_t ();
}
#ifdef ZMQ_HAS_RVALUE_REFS
inline bool send (message_t &&msg_, int flags_ = 0)
{
return send(msg_, flags_);
}
#endif
inline size_t recv (void *buf_, size_t len_, int flags_ = 0)
{
int nbytes = zmq_recv (ptr, buf_, len_, flags_);