MCPcopy Create free account
hub / github.com/boostorg/asio / any_completion_handler_assignment_test

Function any_completion_handler_assignment_test

test/any_completion_handler.cpp:80–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void any_completion_handler_assignment_test()
81{
82 int count = 0;
83 boost::asio::nullptr_t null_ptr = boost::asio::nullptr_t();
84
85 boost::asio::any_completion_handler<void()> h1;
86
87 boost::asio::any_completion_handler<void()> h2;
88 h2 = null_ptr;
89
90 BOOST_ASIO_CHECK(!h2);
91
92 boost::asio::any_completion_handler<void()> h3;
93 h3 = bindns::bind(&increment, &count);
94
95 BOOST_ASIO_CHECK(!!h3);
96
97 boost::asio::any_completion_handler<void()> h4;
98 h4 = std::move(h1);
99
100 BOOST_ASIO_CHECK(!h4);
101 BOOST_ASIO_CHECK(!h1);
102
103 h4 = std::move(h3);
104
105 BOOST_ASIO_CHECK(!!h4);
106 BOOST_ASIO_CHECK(!h3);
107}
108
109template <typename T>
110class handler_allocator

Callers

nothing calls this directly

Calls 1

bindFunction · 0.50

Tested by

no test coverage detected