File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 2
2
#include < zmq_addon.hpp>
3
3
4
4
#ifdef ZMQ_HAS_RVALUE_REFS
5
+
6
+ #ifdef ZMQ_CPP17
7
+ static_assert (std::is_invocable<decltype (&zmq::multipart_t ::send),
8
+ zmq::multipart_t *,
9
+ zmq::socket_ref,
10
+ int>::value,
11
+ "Can't multipart_t::send with socket_ref");
12
+ static_assert (std::is_invocable<decltype (&zmq::multipart_t ::recv),
13
+ zmq::multipart_t *,
14
+ zmq::socket_ref,
15
+ int>::value,
16
+ "Can't multipart_t::recv with socket_ref");
17
+ #endif
18
+ static_assert (std::is_constructible<zmq::multipart_t , zmq::socket_ref>::value,
19
+ " Can't construct with socket_ref" );
20
+
5
21
// / \todo split this up into separate test cases
6
22
// /
7
23
TEST_CASE (" multipart legacy test" , " [multipart]" )
Original file line number Diff line number Diff line change @@ -331,7 +331,7 @@ class multipart_t
331
331
multipart_t () {}
332
332
333
333
// Construct from socket receive
334
- multipart_t (socket_t & socket) { recv (socket); }
334
+ multipart_t (socket_ref socket) { recv (socket); }
335
335
336
336
// Construct from memory block
337
337
multipart_t (const void *src, size_t size) { addmem (src, size); }
@@ -393,7 +393,7 @@ class multipart_t
393
393
bool empty () const { return m_parts.empty (); }
394
394
395
395
// Receive multipart message from socket
396
- bool recv (socket_t & socket, int flags = 0 )
396
+ bool recv (socket_ref socket, int flags = 0 )
397
397
{
398
398
clear ();
399
399
bool more = true ;
@@ -413,7 +413,7 @@ class multipart_t
413
413
}
414
414
415
415
// Send multipart message to socket
416
- bool send (socket_t & socket, int flags = 0 )
416
+ bool send (socket_ref socket, int flags = 0 )
417
417
{
418
418
flags &= ~(ZMQ_SNDMORE);
419
419
bool more = size () > 0 ;
You can’t perform that action at this time.
0 commit comments