File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -41,16 +41,17 @@ Supported platforms
41
41
42
42
Examples
43
43
========
44
+ This example requires at least C++11.
44
45
``` c++
45
46
#include < string>
46
47
#include < zmq.hpp>
48
+
47
49
int main ()
48
50
{
49
- zmq::context_t ctx;
50
- zmq::socket_t sock(ctx, zmq::socket_type::push);
51
- sock.bind("inproc://test");
52
- const std::string_view m = "Hello, world";
53
- sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
51
+ zmq::context_t ctx;
52
+ zmq::socket_t sock(ctx, zmq::socket_type::push);
53
+ sock.bind("inproc://test");
54
+ sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait);
54
55
}
55
56
```
56
57
Original file line number Diff line number Diff line change @@ -71,8 +71,7 @@ TEST_CASE("socket readme example", "[socket]")
71
71
zmq::context_t ctx;
72
72
zmq::socket_t sock (ctx, zmq::socket_type::push);
73
73
sock.bind (" inproc://test" );
74
- const std::string m = " Hello, world" ;
75
- sock.send (zmq::buffer (m), zmq::send_flags::dontwait);
74
+ sock.send (zmq::str_buffer (" Hello, world" ), zmq::send_flags::dontwait);
76
75
}
77
76
#endif
78
77
You can’t perform that action at this time.
0 commit comments