mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-10-20 05:49:07 +02:00
Problem: Missing swap functions
Solution: Implement for socket_t, context_t, message_t and poller_t Additionally remove dependency on <functional> by refactoring poller_t and remove unused <unordered_map> include.
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
#include <catch.hpp>
|
||||
#include <zmq.hpp>
|
||||
|
||||
#if (__cplusplus >= 201703L)
|
||||
static_assert(std::is_nothrow_swappable<zmq::context_t>::value,
|
||||
"context_t should be nothrow swappable");
|
||||
#endif
|
||||
|
||||
TEST_CASE("context construct default and destroy", "[context]")
|
||||
{
|
||||
zmq::context_t context;
|
||||
@@ -12,3 +17,13 @@ TEST_CASE("context create, close and destroy", "[context]")
|
||||
context.close();
|
||||
CHECK(NULL == (void *) context);
|
||||
}
|
||||
|
||||
#ifdef ZMQ_CPP11
|
||||
TEST_CASE("context swap", "[context]")
|
||||
{
|
||||
zmq::context_t context1;
|
||||
zmq::context_t context2;
|
||||
using std::swap;
|
||||
swap(context1, context2);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user