Skip to content

Commit 4b443fc

Browse files
committed
Clarify example requirements
1 parent b2fa119 commit 4b443fc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,17 @@ Supported platforms
4141

4242
Examples
4343
========
44+
This example requires at least C++11.
4445
```c++
4546
#include <string>
4647
#include <zmq.hpp>
48+
4749
int main()
4850
{
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);
5455
}
5556
```
5657

tests/socket.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ TEST_CASE("socket readme example", "[socket]")
7171
zmq::context_t ctx;
7272
zmq::socket_t sock(ctx, zmq::socket_type::push);
7373
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);
7675
}
7776
#endif
7877

0 commit comments

Comments
 (0)