mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-13 10:52:57 +01:00
Clarify example requirements
This commit is contained in:
parent
b2fa1192bd
commit
4b443fc59b
11
README.md
11
README.md
@ -41,16 +41,17 @@ Supported platforms
|
||||
|
||||
Examples
|
||||
========
|
||||
This example requires at least C++11.
|
||||
```c++
|
||||
#include <string>
|
||||
#include <zmq.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
zmq::context_t ctx;
|
||||
zmq::socket_t sock(ctx, zmq::socket_type::push);
|
||||
sock.bind("inproc://test");
|
||||
const std::string_view m = "Hello, world";
|
||||
sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
|
||||
zmq::context_t ctx;
|
||||
zmq::socket_t sock(ctx, zmq::socket_type::push);
|
||||
sock.bind("inproc://test");
|
||||
sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait);
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -71,8 +71,7 @@ TEST_CASE("socket readme example", "[socket]")
|
||||
zmq::context_t ctx;
|
||||
zmq::socket_t sock(ctx, zmq::socket_type::push);
|
||||
sock.bind("inproc://test");
|
||||
const std::string m = "Hello, world";
|
||||
sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
|
||||
sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user