mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-10-16 07:23:46 +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:
@@ -5,6 +5,11 @@
|
||||
#include <array>
|
||||
#include <memory>
|
||||
|
||||
#if (__cplusplus >= 201703L)
|
||||
static_assert(std::is_nothrow_swappable<zmq::poller_t<>>::value,
|
||||
"poller_t should be nothrow swappable");
|
||||
#endif
|
||||
|
||||
TEST_CASE("poller create destroy", "[poller]")
|
||||
{
|
||||
zmq::poller_t<> poller;
|
||||
@@ -28,6 +33,14 @@ TEST_CASE("poller move assign empty", "[poller]")
|
||||
b = std::move(a);
|
||||
}
|
||||
|
||||
TEST_CASE("poller swap", "[poller]")
|
||||
{
|
||||
zmq::poller_t<> a;
|
||||
zmq::poller_t<> b;
|
||||
using std::swap;
|
||||
swap(a, b);
|
||||
}
|
||||
|
||||
TEST_CASE("poller move construct non empty", "[poller]")
|
||||
{
|
||||
zmq::context_t context;
|
||||
|
Reference in New Issue
Block a user