mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-14 02:57:48 +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
|
Examples
|
||||||
========
|
========
|
||||||
|
This example requires at least C++11.
|
||||||
```c++
|
```c++
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <zmq.hpp>
|
#include <zmq.hpp>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
zmq::context_t ctx;
|
zmq::context_t ctx;
|
||||||
zmq::socket_t sock(ctx, zmq::socket_type::push);
|
zmq::socket_t sock(ctx, zmq::socket_type::push);
|
||||||
sock.bind("inproc://test");
|
sock.bind("inproc://test");
|
||||||
const std::string_view m = "Hello, world";
|
sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait);
|
||||||
sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -71,8 +71,7 @@ TEST_CASE("socket readme example", "[socket]")
|
|||||||
zmq::context_t ctx;
|
zmq::context_t ctx;
|
||||||
zmq::socket_t sock(ctx, zmq::socket_type::push);
|
zmq::socket_t sock(ctx, zmq::socket_type::push);
|
||||||
sock.bind("inproc://test");
|
sock.bind("inproc://test");
|
||||||
const std::string m = "Hello, world";
|
sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait);
|
||||||
sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user