Unnamed: 0
int64 0
0
| repo_id
stringlengths 5
186
| file_path
stringlengths 15
223
| content
stringlengths 1
32.8M
⌀ |
---|---|---|---|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/experimental/awaitable_operators.cpp | //
// experimental/awaitable_operators.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Prevent link dependency on the Boost.System library.
#if !defined(BOOST_SYSTEM_NO_DEPRECATED)
#define BOOST_SYSTEM_NO_DEPRECATED
#endif // !defined(BOOST_SYSTEM_NO_DEPRECATED)
// Test that header file is self-contained.
#include "asio/experimental/awaitable_operators.hpp"
#include "asio/co_spawn.hpp"
#include "asio/detached.hpp"
#include "asio/io_context.hpp"
#include "asio/post.hpp"
#include "../unit_test.hpp"
using asio::awaitable;
using namespace asio::experimental::awaitable_operators;
struct move_only
{
move_only(int i) : value(i) {}
move_only(const move_only&) = delete;
move_only(move_only&&) {}
move_only& operator=(const move_only&) = delete;
move_only& operator=(move_only&&) { return *this; }
int value;
};
awaitable<void> void_ok()
{
co_return;
}
awaitable<void> void_ex()
{
throw std::runtime_error("exception");
co_return;
}
awaitable<void> void_post_loop()
{
for (;;)
co_await asio::post(asio::use_awaitable);
}
awaitable<int> int_0()
{
co_return 0;
}
awaitable<int> int_1()
{
co_return 1;
}
awaitable<int> int_2()
{
co_return 2;
}
awaitable<int> int_ex()
{
throw std::runtime_error("exception");
co_return -1;
}
awaitable<move_only> move_only_0()
{
co_return move_only(0);
}
awaitable<move_only> move_only_1()
{
co_return move_only(1);
}
awaitable<move_only> move_only_2()
{
co_return move_only(2);
}
awaitable<move_only> move_only_ex()
{
throw std::runtime_error("exception");
co_return move_only(-1);
}
awaitable<void> do_test_and_awaitable_operator()
{
int i;
std::tuple<int, int> ii;
std::tuple<int, int, int> iii;
co_await (void_ok() && void_ok());
co_await (void_ok() && void_ok() && void_ok());
try { co_await (void_ex() && void_ok()); } catch (...) {}
try { co_await (void_ex() && void_ok() && void_ok()); } catch (...) {}
try { co_await (void_ex() && void_post_loop()); } catch (...) {}
try { co_await (void_ex() && void_ok() && void_post_loop()); } catch (...) {}
i = co_await (void_ok() && int_0());
ASIO_CHECK(i == 0);
i = co_await (void_ok() && int_1());
ASIO_CHECK(i == 1);
i = co_await (int_0() && void_ok());
ASIO_CHECK(i == 0);
ii = co_await (int_0() && int_1());
ASIO_CHECK(std::get<0>(ii) == 0);
ASIO_CHECK(std::get<1>(ii) == 1);
i = co_await (void_ok() && void_ok() && int_0());
ASIO_CHECK(i == 0);
i = co_await (void_ok() && int_0() && void_ok());
ASIO_CHECK(i == 0);
ii = co_await (void_ok() && int_0() && int_1());
ASIO_CHECK(std::get<0>(ii) == 0);
ASIO_CHECK(std::get<1>(ii) == 1);
ii = co_await (int_0() && void_ok() && int_1());
ASIO_CHECK(std::get<0>(ii) == 0);
ASIO_CHECK(std::get<1>(ii) == 1);
iii = co_await (int_0() && int_1() && int_2());
ASIO_CHECK(std::get<0>(iii) == 0);
ASIO_CHECK(std::get<1>(iii) == 1);
ASIO_CHECK(std::get<2>(iii) == 2);
}
void test_and_awaitable_operator()
{
asio::io_context ctx;
co_spawn(ctx, do_test_and_awaitable_operator(), asio::detached);
ctx.run();
}
awaitable<void> do_test_or_awaitable_operator()
{
std::variant<int, int> ii;
std::variant<int, std::monostate> iv;
std::variant<std::monostate, int> vi;
std::variant<std::monostate, std::monostate> vv;
std::variant<int, int, int> iii;
std::variant<int, int, std::monostate> iiv;
std::variant<int, std::monostate, int> ivi;
std::variant<int, std::monostate, std::monostate> ivv;
std::variant<std::monostate, int, int> vii;
std::variant<std::monostate, int, std::monostate> viv;
std::variant<std::monostate, std::monostate, int> vvi;
std::variant<std::monostate, std::monostate, std::monostate> vvv;
vv = co_await (void_ok() || void_ok());
ASIO_CHECK(vv.index() == 0);
vv = co_await (void_ex() || void_ok());
ASIO_CHECK(vv.index() == 1);
vi = co_await (void_ok() || int_0());
ASIO_CHECK(vi.index() == 0);
vi = co_await (void_ex() || int_0());
ASIO_CHECK(vi.index() == 1);
iv = co_await (int_0() || void_ex());
ASIO_CHECK(iv.index() == 0);
ASIO_CHECK(std::get<0>(iv) == 0);
ii = co_await (int_0() || int_1());
ASIO_CHECK(ii.index() == 0);
ASIO_CHECK(std::get<0>(ii) == 0);
ii = co_await (int_ex() || int_1());
ASIO_CHECK(ii.index() == 1);
ASIO_CHECK(std::get<1>(ii) == 1);
vvv = co_await (void_ok() || void_ok() || void_ok());
ASIO_CHECK(vvv.index() == 0);
vvv = co_await (void_ex() || void_ok() || void_ok());
ASIO_CHECK(vvv.index() == 1);
vvv = co_await (void_ex() || void_ex() || void_ok());
ASIO_CHECK(vvv.index() == 2);
vvi = co_await (void_ok() || void_ok() || int_0());
ASIO_CHECK(vvi.index() == 0);
viv = co_await (void_ok() || int_0() || void_ok());
ASIO_CHECK(viv.index() == 0);
viv = co_await (void_ex() || int_0() || void_ok());
ASIO_CHECK(viv.index() == 1);
ASIO_CHECK(std::get<1>(viv) == 0);
vii = co_await (void_ex() || int_0() || int_1());
ASIO_CHECK(vii.index() == 1);
ASIO_CHECK(std::get<1>(vii) == 0);
ivv = co_await (int_0() || void_ok() || void_ok());
ASIO_CHECK(ivv.index() == 0);
ASIO_CHECK(std::get<0>(ivv) == 0);
ivv = co_await (int_ex() || void_ok() || void_ok());
ASIO_CHECK(ivv.index() == 1);
ivi = co_await (int_0() || void_ok() || int_1());
ASIO_CHECK(ivi.index() == 0);
ASIO_CHECK(std::get<0>(ivi) == 0);
ivi = co_await (int_ex() || void_ok() || int_1());
ASIO_CHECK(ivi.index() == 1);
iiv = co_await (int_0() || int_1() || void_ok());
ASIO_CHECK(iiv.index() == 0);
ASIO_CHECK(std::get<0>(iiv) == 0);
iiv = co_await (int_ex() || int_1() || void_ok());
ASIO_CHECK(iiv.index() == 1);
ASIO_CHECK(std::get<0>(iiv) == 1);
iiv = co_await (int_ex() || int_ex() || void_ok());
ASIO_CHECK(iiv.index() == 2);
iii = co_await (int_0() || int_1() || int_2());
ASIO_CHECK(iii.index() == 0);
ASIO_CHECK(std::get<0>(iii) == 0);
iii = co_await (int_ex() || int_1() || int_2());
ASIO_CHECK(iii.index() == 1);
ASIO_CHECK(std::get<1>(iii) == 1);
iii = co_await (int_ex() || int_ex() || int_2());
ASIO_CHECK(iii.index() == 2);
ASIO_CHECK(std::get<2>(iii) == 2);
std::variant<move_only, int> mi = co_await (move_only_0() || int_1());
ASIO_CHECK(mi.index() == 0);
ASIO_CHECK(std::get<0>(mi).value == 0);
mi = co_await (move_only_ex() || int_1());
ASIO_CHECK(mi.index() == 1);
ASIO_CHECK(std::get<1>(mi) == 1);
std::variant<move_only, move_only> mm =
co_await (move_only_0() || move_only_1());
ASIO_CHECK(mm.index() == 0);
ASIO_CHECK(std::get<0>(mm).value == 0);
mm = co_await (move_only_ex() || move_only_1());
ASIO_CHECK(mm.index() == 1);
ASIO_CHECK(std::get<1>(mm).value == 1);
std::variant<move_only, move_only, move_only> mmm =
co_await (move_only_0() || move_only_1() || move_only_2());
ASIO_CHECK(mmm.index() == 0);
ASIO_CHECK(std::get<0>(mmm).value == 0);
mmm = co_await (move_only_ex() || move_only_1() || move_only_2());
ASIO_CHECK(mmm.index() == 1);
ASIO_CHECK(std::get<1>(mmm).value == 1);
mmm = co_await (move_only_ex() || move_only_ex() || move_only_2());
ASIO_CHECK(mmm.index() == 2);
ASIO_CHECK(std::get<2>(mmm).value == 2);
}
void test_or_awaitable_operator()
{
asio::io_context ctx;
co_spawn(ctx, do_test_or_awaitable_operator(), asio::detached);
ctx.run();
}
ASIO_TEST_SUITE
(
"experimental/awaitable_operators",
ASIO_TEST_CASE(test_and_awaitable_operator)
ASIO_TEST_CASE(test_or_awaitable_operator)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/experimental/channel_traits.cpp | //
// experimental/channel_traits.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/channel_traits.hpp"
#include "../unit_test.hpp"
ASIO_TEST_SUITE
(
"experimental/channel_traits",
ASIO_TEST_CASE(null_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/experimental/basic_channel.cpp | //
// experimental/basic_channel.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/basic_channel.hpp"
#include "../unit_test.hpp"
ASIO_TEST_SUITE
(
"experimental/basic_channel",
ASIO_TEST_CASE(null_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/experimental/co_composed.cpp | //
// experimental/co_composed.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/co_composed.hpp"
#include "../unit_test.hpp"
ASIO_TEST_SUITE
(
"experimental/co_composed",
ASIO_TEST_CASE(null_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/experimental/parallel_group.cpp | //
// experimental/parallel_group.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/parallel_group.hpp"
#include "../unit_test.hpp"
ASIO_TEST_SUITE
(
"experimental/parallel_group",
ASIO_TEST_CASE(null_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/experimental/concurrent_channel.cpp | //
// experimental/concurrent_channel.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/concurrent_channel.hpp"
#include <utility>
#include "asio/error.hpp"
#include "asio/io_context.hpp"
#include "../unit_test.hpp"
using namespace asio;
using namespace asio::experimental;
void unbuffered_concurrent_channel_test()
{
io_context ctx;
concurrent_channel<void(asio::error_code, std::string)> ch1(ctx);
ASIO_CHECK(ch1.is_open());
ASIO_CHECK(!ch1.ready());
bool b1 = ch1.try_send(asio::error::eof, "hello");
ASIO_CHECK(!b1);
std::string s1 = "abcdefghijklmnopqrstuvwxyz";
bool b2 = ch1.try_send(asio::error::eof, std::move(s1));
ASIO_CHECK(!b2);
ASIO_CHECK(!s1.empty());
asio::error_code ec1;
std::string s2;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec1 = ec;
s2 = std::move(s);
});
bool b3 = ch1.try_send(asio::error::eof, std::move(s1));
ASIO_CHECK(b3);
ASIO_CHECK(s1.empty());
ctx.run();
ASIO_CHECK(ec1 == asio::error::eof);
ASIO_CHECK(s2 == "abcdefghijklmnopqrstuvwxyz");
bool b4 = ch1.try_receive([](asio::error_code, std::string){});
ASIO_CHECK(!b4);
asio::error_code ec2 = asio::error::would_block;
std::string s3 = "zyxwvutsrqponmlkjihgfedcba";
ch1.async_send(asio::error::eof, std::move(s3),
[&](asio::error_code ec)
{
ec2 = ec;
});
asio::error_code ec3;
std::string s4;
bool b5 = ch1.try_receive(
[&](asio::error_code ec, std::string s)
{
ec3 = ec;
s4 = s;
});
ASIO_CHECK(b5);
ASIO_CHECK(ec3 == asio::error::eof);
ASIO_CHECK(s4 == "zyxwvutsrqponmlkjihgfedcba");
ctx.restart();
ctx.run();
ASIO_CHECK(!ec2);
};
void buffered_concurrent_channel_test()
{
io_context ctx;
concurrent_channel<void(asio::error_code, std::string)> ch1(ctx, 1);
ASIO_CHECK(ch1.is_open());
ASIO_CHECK(!ch1.ready());
bool b1 = ch1.try_send(asio::error::eof, "hello");
ASIO_CHECK(b1);
std::string s1 = "abcdefghijklmnopqrstuvwxyz";
bool b2 = ch1.try_send(asio::error::eof, std::move(s1));
ASIO_CHECK(!b2);
ASIO_CHECK(!s1.empty());
asio::error_code ec1;
std::string s2;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec1 = ec;
s2 = std::move(s);
});
ctx.run();
ASIO_CHECK(ec1 == asio::error::eof);
ASIO_CHECK(s2 == "hello");
bool b4 = ch1.try_receive([](asio::error_code, std::string){});
ASIO_CHECK(!b4);
asio::error_code ec2 = asio::error::would_block;
std::string s3 = "zyxwvutsrqponmlkjihgfedcba";
ch1.async_send(asio::error::eof, std::move(s3),
[&](asio::error_code ec)
{
ec2 = ec;
});
asio::error_code ec3;
std::string s4;
bool b5 = ch1.try_receive(
[&](asio::error_code ec, std::string s)
{
ec3 = ec;
s4 = s;
});
ASIO_CHECK(b5);
ASIO_CHECK(ec3 == asio::error::eof);
ASIO_CHECK(s4 == "zyxwvutsrqponmlkjihgfedcba");
ctx.restart();
ctx.run();
ASIO_CHECK(!ec2);
};
ASIO_TEST_SUITE
(
"experimental/concurrent_channel",
ASIO_TEST_CASE(unbuffered_concurrent_channel_test)
ASIO_TEST_CASE(buffered_concurrent_channel_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/experimental/basic_concurrent_channel.cpp | //
// experimental/basic_concurrent_channel.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/basic_concurrent_channel.hpp"
#include "../unit_test.hpp"
ASIO_TEST_SUITE
(
"experimental/basic_concurrent_channel",
ASIO_TEST_CASE(null_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/experimental/promise.cpp | //
// promise.cpp
// ~~~~~~~~~~~
//
// Copyright (c) 2021-2023 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/promise.hpp"
#include "asio/append.hpp"
#include "asio/bind_cancellation_slot.hpp"
#include "asio/compose.hpp"
#include "asio/deferred.hpp"
#include "asio/experimental/use_promise.hpp"
#include "asio/steady_timer.hpp"
#include "../unit_test.hpp"
namespace promise {
void promise_tester()
{
using namespace asio;
using namespace std::chrono;
io_context ctx;
steady_timer timer1{ctx}, timer2{ctx};
const auto started_when = steady_clock::now();
timer1.expires_at(started_when + milliseconds(5000));
timer2.expires_at(started_when + milliseconds(1000));
auto p1 = timer1.async_wait(experimental::use_promise);
steady_clock::time_point completed_when;
asio::error_code ec;
bool called = false;
p1([&](asio::error_code ec_)
{
ec = ec_;
called = true;
completed_when = steady_clock::now();
});
steady_clock::time_point timer2_done;
timer2.async_wait(
[&](asio::error_code)
{
timer2_done = steady_clock::now();
p1.cancel();
});
ctx.run();
static_assert(
asio::is_async_operation<decltype(p1)>::value,
"promise is async_op");
ASIO_CHECK(timer2_done + milliseconds(1) > started_when);
ASIO_CHECK(completed_when > timer2_done);
ASIO_CHECK(called);
ASIO_CHECK(ec == error::operation_aborted);
timer1.expires_after(milliseconds(0));
auto p2 = timer1.async_wait(
asio::append(experimental::use_promise, 123));
ec = asio::error::would_block;
called = false;
p2([&](asio::error_code ec_, int i)
{
ASIO_CHECK(i == 123);
ec = ec_;
called = true;
});
ASIO_CHECK(ec == asio::error::would_block);
ASIO_CHECK(!called);
ctx.restart();
ctx.run();
static_assert(
asio::is_async_operation<decltype(p2)>::value,
"promise is async_op");
ASIO_CHECK(!ec);
ASIO_CHECK(called);
}
void promise_slot_tester()
{
using namespace asio;
using namespace std::chrono;
io_context ctx;
steady_timer timer1{ctx}, timer2{ctx};
const auto started_when = steady_clock::now();
timer1.expires_at(started_when + milliseconds(2500));
timer2.expires_at(started_when + milliseconds(1000));
auto p = timer1.async_wait(experimental::use_promise);
steady_clock::time_point completed_when;
asio::error_code ec;
bool called = false;
asio::cancellation_signal sig;
p(asio::bind_cancellation_slot(
sig.slot(),
[&](asio::error_code ec_)
{
ec = ec_;
called = true;
completed_when = steady_clock::now();
}));
steady_clock::time_point timer2_done;
timer2.async_wait(
[&](asio::error_code)
{
timer2_done = steady_clock::now();
sig.emit(asio::cancellation_type::all);
});
ctx.run();
static_assert(
asio::is_async_operation<decltype(p)>::value,
"promise is async_op");
ASIO_CHECK(timer2_done + milliseconds(1) > started_when);
ASIO_CHECK(completed_when > timer2_done);
ASIO_CHECK(called);
ASIO_CHECK(ec == error::operation_aborted);
}
void early_completion()
{
using namespace asio;
using namespace std::chrono;
io_context ctx;
auto p = asio::post(ctx, asio::experimental::use_promise);
ctx.run();
ASIO_CHECK(p.completed());
bool completed = false;
p([&]{completed = true;});
ASIO_CHECK(!completed);
ctx.restart();
ctx.run();
ASIO_CHECK(completed);
}
struct test_cancel_impl_op
{
asio::steady_timer & tim;
asio::error_code &ec;
template<typename Self>
void operator()(Self& self)
{
tim.async_wait(std::forward<Self>(self));
}
template<typename Self>
void operator()(Self& self, asio::error_code ec_)
{
ec = ec_;
self.complete(ec_);
}
};
template <typename CompletionToken>
ASIO_INITFN_AUTO_RESULT_TYPE(
CompletionToken, void(asio::error_code))
test_cancel_impl(asio::steady_timer & tim,
asio::error_code &ec,
CompletionToken&& token)
{
return asio::async_compose<CompletionToken, void(asio::error_code)>(
test_cancel_impl_op{tim, ec}, token, tim);
}
void test_cancel()
{
asio::io_context ctx;
asio::steady_timer tim{ctx, std::chrono::seconds(10)};
asio::error_code ec;
{
auto p = test_cancel_impl(
tim, ec, asio::experimental::use_promise);
}
ctx.run();
ASIO_CHECK_MESSAGE(
ec == asio::error::operation_aborted,
ec.message());
}
} // namespace promise
ASIO_TEST_SUITE
(
"promise",
ASIO_TEST_CASE(promise::promise_tester)
ASIO_TEST_CASE(promise::promise_slot_tester)
ASIO_TEST_CASE(promise::early_completion)
ASIO_TEST_CASE(promise::test_cancel)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/experimental/channel.cpp | //
// experimental/channel.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/channel.hpp"
#include <utility>
#include "asio/any_completion_handler.hpp"
#include "asio/bind_executor.hpp"
#include "asio/bind_immediate_executor.hpp"
#include "asio/error.hpp"
#include "asio/io_context.hpp"
#include "asio/system_executor.hpp"
#include "../unit_test.hpp"
using namespace asio;
using namespace asio::experimental;
void unbuffered_channel_test()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx);
ASIO_CHECK(ch1.is_open());
ASIO_CHECK(!ch1.ready());
bool b1 = ch1.try_send(asio::error::eof, "hello");
ASIO_CHECK(!b1);
std::string s1 = "abcdefghijklmnopqrstuvwxyz";
bool b2 = ch1.try_send(asio::error::eof, std::move(s1));
ASIO_CHECK(!b2);
ASIO_CHECK(!s1.empty());
asio::error_code ec1;
std::string s2;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec1 = ec;
s2 = std::move(s);
});
bool b3 = ch1.try_send(asio::error::eof, std::move(s1));
ASIO_CHECK(b3);
ASIO_CHECK(s1.empty());
ctx.run();
ASIO_CHECK(ec1 == asio::error::eof);
ASIO_CHECK(s2 == "abcdefghijklmnopqrstuvwxyz");
bool b4 = ch1.try_receive([](asio::error_code, std::string){});
ASIO_CHECK(!b4);
asio::error_code ec2 = asio::error::would_block;
std::string s3 = "zyxwvutsrqponmlkjihgfedcba";
ch1.async_send(asio::error::eof, std::move(s3),
[&](asio::error_code ec)
{
ec2 = ec;
});
asio::error_code ec3;
std::string s4;
bool b5 = ch1.try_receive(
[&](asio::error_code ec, std::string s)
{
ec3 = ec;
s4 = s;
});
ASIO_CHECK(b5);
ASIO_CHECK(ec3 == asio::error::eof);
ASIO_CHECK(s4 == "zyxwvutsrqponmlkjihgfedcba");
ctx.restart();
ctx.run();
ASIO_CHECK(!ec2);
}
void buffered_channel_test()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx, 1);
ASIO_CHECK(ch1.is_open());
ASIO_CHECK(!ch1.ready());
bool b1 = ch1.try_send(asio::error::eof, "hello");
ASIO_CHECK(b1);
std::string s1 = "abcdefghijklmnopqrstuvwxyz";
bool b2 = ch1.try_send(asio::error::eof, std::move(s1));
ASIO_CHECK(!b2);
ASIO_CHECK(!s1.empty());
asio::error_code ec1;
std::string s2;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec1 = ec;
s2 = std::move(s);
});
ctx.run();
ASIO_CHECK(ec1 == asio::error::eof);
ASIO_CHECK(s2 == "hello");
bool b4 = ch1.try_receive([](asio::error_code, std::string){});
ASIO_CHECK(!b4);
asio::error_code ec2 = asio::error::would_block;
std::string s3 = "zyxwvutsrqponmlkjihgfedcba";
ch1.async_send(asio::error::eof, std::move(s3),
[&](asio::error_code ec)
{
ec2 = ec;
});
asio::error_code ec3;
std::string s4;
bool b5 = ch1.try_receive(
[&](asio::error_code ec, std::string s)
{
ec3 = ec;
s4 = s;
});
ASIO_CHECK(b5);
ASIO_CHECK(ec3 == asio::error::eof);
ASIO_CHECK(s4 == "zyxwvutsrqponmlkjihgfedcba");
ctx.restart();
ctx.run();
ASIO_CHECK(!ec2);
bool b6 = ch1.try_send(asio::error_code(), "goodbye");
ASIO_CHECK(b6);
ch1.close();
asio::error_code ec4;
std::string s5;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec4 = ec;
s5 = std::move(s);
});
ctx.restart();
ctx.run();
ASIO_CHECK(!ec4);
ASIO_CHECK(s5 == "goodbye");
asio::error_code ec5;
std::string s6;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec5 = ec;
s6 = std::move(s);
});
ctx.restart();
ctx.run();
ASIO_CHECK(ec5 == asio::experimental::channel_errc::channel_closed);
ASIO_CHECK(s6.empty());
}
void buffered_error_channel_test()
{
io_context ctx;
channel<void(asio::error_code)> ch1(ctx, 1);
ASIO_CHECK(ch1.is_open());
ASIO_CHECK(!ch1.ready());
bool b1 = ch1.try_send(asio::error::eof);
ASIO_CHECK(b1);
bool b2 = ch1.try_send(asio::error::eof);
ASIO_CHECK(!b2);
asio::error_code ec1;
ch1.async_receive(
[&](asio::error_code ec)
{
ec1 = ec;
});
ctx.run();
ASIO_CHECK(ec1 == asio::error::eof);
bool b4 = ch1.try_receive([](asio::error_code){});
ASIO_CHECK(!b4);
asio::error_code ec2 = asio::error::would_block;
ch1.async_send(asio::error::eof,
[&](asio::error_code ec)
{
ec2 = ec;
});
asio::error_code ec3;
bool b5 = ch1.try_receive(
[&](asio::error_code ec)
{
ec3 = ec;
});
ASIO_CHECK(b5);
ASIO_CHECK(ec3 == asio::error::eof);
ctx.restart();
ctx.run();
ASIO_CHECK(!ec2);
}
void unbuffered_non_immediate_receive()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx);
asio::error_code ec1 = asio::error::would_block;
std::string s1 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s1),
[&](asio::error_code ec)
{
ec1 = ec;
});
ASIO_CHECK(ec1 == asio::error::would_block);
asio::error_code ec2 = asio::error::would_block;
std::string s2;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec2 = ec;
s2 = std::move(s);
});
ASIO_CHECK(ec2 == asio::error::would_block);
ctx.run();
ASIO_CHECK(!ec1);
ASIO_CHECK(ec2 == asio::error::eof);
ASIO_CHECK(s2 == "0123456789");
}
void unbuffered_immediate_receive()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx);
asio::error_code ec1 = asio::error::would_block;
std::string s1 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s1),
[&](asio::error_code ec)
{
ec1 = ec;
});
ASIO_CHECK(ec1 == asio::error::would_block);
asio::error_code ec2 = asio::error::would_block;
std::string s2;
ch1.async_receive(
bind_immediate_executor(system_executor(),
[&](asio::error_code ec, std::string s)
{
ec2 = ec;
s2 = std::move(s);
}));
ASIO_CHECK(ec1 == asio::error::would_block);
ASIO_CHECK(ec2 == asio::error::eof);
ASIO_CHECK(s2 == "0123456789");
ctx.run();
ASIO_CHECK(!ec1);
}
void unbuffered_executor_receive()
{
io_context ctx;
io_context ctx2;
channel<void(asio::error_code, std::string)> ch1(ctx);
asio::error_code ec1 = asio::error::would_block;
std::string s1 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s1),
[&](asio::error_code ec)
{
ec1 = ec;
});
ASIO_CHECK(ec1 == asio::error::would_block);
asio::error_code ec2 = asio::error::would_block;
std::string s2;
ch1.async_receive(
bind_executor(ctx2,
[&](asio::error_code ec, std::string s)
{
ec2 = ec;
s2 = std::move(s);
}));
ASIO_CHECK(ec1 == asio::error::would_block);
ASIO_CHECK(ec2 == asio::error::would_block);
ctx.run();
ASIO_CHECK(!ec1);
ASIO_CHECK(ec2 == asio::error::would_block);
ctx2.run();
ASIO_CHECK(ec2 == asio::error::eof);
ASIO_CHECK(s2 == "0123456789");
}
void unbuffered_non_immediate_send()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx);
asio::error_code ec1 = asio::error::would_block;
std::string s1;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec1 = ec;
s1 = std::move(s);
});
ASIO_CHECK(ec1 == asio::error::would_block);
asio::error_code ec2 = asio::error::would_block;
std::string s2 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s2),
[&](asio::error_code ec)
{
ec2 = ec;
});
ASIO_CHECK(ec2 == asio::error::would_block);
ctx.run();
ASIO_CHECK(ec1 == asio::error::eof);
ASIO_CHECK(s1 == "0123456789");
ASIO_CHECK(!ec2);
}
void unbuffered_immediate_send()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx);
asio::error_code ec1 = asio::error::would_block;
std::string s1;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec1 = ec;
s1 = std::move(s);
});
ASIO_CHECK(ec1 == asio::error::would_block);
asio::error_code ec2 = asio::error::would_block;
std::string s2 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s2),
bind_immediate_executor(system_executor(),
[&](asio::error_code ec)
{
ec2 = ec;
}));
ASIO_CHECK(ec1 == asio::error::would_block);
ASIO_CHECK(!ec2);
ctx.run();
ASIO_CHECK(ec1 == asio::error::eof);
ASIO_CHECK(s1 == "0123456789");
}
void unbuffered_executor_send()
{
io_context ctx;
io_context ctx2;
channel<void(asio::error_code, std::string)> ch1(ctx);
asio::error_code ec1 = asio::error::would_block;
std::string s1;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec1 = ec;
s1 = std::move(s);
});
ASIO_CHECK(ec1 == asio::error::would_block);
asio::error_code ec2 = asio::error::would_block;
std::string s2 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s2),
bind_executor(ctx2,
[&](asio::error_code ec)
{
ec2 = ec;
}));
ASIO_CHECK(ec1 == asio::error::would_block);
ASIO_CHECK(ec2 == asio::error::would_block);
ctx.run();
ASIO_CHECK(ec1 == asio::error::eof);
ASIO_CHECK(s1 == "0123456789");
ASIO_CHECK(ec2 == asio::error::would_block);
ctx2.run();
ASIO_CHECK(!ec2);
}
void buffered_non_immediate_receive()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx, 1);
asio::error_code ec1 = asio::error::would_block;
std::string s1 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s1),
[&](asio::error_code ec)
{
ec1 = ec;
});
ASIO_CHECK(ec1 == asio::error::would_block);
ctx.run();
ASIO_CHECK(!ec1);
asio::error_code ec2 = asio::error::would_block;
std::string s2;
ch1.async_receive(
[&](asio::error_code ec, std::string s)
{
ec2 = ec;
s2 = std::move(s);
});
ASIO_CHECK(ec2 == asio::error::would_block);
ctx.restart();
ctx.run();
ASIO_CHECK(ec2 == asio::error::eof);
ASIO_CHECK(s2 == "0123456789");
}
void buffered_immediate_receive()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx, 1);
asio::error_code ec1 = asio::error::would_block;
std::string s1 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s1),
[&](asio::error_code ec)
{
ec1 = ec;
});
ASIO_CHECK(ec1 == asio::error::would_block);
ctx.run();
ASIO_CHECK(!ec1);
asio::error_code ec2 = asio::error::would_block;
std::string s2;
ch1.async_receive(
bind_immediate_executor(system_executor(),
[&](asio::error_code ec, std::string s)
{
ec2 = ec;
s2 = std::move(s);
}));
ASIO_CHECK(ec2 == asio::error::eof);
ASIO_CHECK(s2 == "0123456789");
ctx.restart();
ctx.run();
}
void buffered_executor_receive()
{
io_context ctx;
io_context ctx2;
channel<void(asio::error_code, std::string)> ch1(ctx, 1);
asio::error_code ec1 = asio::error::would_block;
std::string s1 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s1),
[&](asio::error_code ec)
{
ec1 = ec;
});
ASIO_CHECK(ec1 == asio::error::would_block);
ctx.run();
ASIO_CHECK(!ec1);
asio::error_code ec2 = asio::error::would_block;
std::string s2;
ch1.async_receive(
bind_executor(ctx2,
[&](asio::error_code ec, std::string s)
{
ec2 = ec;
s2 = std::move(s);
}));
ASIO_CHECK(ec2 == asio::error::would_block);
ctx.restart();
ctx.run();
ASIO_CHECK(ec2 == asio::error::would_block);
ctx2.run();
ASIO_CHECK(ec2 == asio::error::eof);
ASIO_CHECK(s2 == "0123456789");
}
void buffered_non_immediate_send()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx, 1);
asio::error_code ec1 = asio::error::would_block;
std::string s1 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s1),
[&](asio::error_code ec)
{
ec1 = ec;
});
ASIO_CHECK(ec1 == asio::error::would_block);
ctx.run();
ASIO_CHECK(!ec1);
}
void buffered_immediate_send()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx, 1);
asio::error_code ec1 = asio::error::would_block;
std::string s1 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s1),
bind_immediate_executor(system_executor(),
[&](asio::error_code ec)
{
ec1 = ec;
}));
ASIO_CHECK(!ec1);
ctx.run();
}
void buffered_executor_send()
{
io_context ctx;
io_context ctx2;
channel<void(asio::error_code, std::string)> ch1(ctx, 1);
asio::error_code ec1 = asio::error::would_block;
std::string s1 = "0123456789";
ch1.async_send(asio::error::eof, std::move(s1),
bind_executor(ctx2,
[&](asio::error_code ec)
{
ec1 = ec;
}));
ASIO_CHECK(ec1 == asio::error::would_block);
ctx.run();
ASIO_CHECK(ec1 == asio::error::would_block);
ctx2.run();
ASIO_CHECK(!ec1);
}
void try_send_via_dispatch()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx);
asio::error_code ec1 = asio::error::would_block;
std::string s1;
ch1.async_receive(
bind_executor(asio::system_executor(),
[&](asio::error_code ec, std::string s)
{
ec1 = ec;
s1 = std::move(s);
}));
ASIO_CHECK(ec1 == asio::error::would_block);
ctx.poll();
ASIO_CHECK(ec1 == asio::error::would_block);
std::string s2 = "0123456789";
ch1.try_send_via_dispatch(asio::error::eof, std::move(s2));
ASIO_CHECK(ec1 == asio::error::eof);
ASIO_CHECK(s1 == "0123456789");
ASIO_CHECK(s2.empty());
}
void try_send_n_via_dispatch()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx);
asio::error_code ec1 = asio::error::would_block;
std::string s1;
ch1.async_receive(
bind_executor(asio::system_executor(),
[&](asio::error_code ec, std::string s)
{
ec1 = ec;
s1 = std::move(s);
}));
ASIO_CHECK(ec1 == asio::error::would_block);
asio::error_code ec2 = asio::error::would_block;
std::string s2;
ch1.async_receive(
bind_executor(asio::system_executor(),
[&](asio::error_code ec, std::string s)
{
ec2 = ec;
s2 = std::move(s);
}));
ASIO_CHECK(ec1 == asio::error::would_block);
ctx.poll();
ASIO_CHECK(ec1 == asio::error::would_block);
ASIO_CHECK(ec2 == asio::error::would_block);
std::string s3 = "0123456789";
ch1.try_send_n_via_dispatch(2, asio::error::eof, std::move(s3));
ASIO_CHECK(ec1 == asio::error::eof);
ASIO_CHECK(s1 == "0123456789");
ASIO_CHECK(ec2 == asio::error::eof);
ASIO_CHECK(s2 == "0123456789");
ASIO_CHECK(s3.empty());
}
struct multi_signature_handler
{
std::string* s_;
asio::error_code* ec_;
void operator()(std::string s)
{
*s_ = s;
}
void operator()(asio::error_code ec)
{
*ec_ = ec;
}
};
void implicit_error_signature_channel_test()
{
io_context ctx;
channel<void(std::string)> ch1(ctx);
ASIO_CHECK(ch1.is_open());
ASIO_CHECK(!ch1.ready());
bool b1 = ch1.try_send("hello");
ASIO_CHECK(!b1);
std::string s1 = "abcdefghijklmnopqrstuvwxyz";
bool b2 = ch1.try_send(std::move(s1));
ASIO_CHECK(!b2);
ASIO_CHECK(!s1.empty());
std::string s2;
asio::error_code ec1 = asio::error::would_block;
multi_signature_handler h1 = {&s2, &ec1};
ch1.async_receive(h1);
bool b3 = ch1.try_send(std::move(s1));
ASIO_CHECK(b3);
ASIO_CHECK(s1.empty());
ctx.run();
ASIO_CHECK(s2 == "abcdefghijklmnopqrstuvwxyz");
ASIO_CHECK(ec1 == asio::error::would_block);
std::string s3;
asio::error_code ec2;
multi_signature_handler h2 = {&s3, &ec2};
bool b4 = ch1.try_receive(h2);
ASIO_CHECK(!b4);
std::string s4 = "zyxwvutsrqponmlkjihgfedcba";
asio::error_code ec3;
ch1.async_send(std::move(s4),
[&](asio::error_code ec)
{
ec3 = ec;
});
std::string s5;
asio::error_code ec4 = asio::error::would_block;
multi_signature_handler h3 = {&s5, &ec4};
bool b5 = ch1.try_receive(h3);
ASIO_CHECK(b5);
ASIO_CHECK(ec4 == asio::error::would_block);
ASIO_CHECK(s5 == "zyxwvutsrqponmlkjihgfedcba");
ctx.restart();
ctx.run();
ASIO_CHECK(!ec3);
std::string s6;
asio::error_code ec5 = asio::error::would_block;
multi_signature_handler h4 = {&s6, &ec5};
ch1.async_receive(h4);
ch1.close();
ctx.restart();
ctx.run();
ASIO_CHECK(s6.empty());
ASIO_CHECK(ec5 == asio::experimental::channel_errc::channel_closed);
}
void channel_with_any_completion_handler_test()
{
io_context ctx;
channel<void(asio::error_code, std::string)> ch1(ctx);
asio::error_code ec1 = asio::error::would_block;
std::string s1;
ch1.async_receive(
asio::any_completion_handler<
void(asio::error_code, std::string)>(
[&](asio::error_code ec, std::string s)
{
ec1 = ec;
s1 = std::move(s);
}));
asio::error_code ec2 = asio::error::would_block;
std::string s2 = "zyxwvutsrqponmlkjihgfedcba";
ch1.async_send(asio::error::eof, std::move(s2),
asio::any_completion_handler<void(asio::error_code)>(
[&](asio::error_code ec)
{
ec2 = ec;
}));
ASIO_CHECK(ec1 == asio::error::would_block);
ASIO_CHECK(ec2 == asio::error::would_block);
ctx.run();
ASIO_CHECK(ec1 == asio::error::eof);
ASIO_CHECK(s1 == "zyxwvutsrqponmlkjihgfedcba");
ASIO_CHECK(!ec2);
}
ASIO_TEST_SUITE
(
"experimental/channel",
ASIO_TEST_CASE(unbuffered_channel_test)
ASIO_TEST_CASE(buffered_channel_test)
ASIO_TEST_CASE(buffered_error_channel_test)
ASIO_TEST_CASE(unbuffered_non_immediate_receive)
ASIO_TEST_CASE(unbuffered_immediate_receive)
ASIO_TEST_CASE(unbuffered_executor_receive)
ASIO_TEST_CASE(unbuffered_non_immediate_send)
ASIO_TEST_CASE(unbuffered_immediate_send)
ASIO_TEST_CASE(unbuffered_executor_send)
ASIO_TEST_CASE(buffered_non_immediate_receive)
ASIO_TEST_CASE(buffered_immediate_receive)
ASIO_TEST_CASE(buffered_executor_receive)
ASIO_TEST_CASE(buffered_non_immediate_send)
ASIO_TEST_CASE(buffered_immediate_send)
ASIO_TEST_CASE(buffered_executor_send)
ASIO_TEST_CASE(try_send_via_dispatch)
ASIO_TEST_CASE(try_send_n_via_dispatch)
ASIO_TEST_CASE(implicit_error_signature_channel_test)
ASIO_TEST_CASE(channel_with_any_completion_handler_test)
)
|
0 | repos/asio/asio/src/tests/unit/experimental | repos/asio/asio/src/tests/unit/experimental/coro/cancel.cpp | //
// experimental/coro/cancel.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2023 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/coro.hpp"
#include <iostream>
#include "asio/bind_cancellation_slot.hpp"
#include "asio/io_context.hpp"
#include "asio/steady_timer.hpp"
#include "asio/this_coro.hpp"
#include "../../unit_test.hpp"
using namespace asio::experimental;
namespace this_coro = asio::this_coro;
namespace coro {
auto coro_simple_cancel_impl(asio::io_context& ) noexcept
-> asio::experimental::coro<void() noexcept, asio::error_code>
{
ASIO_CHECK(
!(co_await this_coro::cancellation_state).cancelled());
asio::steady_timer timer{
co_await this_coro::executor,
std::chrono::seconds(1)};
ASIO_CHECK(
!(co_await this_coro::cancellation_state).cancelled());
auto ec = co_await timer;
ASIO_CHECK(
(co_await this_coro::cancellation_state).cancelled());
co_return ec;
}
void coro_simple_cancel()
{
asio::io_context ctx;
asio::cancellation_signal sig;
auto k = coro_simple_cancel_impl(ctx);
asio::error_code res_ec;
k.async_resume(
asio::bind_cancellation_slot(sig.slot(),
[&](asio::error_code ec) {res_ec = ec;}));
asio::post(ctx, [&]{sig.emit(asio::cancellation_type::all);});
ASIO_CHECK(!res_ec);
ctx.run();
ASIO_CHECK(res_ec == asio::error::operation_aborted);
}
auto coro_throw_cancel_impl(asio::io_context& )
-> asio::experimental::coro<void() , void>
{
asio::steady_timer timer{
co_await this_coro::executor,
std::chrono::seconds(1)};
co_await timer;
}
void coro_throw_cancel()
{
asio::io_context ctx;
asio::cancellation_signal sig;
auto k = coro_throw_cancel_impl(ctx);
std::exception_ptr res_ex;
k.async_resume(
asio::bind_cancellation_slot(sig.slot(),
[&](std::exception_ptr ex) {res_ex = ex;}));
asio::post(ctx, [&]{sig.emit(asio::cancellation_type::all);});
ASIO_CHECK(!res_ex);
ctx.run();
ASIO_CHECK(res_ex);
try
{
if (res_ex)
std::rethrow_exception(res_ex);
}
catch (asio::system_error& se)
{
ASIO_CHECK(se.code() == asio::error::operation_aborted);
}
}
auto coro_simple_cancel_nested_k(asio::io_context&, int& cnt) noexcept
-> asio::experimental::coro<
void() noexcept,
asio::error_code>
{
asio::steady_timer timer{
co_await this_coro::executor,
std::chrono::milliseconds(100)};
ASIO_CHECK(!(co_await this_coro::cancellation_state).cancelled());
auto ec = co_await timer;
cnt++;
ASIO_CHECK((co_await this_coro::cancellation_state).cancelled());
co_return ec;
}
auto coro_simple_cancel_nested_kouter(
asio::io_context& ctx, int& cnt) noexcept
-> asio::experimental::coro<
asio::error_code() noexcept,
asio::error_code>
{
ASIO_CHECK(cnt == 0);
co_yield co_await coro_simple_cancel_nested_k(ctx, cnt);
ASIO_CHECK(cnt == 1);
auto ec = co_await coro_simple_cancel_nested_k(ctx, cnt);
ASIO_CHECK(cnt == 2);
co_return ec;
}
void coro_simple_cancel_nested()
{
asio::io_context ctx;
asio::cancellation_signal sig;
int cnt = 0;
auto kouter = coro_simple_cancel_nested_kouter(ctx, cnt);
asio::error_code res_ec;
kouter.async_resume(
asio::bind_cancellation_slot(sig.slot(),
[&](asio::error_code ec) {res_ec = ec;}));
asio::post(ctx, [&]{sig.emit(asio::cancellation_type::all);});
ASIO_CHECK(!res_ec);
ctx.run();
ASIO_CHECK(res_ec == asio::error::operation_aborted);
ctx.restart();
res_ec = {};
kouter.async_resume(
asio::bind_cancellation_slot(sig.slot(),
[&](asio::error_code ec) {res_ec = ec;}));
asio::post(ctx, [&]{sig.emit(asio::cancellation_type::all);});
ASIO_CHECK(!res_ec);
ctx.run();
ASIO_CHECK(res_ec == asio::error::operation_aborted);
ASIO_CHECK(cnt == 2);
}
} // namespace coro
ASIO_TEST_SUITE
(
"coro/cancel",
ASIO_TEST_CASE(::coro::coro_simple_cancel)
ASIO_TEST_CASE(::coro::coro_throw_cancel)
ASIO_TEST_CASE(::coro::coro_simple_cancel_nested)
)
|
0 | repos/asio/asio/src/tests/unit/experimental | repos/asio/asio/src/tests/unit/experimental/coro/co_spawn.cpp | //
// experimental/coro/co_spawn.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2023 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/co_spawn.hpp"
#include <iostream>
#include "asio/io_context.hpp"
#include "asio/steady_timer.hpp"
#include "asio/this_coro.hpp"
#include "../../unit_test.hpp"
using namespace asio::experimental;
namespace this_coro = asio::this_coro;
namespace coro {
auto coro_simple_co_spawn_impl(asio::io_context& , bool &done) noexcept
-> asio::experimental::coro<void() noexcept, int>
{
asio::steady_timer timer(
co_await this_coro::executor,
std::chrono::milliseconds(10));
done = true;
co_return 42;
}
void coro_co_spawn()
{
asio::io_context ctx;
bool done1 = false;
bool done2 = false;
int res = 0;
co_spawn(coro_simple_co_spawn_impl(ctx, done1),
[&](int r){done2= true; res = r;});
ctx.run();
ASIO_CHECK(done1);
ASIO_CHECK(done2);
ASIO_CHECK(res == 42);
}
} // namespace coro
ASIO_TEST_SUITE
(
"coro/co_spawn",
ASIO_TEST_CASE(::coro::coro_co_spawn)
)
|
0 | repos/asio/asio/src/tests/unit/experimental | repos/asio/asio/src/tests/unit/experimental/coro/stack_test.cpp | //
// experimental/coro/stack_test.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2023 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/coro.hpp"
#include "asio/detached.hpp"
#include "asio/io_context.hpp"
#include <iostream>
#include "../../unit_test.hpp"
using namespace asio::experimental;
namespace coro {
asio::experimental::coro<int()>
stack_generator(asio::any_io_executor, int i = 1)
{
for (;;)
{
co_yield i;
i *= 2;
}
}
asio::experimental::coro<int(int)>
stack_accumulate(asio::any_io_executor exec)
{
auto gen = stack_generator(exec);
int offset = 0;
while (auto next = co_await gen) // 1, 2, 4, 8, ...
offset = co_yield *next + offset; // offset is delayed by one cycle
}
asio::experimental::coro<int>
main_stack_coro(asio::io_context&, bool & done)
{
auto g = stack_accumulate(co_await asio::this_coro::executor);
ASIO_CHECK(g.is_open());
ASIO_CHECK(1 == (co_await g(1000)).value_or(-1));
ASIO_CHECK(2002 == (co_await g(2000)).value_or(-1));
ASIO_CHECK(3004 == (co_await g(3000)).value_or(-1));
ASIO_CHECK(4008 == (co_await g(4000)).value_or(-1));
ASIO_CHECK(5016 == (co_await g(5000)).value_or(-1));
ASIO_CHECK(6032 == (co_await g(6000)).value_or(-1));
ASIO_CHECK(7064 == (co_await g(7000)).value_or(-1));
ASIO_CHECK(8128 == (co_await g(8000)).value_or(-1));
ASIO_CHECK(9256 == (co_await g(9000)).value_or(-1));
ASIO_CHECK(511 == (co_await g(-1)).value_or(-1));
done = true;
}
void stack_test()
{
bool done = false;
asio::io_context ctx;
auto k = main_stack_coro(ctx, done);
k.async_resume(asio::detached);
ctx.run();
ASIO_CHECK(done);
}
} // namespace coro
ASIO_TEST_SUITE
(
"coro/stack_test",
ASIO_TEST_CASE(::coro::stack_test)
)
|
0 | repos/asio/asio/src/tests/unit/experimental | repos/asio/asio/src/tests/unit/experimental/coro/exception.cpp | //
// experimental/coro/exception.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2023 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/coro.hpp"
#include "asio/co_spawn.hpp"
#include "asio/detached.hpp"
#include "asio/io_context.hpp"
#include "asio/use_awaitable.hpp"
#include "asio/awaitable.hpp"
#include "../../unit_test.hpp"
using namespace asio::experimental;
namespace coro {
template <typename Func>
struct on_scope_exit
{
Func func;
static_assert(noexcept(func()));
on_scope_exit(const Func &f)
: func(static_cast< Func && >(f))
{
}
on_scope_exit(Func &&f)
: func(f)
{
}
on_scope_exit(const on_scope_exit &) = delete;
~on_scope_exit()
{
func();
}
};
asio::experimental::coro<int> throwing_generator(
asio::any_io_executor, int &last, bool &destroyed)
{
on_scope_exit x = [&]() noexcept { destroyed = true; };
(void)x;
int i = 0;
while (i < 3)
{
last = ++i;
co_yield last;
}
throw std::runtime_error("throwing-generator");
}
asio::awaitable<void> throwing_generator_test()
{
int val = 0;
bool destr = false;
{
auto gi = throwing_generator(
co_await asio::this_coro::executor,
val, destr);
bool caught = false;
try
{
for (int i = 0; i < 10; i++)
{
ASIO_CHECK(val == i);
const auto next = co_await gi.async_resume(asio::use_awaitable);
ASIO_CHECK(next);
ASIO_CHECK(val == *next);
ASIO_CHECK(val == i + 1);
}
}
catch (std::runtime_error &err)
{
caught = true;
using std::operator ""sv;
ASIO_CHECK(err.what() == "throwing-generator"sv);
}
ASIO_CHECK(val == 3);
ASIO_CHECK(caught);
}
ASIO_CHECK(destr);
};
void run_throwing_generator_test()
{
asio::io_context ctx;
asio::co_spawn(ctx, throwing_generator_test(), asio::detached);
ctx.run();
}
asio::experimental::coro<int(int)> throwing_stacked(
asio::any_io_executor exec, int &val,
bool &destroyed_inner, bool &destroyed)
{
ASIO_CHECK((co_await asio::this_coro::throw_if_cancelled()));
on_scope_exit x = [&]() noexcept { destroyed = true; };
(void)x;
auto gen = throwing_generator(exec, val, destroyed_inner);
while (auto next = co_await gen) // 1, 2, 4, 8, ...
ASIO_CHECK(42 ==(co_yield *next)); // offset is delayed by one cycle
}
asio::awaitable<void> throwing_generator_stacked_test()
{
int val = 0;
bool destr = false, destr_inner = false;
{
auto gi = throwing_stacked(
co_await asio::this_coro::executor,
val, destr, destr_inner);
bool caught = false;
try
{
for (int i = 0; i < 10; i++)
{
ASIO_CHECK(val == i);
const auto next =
co_await gi.async_resume(42, asio::use_awaitable);
ASIO_CHECK(next);
ASIO_CHECK(val == *next);
ASIO_CHECK(val == i + 1);
}
}
catch (std::runtime_error &err)
{
caught = true;
using std::operator ""sv;
ASIO_CHECK(err.what() == "throwing-generator"sv);
}
ASIO_CHECK(val == 3);
ASIO_CHECK(caught);
}
ASIO_CHECK(destr);
ASIO_CHECK(destr_inner);
};
void run_throwing_generator_stacked_test()
{
asio::io_context ctx;
asio::co_spawn(ctx,
throwing_generator_stacked_test,
asio::detached);
ctx.run();
}
} // namespace coro
ASIO_TEST_SUITE
(
"coro/exception",
ASIO_TEST_CASE(::coro::run_throwing_generator_stacked_test)
ASIO_TEST_CASE(::coro::run_throwing_generator_test)
)
|
0 | repos/asio/asio/src/tests/unit/experimental | repos/asio/asio/src/tests/unit/experimental/coro/simple_test.cpp | //
// experimental/coro/simple_test.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2023 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/coro.hpp"
#include "asio/co_spawn.hpp"
#include "asio/detached.hpp"
#include "asio/io_context.hpp"
#include "asio/use_awaitable.hpp"
#include <iostream>
#include <vector>
#include "../../unit_test.hpp"
using namespace asio::experimental;
namespace asio {
namespace experimental {
template struct coro<void(), void, any_io_executor>;
template struct coro<int(), void, any_io_executor>;
template struct coro<void(), int, any_io_executor>;
template struct coro<int(int), void, any_io_executor>;
template struct coro<int(), int, any_io_executor>;
template struct coro<int(int), int, any_io_executor>;
template struct coro<void() noexcept, void, any_io_executor>;
template struct coro<int() noexcept, void, any_io_executor>;
template struct coro<void() noexcept, int, any_io_executor>;
template struct coro<int(int) noexcept, void, any_io_executor>;
template struct coro<int() noexcept, int, any_io_executor>;
template struct coro<int(int) noexcept, int, any_io_executor>;
} // namespace experimental
} // namespace asio
namespace coro {
template <typename Func>
struct on_scope_exit
{
Func func;
static_assert(noexcept(func()));
on_scope_exit(const Func &f)
: func(static_cast< Func && >(f))
{
}
on_scope_exit(Func &&f)
: func(f)
{
}
on_scope_exit(const on_scope_exit &) = delete;
~on_scope_exit()
{
func();
}
};
asio::experimental::coro<int> generator_impl(
asio::any_io_executor, int& last, bool& destroyed)
{
on_scope_exit x = [&]() noexcept { destroyed = true; };
(void)x;
int i = 0;
while (true)
{
last = ++i;
co_yield last;
}
}
asio::awaitable<void> generator_test()
{
int val = 0;
bool destr = false;
{
auto gi = generator_impl(
co_await asio::this_coro::executor, val, destr);
for (int i = 0; i < 10; i++)
{
ASIO_CHECK(val == i);
const auto next = co_await gi.async_resume(asio::use_awaitable);
ASIO_CHECK(next);
ASIO_CHECK(val == *next);
ASIO_CHECK(val == i + 1);
}
ASIO_CHECK(!destr);
}
ASIO_CHECK(destr);
};
void run_generator_test()
{
asio::io_context ctx;
asio::co_spawn(ctx, generator_test, asio::detached);
ctx.run();
}
asio::experimental::coro<void, int> task_test(asio::io_context&)
{
co_return 42;
}
asio::experimental::coro<void, int> task_throw(asio::io_context&)
{
throw std::logic_error(__func__);
co_return 42;
}
void run_task_test()
{
asio::io_context ctx;
bool tt1 = false;
bool tt2 = false;
bool tt3 = false;
bool tt4 = false;
auto tt = task_test(ctx);
tt.async_resume(
[&](std::exception_ptr pt, int i)
{
tt1 = true;
ASIO_CHECK(!pt);
ASIO_CHECK(i == 42);
tt.async_resume(
[&](std::exception_ptr pt, int)
{
tt2 = true;
ASIO_CHECK(pt);
});
});
auto tt_2 = task_throw(ctx);
tt_2.async_resume(
[&](std::exception_ptr pt, int)
{
tt3 = true;
ASIO_CHECK(pt);
tt.async_resume(
[&](std::exception_ptr pt, int)
{
tt4 = true;
ASIO_CHECK(pt);
});
});
ctx.run();
ASIO_CHECK(tt1);
ASIO_CHECK(tt2);
ASIO_CHECK(tt3);
ASIO_CHECK(tt4);
}
asio::experimental::coro<char> completion_generator_test_impl(
asio::any_io_executor, int limit)
{
for (int i = 0; i < limit; i++)
co_yield i;
}
asio::awaitable<void> completion_generator_test()
{
std::vector<int> res;
auto g = completion_generator_test_impl(
co_await asio::this_coro::executor, 10);
ASIO_CHECK(g.is_open());
while (auto val = co_await g.async_resume(asio::use_awaitable))
res.push_back(*val);
ASIO_CHECK(!g.is_open());
ASIO_CHECK((res == std::vector{0,1,2,3,4,5,6,7,8,9}));
}
void run_completion_generator_test()
{
asio::io_context ctx;
asio::co_spawn(ctx, completion_generator_test, asio::detached);
ctx.run();
}
asio::experimental::coro<int(int)>
symmetrical_test_impl(asio::any_io_executor)
{
int i = 0;
while (true)
i = (co_yield i) + i;
}
asio::awaitable<void> symmetrical_test()
{
auto g = symmetrical_test_impl(co_await asio::this_coro::executor);
ASIO_CHECK(g.is_open());
ASIO_CHECK(0 == (co_await g.async_resume(0,
asio::use_awaitable)).value_or(-1));
ASIO_CHECK(1 == (co_await g.async_resume(1,
asio::use_awaitable)).value_or(-1));
ASIO_CHECK(3 == (co_await g.async_resume(2,
asio::use_awaitable)).value_or(-1));
ASIO_CHECK(6 == (co_await g.async_resume(3,
asio::use_awaitable)).value_or(-1));
ASIO_CHECK(10 == (co_await g.async_resume(4,
asio::use_awaitable)).value_or(-1));
ASIO_CHECK(15 == (co_await g.async_resume(5,
asio::use_awaitable)).value_or(-1));
ASIO_CHECK(21 == (co_await g.async_resume(6,
asio::use_awaitable)).value_or(-1));
ASIO_CHECK(28 == (co_await g.async_resume(7,
asio::use_awaitable)).value_or(-1));
ASIO_CHECK(36 == (co_await g.async_resume(8,
asio::use_awaitable)).value_or(-1));
ASIO_CHECK(45 == (co_await g.async_resume(9,
asio::use_awaitable)).value_or(-1));
}
void run_symmetrical_test()
{
asio::io_context ctx;
asio::co_spawn(ctx, symmetrical_test, asio::detached);
ctx.run();
}
} // namespace coro
ASIO_TEST_SUITE
(
"coro/simple_test",
ASIO_TEST_CASE(::coro::run_generator_test)
ASIO_TEST_CASE(::coro::run_task_test)
ASIO_TEST_CASE(::coro::run_symmetrical_test)
ASIO_TEST_CASE(::coro::run_completion_generator_test)
)
|
0 | repos/asio/asio/src/tests/unit/experimental | repos/asio/asio/src/tests/unit/experimental/coro/executor.cpp | //
// experimental/coro/executor.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2023 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/coro.hpp"
#include "asio/thread_pool.hpp"
#include "asio/io_context.hpp"
#include "../../unit_test.hpp"
using namespace asio::experimental;
namespace coro {
#define ASIO_CHECKPOINT() \
ASIO_TEST_IOSTREAM << __FILE__ << "(" << __LINE__ << "): " \
<< asio::detail::test_name() << ": " \
<< "Checkpoint" << std::endl;
template <typename T>
void different_execs()
{
asio::thread_pool th_ctx{1u};
asio::io_context ctx;
auto o = std::make_optional(
asio::prefer(th_ctx.get_executor(),
asio::execution::outstanding_work.tracked));
static bool ran_inner = false, ran_outer = false;
struct c_inner_t
{
auto operator()(asio::any_io_executor e) -> asio::experimental::coro<T>
{
auto p = e.target<asio::thread_pool::executor_type>();
ASIO_CHECKPOINT();
ASIO_CHECK(p);
ASIO_CHECK(p->running_in_this_thread());
ran_inner = true;
co_return;
};
};
c_inner_t c_inner;
struct c_outer_t
{
auto operator()(asio::any_io_executor e, int,
asio::experimental::coro<T> tp)
-> asio::experimental::coro<void>
{
auto p = e.target<asio::io_context::executor_type>();
ASIO_CHECK(p);
ASIO_CHECK(p->running_in_this_thread());
ASIO_CHECKPOINT();
co_await tp;
ASIO_CHECKPOINT();
ASIO_CHECK(p->running_in_this_thread());
ran_outer = true;
};
};
c_outer_t c_outer;
bool ran = false;
std::exception_ptr ex;
auto c = c_outer(ctx.get_executor(), 10, c_inner(th_ctx.get_executor()));
c.async_resume(
[&](std::exception_ptr e)
{
ASIO_CHECK(!e);
ASIO_CHECKPOINT();
ran = true;
});
ASIO_CHECK(!ran);
ctx.run();
o.reset();
ASIO_CHECK(ran);
ASIO_CHECK(ran_inner);
ASIO_CHECK(ran_outer);
ASIO_CHECK(!ex);
th_ctx.stop();
th_ctx.join();
}
} // namespace coro
ASIO_TEST_SUITE
(
"coro/partial",
ASIO_TEST_CASE(::coro::different_execs<void>)
ASIO_TEST_CASE(::coro::different_execs<int()>)
)
|
0 | repos/asio/asio/src/tests/unit/experimental | repos/asio/asio/src/tests/unit/experimental/coro/allocator.cpp | //
// experimental/coro/partial.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2023 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/coro.hpp"
#include <vector>
#include "asio/io_context.hpp"
#include "../../unit_test.hpp"
namespace exp = asio::experimental;
namespace coro {
template<typename Value = void>
struct tracked_allocator
{
using value_type = Value;
std::vector<std::pair<void*, std::size_t>> &allocs, &deallocs;
tracked_allocator(std::vector<std::pair<void*, std::size_t>>& allocs,
std::vector<std::pair<void*, std::size_t>>& deallocs) : allocs(allocs), deallocs(deallocs) {}
template<typename T>
tracked_allocator(const tracked_allocator<T>& a) : allocs(a.allocs), deallocs(a.deallocs) {}
value_type* allocate(std::size_t n)
{
auto p = new char[n * sizeof(Value)];
allocs.emplace_back(p, n);
return reinterpret_cast<value_type*>(p);
}
void deallocate(void* p, std::size_t n)
{
deallocs.emplace_back(p, n);
delete[] static_cast<char*>(p);
// ASIO_CHECK(allocs.back() == deallocs.back());
}
bool operator==(const tracked_allocator& rhs) const
{
return &allocs == &rhs.allocs
&& &deallocs == &rhs.deallocs;
}
};
exp::coro<void, void, asio::any_io_executor, tracked_allocator<void>>
alloc_test_impl(asio::io_context& ctx, int, std::allocator_arg_t, tracked_allocator<void> ta, double)
{
co_return ;
}
void alloc_test()
{
std::vector<std::pair<void*, std::size_t>> allocs, deallocs;
asio::io_context ctx;
bool ran = false;
{
auto pp = alloc_test_impl(ctx, 42, std::allocator_arg, {allocs, deallocs}, 42.);
ASIO_CHECK(allocs.size() == 1u);
ASIO_CHECK(deallocs.empty());
pp.async_resume([&](auto e){ran = true; ASIO_CHECK(!e);});
ctx.run();
ASIO_CHECK(deallocs.size() == 0u);
}
ctx.restart();
ctx.run();
ASIO_CHECK(deallocs.size() == 1u);
ASIO_CHECK(allocs == deallocs);
ASIO_CHECK(ran);
ran = false;
auto p = asio::experimental::detail::post_coroutine(
ctx,
asio::bind_allocator(tracked_allocator{allocs, deallocs}, [&]{ran = true;})).handle;
ASIO_CHECK(allocs.size() == 2u);
ASIO_CHECK(deallocs.size() == 1u);
p.resume();
ASIO_CHECK(allocs.size() == 3u);
ASIO_CHECK(deallocs.size() == 2u);
ctx.restart();
ctx.run();
ASIO_CHECK(allocs == deallocs);
}
} // namespace coro
ASIO_TEST_SUITE
(
"coro/allocate",
ASIO_TEST_CASE(::coro::alloc_test)
)
|
0 | repos/asio/asio/src/tests/unit/experimental | repos/asio/asio/src/tests/unit/experimental/coro/use_coro.cpp | //
// experimental/coro/use_coro.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2023 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/use_coro.hpp"
#include "asio/steady_timer.hpp"
#include <iostream>
#include "../../unit_test.hpp"
using namespace asio::experimental;
namespace coro {
asio::experimental::coro<void(), int>
awaiter(asio::any_io_executor exec)
{
asio::steady_timer timer{exec};
co_await timer.async_wait(use_coro);
co_return 42;
}
asio::experimental::coro<void() noexcept, int>
awaiter_noexcept(asio::any_io_executor exec)
{
asio::steady_timer timer{exec};
auto ec = co_await timer.async_wait(asio::deferred);
ASIO_CHECK(ec == asio::error_code{});
co_return 42;
}
void stack_test2()
{
bool done = false;
asio::io_context ctx;
auto k = awaiter(ctx.get_executor());
auto k2 = awaiter_noexcept(ctx.get_executor());
k.async_resume(
[&](std::exception_ptr ex, int res)
{
ASIO_CHECK(!ex);
ASIO_CHECK(res == 42);
done = true;
});
k2.async_resume([&](int res)
{
ASIO_CHECK(res == 42);
done = true;
});
ctx.run();
ASIO_CHECK(done);
}
} // namespace coro
ASIO_TEST_SUITE
(
"coro/use_coro",
ASIO_TEST_CASE(::coro::stack_test2)
)
|
0 | repos/asio/asio/src/tests/unit/experimental | repos/asio/asio/src/tests/unit/experimental/coro/partial.cpp | //
// experimental/coro/partial.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2021-2023 Klemens D. Morgenstern
// (klemens dot morgenstern at gmx dot net)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/experimental/coro.hpp"
#include "asio/io_context.hpp"
#include "../../unit_test.hpp"
using namespace asio::experimental;
namespace coro {
void partial()
{
asio::io_context ctx;
bool ran = false;
auto p = detail::post_coroutine(ctx, [&]{ran = true;}).handle;
ASIO_CHECK(!ran);
p.resume();
ASIO_CHECK(!ran);
ctx.run();
ASIO_CHECK(ran);
}
} // namespace coro
ASIO_TEST_SUITE
(
"coro/partial",
ASIO_TEST_CASE(::coro::partial)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/local/datagram_protocol.cpp | //
// datagram_protocol.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/local/datagram_protocol.hpp"
#include <cstring>
#include "asio/io_context.hpp"
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
// local_datagram_protocol_socket_compile test
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// The following test checks that all public member functions on the class
// local::datagram_socket::socket compile and link correctly. Runtime failures
// are ignored.
namespace local_datagram_protocol_socket_compile {
void connect_handler(const asio::error_code&)
{
}
void send_handler(const asio::error_code&, std::size_t)
{
}
void receive_handler(const asio::error_code&, std::size_t)
{
}
void test()
{
#if defined(ASIO_HAS_LOCAL_SOCKETS)
using namespace asio;
namespace local = asio::local;
typedef local::datagram_protocol dp;
try
{
io_context ioc;
const io_context::executor_type ioc_ex = ioc.get_executor();
char mutable_char_buffer[128] = "";
const char const_char_buffer[128] = "";
socket_base::message_flags in_flags = 0;
socket_base::send_buffer_size socket_option;
socket_base::bytes_readable io_control_command;
asio::error_code ec;
// basic_datagram_socket constructors.
dp::socket socket1(ioc);
dp::socket socket2(ioc, dp());
dp::socket socket3(ioc, dp::endpoint(""));
int native_socket1 = ::socket(AF_UNIX, SOCK_DGRAM, 0);
dp::socket socket4(ioc, dp(), native_socket1);
dp::socket socket5(ioc_ex);
dp::socket socket6(ioc_ex, dp());
dp::socket socket7(ioc_ex, dp::endpoint(""));
int native_socket2 = ::socket(AF_UNIX, SOCK_DGRAM, 0);
dp::socket socket8(ioc_ex, dp(), native_socket2);
// basic_io_object functions.
dp::socket::executor_type ex = socket1.get_executor();
(void)ex;
// basic_socket functions.
dp::socket::lowest_layer_type& lowest_layer = socket1.lowest_layer();
(void)lowest_layer;
socket1.open(dp());
socket1.open(dp(), ec);
int native_socket3 = ::socket(AF_UNIX, SOCK_DGRAM, 0);
socket1.assign(dp(), native_socket3);
int native_socket4 = ::socket(AF_UNIX, SOCK_DGRAM, 0);
socket1.assign(dp(), native_socket4, ec);
bool is_open = socket1.is_open();
(void)is_open;
socket1.close();
socket1.close(ec);
dp::socket::native_handle_type native_socket5 = socket1.native_handle();
(void)native_socket5;
socket1.cancel();
socket1.cancel(ec);
bool at_mark1 = socket1.at_mark();
(void)at_mark1;
bool at_mark2 = socket1.at_mark(ec);
(void)at_mark2;
std::size_t available1 = socket1.available();
(void)available1;
std::size_t available2 = socket1.available(ec);
(void)available2;
socket1.bind(dp::endpoint(""));
socket1.bind(dp::endpoint(""), ec);
socket1.connect(dp::endpoint(""));
socket1.connect(dp::endpoint(""), ec);
socket1.async_connect(dp::endpoint(""), connect_handler);
socket1.set_option(socket_option);
socket1.set_option(socket_option, ec);
socket1.get_option(socket_option);
socket1.get_option(socket_option, ec);
socket1.io_control(io_control_command);
socket1.io_control(io_control_command, ec);
dp::endpoint endpoint1 = socket1.local_endpoint();
(void)endpoint1;
dp::endpoint endpoint2 = socket1.local_endpoint(ec);
(void)endpoint2;
dp::endpoint endpoint3 = socket1.remote_endpoint();
(void)endpoint3;
dp::endpoint endpoint4 = socket1.remote_endpoint(ec);
(void)endpoint4;
socket1.shutdown(socket_base::shutdown_both);
socket1.shutdown(socket_base::shutdown_both, ec);
// basic_datagram_socket functions.
socket1.send(buffer(mutable_char_buffer));
socket1.send(buffer(const_char_buffer));
socket1.send(null_buffers());
socket1.send(buffer(mutable_char_buffer), in_flags);
socket1.send(buffer(const_char_buffer), in_flags);
socket1.send(null_buffers(), in_flags);
socket1.send(buffer(mutable_char_buffer), in_flags, ec);
socket1.send(buffer(const_char_buffer), in_flags, ec);
socket1.send(null_buffers(), in_flags, ec);
socket1.async_send(buffer(mutable_char_buffer), send_handler);
socket1.async_send(buffer(const_char_buffer), send_handler);
socket1.async_send(null_buffers(), send_handler);
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
socket1.async_send(null_buffers(), in_flags, send_handler);
socket1.send_to(buffer(mutable_char_buffer),
dp::endpoint(""));
socket1.send_to(buffer(const_char_buffer),
dp::endpoint(""));
socket1.send_to(null_buffers(),
dp::endpoint(""));
socket1.send_to(buffer(mutable_char_buffer),
dp::endpoint(""), in_flags);
socket1.send_to(buffer(const_char_buffer),
dp::endpoint(""), in_flags);
socket1.send_to(null_buffers(),
dp::endpoint(""), in_flags);
socket1.send_to(buffer(mutable_char_buffer),
dp::endpoint(""), in_flags, ec);
socket1.send_to(buffer(const_char_buffer),
dp::endpoint(""), in_flags, ec);
socket1.send_to(null_buffers(),
dp::endpoint(""), in_flags, ec);
socket1.async_send_to(buffer(mutable_char_buffer),
dp::endpoint(""), send_handler);
socket1.async_send_to(buffer(const_char_buffer),
dp::endpoint(""), send_handler);
socket1.async_send_to(null_buffers(),
dp::endpoint(""), send_handler);
socket1.async_send_to(buffer(mutable_char_buffer),
dp::endpoint(""), in_flags, send_handler);
socket1.async_send_to(buffer(const_char_buffer),
dp::endpoint(""), in_flags, send_handler);
socket1.async_send_to(null_buffers(),
dp::endpoint(""), in_flags, send_handler);
socket1.receive(buffer(mutable_char_buffer));
socket1.receive(null_buffers());
socket1.receive(buffer(mutable_char_buffer), in_flags);
socket1.receive(null_buffers(), in_flags);
socket1.receive(buffer(mutable_char_buffer), in_flags, ec);
socket1.receive(null_buffers(), in_flags, ec);
socket1.async_receive(buffer(mutable_char_buffer), receive_handler);
socket1.async_receive(null_buffers(), receive_handler);
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
receive_handler);
socket1.async_receive(null_buffers(), in_flags, receive_handler);
dp::endpoint endpoint;
socket1.receive_from(buffer(mutable_char_buffer), endpoint);
socket1.receive_from(null_buffers(), endpoint);
socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags);
socket1.receive_from(null_buffers(), endpoint, in_flags);
socket1.receive_from(buffer(mutable_char_buffer), endpoint, in_flags, ec);
socket1.receive_from(null_buffers(), endpoint, in_flags, ec);
socket1.async_receive_from(buffer(mutable_char_buffer),
endpoint, receive_handler);
socket1.async_receive_from(null_buffers(),
endpoint, receive_handler);
socket1.async_receive_from(buffer(mutable_char_buffer),
endpoint, in_flags, receive_handler);
socket1.async_receive_from(null_buffers(),
endpoint, in_flags, receive_handler);
}
catch (std::exception&)
{
}
#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
}
} // namespace local_datagram_protocol_socket_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"local/datagram_protocol",
ASIO_COMPILE_TEST_CASE(local_datagram_protocol_socket_compile::test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/local/seq_packet_protocol.cpp | //
// local/seq_packet_protocol.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/local/seq_packet_protocol.hpp"
#include <cstring>
#include "asio/io_context.hpp"
#include "../unit_test.hpp"
#include "../archetypes/async_result.hpp"
#if defined(__cplusplus_cli) || defined(__cplusplus_winrt)
# define local cpp_local
#endif
//------------------------------------------------------------------------------
// local_seq_packet_protocol_socket_compile test
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// The following test checks that all public member functions on the class
// local::seq_packet_socket::socket compile and link correctly. Runtime
// failures are ignored.
namespace local_seq_packet_protocol_socket_compile {
void connect_handler(const asio::error_code&)
{
}
void send_handler(const asio::error_code&, std::size_t)
{
}
void receive_handler(const asio::error_code&, std::size_t)
{
}
void test()
{
using namespace asio;
namespace local = asio::local;
typedef local::seq_packet_protocol spp;
try
{
io_context ioc;
char mutable_char_buffer[128] = "";
const char const_char_buffer[128] = "";
const socket_base::message_flags in_flags = 0;
socket_base::message_flags out_flags = 0;
socket_base::send_buffer_size socket_option;
socket_base::bytes_readable io_control_command;
archetypes::immediate_handler immediate;
asio::error_code ec;
// basic_seq_packet_socket constructors.
spp::socket socket1(ioc);
spp::socket socket2(ioc, spp());
spp::socket socket3(ioc, spp::endpoint());
#if !defined(ASIO_WINDOWS_RUNTIME)
spp::socket::native_handle_type native_socket1
= ::socket(AF_UNIX, SOCK_SEQPACKET, 0);
spp::socket socket4(ioc, spp(), native_socket1);
#endif // !defined(ASIO_WINDOWS_RUNTIME)
spp::socket socket5(std::move(socket4));
// basic_seq_packet_socket operators.
socket1 = spp::socket(ioc);
socket1 = std::move(socket2);
// basic_io_object functions.
spp::socket::executor_type ex = socket1.get_executor();
(void)ex;
// basic_socket functions.
spp::socket::lowest_layer_type& lowest_layer = socket1.lowest_layer();
(void)lowest_layer;
socket1.open(spp());
socket1.open(spp(), ec);
#if !defined(ASIO_WINDOWS_RUNTIME)
spp::socket::native_handle_type native_socket2
= ::socket(AF_UNIX, SOCK_SEQPACKET, 0);
socket1.assign(spp(), native_socket2);
spp::socket::native_handle_type native_socket3
= ::socket(AF_UNIX, SOCK_SEQPACKET, 0);
socket1.assign(spp(), native_socket3, ec);
#endif // !defined(ASIO_WINDOWS_RUNTIME)
bool is_open = socket1.is_open();
(void)is_open;
socket1.close();
socket1.close(ec);
spp::socket::native_handle_type native_socket4 = socket1.native_handle();
(void)native_socket4;
socket1.cancel();
socket1.cancel(ec);
bool at_mark1 = socket1.at_mark();
(void)at_mark1;
bool at_mark2 = socket1.at_mark(ec);
(void)at_mark2;
std::size_t available1 = socket1.available();
(void)available1;
std::size_t available2 = socket1.available(ec);
(void)available2;
socket1.bind(spp::endpoint());
socket1.bind(spp::endpoint(), ec);
socket1.connect(spp::endpoint());
socket1.connect(spp::endpoint(), ec);
socket1.async_connect(spp::endpoint(), connect_handler);
socket1.async_connect(spp::endpoint(), immediate);
socket1.set_option(socket_option);
socket1.set_option(socket_option, ec);
socket1.get_option(socket_option);
socket1.get_option(socket_option, ec);
socket1.io_control(io_control_command);
socket1.io_control(io_control_command, ec);
spp::endpoint endpoint1 = socket1.local_endpoint();
(void)endpoint1;
spp::endpoint endpoint2 = socket1.local_endpoint(ec);
(void)endpoint2;
spp::endpoint endpoint3 = socket1.remote_endpoint();
(void)endpoint3;
spp::endpoint endpoint4 = socket1.remote_endpoint(ec);
(void)endpoint4;
socket1.shutdown(socket_base::shutdown_both);
socket1.shutdown(socket_base::shutdown_both, ec);
// basic_seq_packet_socket functions.
socket1.send(buffer(mutable_char_buffer), in_flags);
socket1.send(buffer(const_char_buffer), in_flags);
socket1.send(null_buffers(), in_flags);
socket1.send(buffer(mutable_char_buffer), in_flags, ec);
socket1.send(buffer(const_char_buffer), in_flags, ec);
socket1.send(null_buffers(), in_flags, ec);
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
socket1.async_send(null_buffers(), in_flags, send_handler);
socket1.async_send(buffer(mutable_char_buffer), in_flags, immediate);
socket1.async_send(buffer(const_char_buffer), in_flags, immediate);
socket1.async_send(null_buffers(), in_flags, immediate);
socket1.receive(buffer(mutable_char_buffer), out_flags);
socket1.receive(null_buffers(), out_flags);
socket1.receive(buffer(mutable_char_buffer), in_flags, out_flags);
socket1.receive(null_buffers(), in_flags, out_flags);
socket1.receive(buffer(mutable_char_buffer), in_flags, out_flags, ec);
socket1.receive(null_buffers(), in_flags, out_flags, ec);
socket1.async_receive(buffer(mutable_char_buffer), out_flags,
receive_handler);
socket1.async_receive(null_buffers(), out_flags, receive_handler);
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
out_flags, receive_handler);
socket1.async_receive(null_buffers(), in_flags, out_flags, receive_handler);
socket1.async_receive(buffer(mutable_char_buffer), out_flags, immediate);
socket1.async_receive(null_buffers(), out_flags, immediate);
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
out_flags, immediate);
socket1.async_receive(null_buffers(), in_flags, out_flags, immediate);
}
catch (std::exception&)
{
}
}
} // namespace local_seq_packet_protocol_socket_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"local/seq_packet_protocol",
ASIO_COMPILE_TEST_CASE(local_seq_packet_protocol_socket_compile::test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/local/connect_pair.cpp | //
// connect_pair.cpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/local/connect_pair.hpp"
#include "asio/io_context.hpp"
#include "asio/local/datagram_protocol.hpp"
#include "asio/local/stream_protocol.hpp"
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
// local_connect_pair_compile test
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// The following test checks that all host_name functions compile and link
// correctly. Runtime failures are ignored.
namespace local_connect_pair_compile {
void test()
{
#if defined(ASIO_HAS_LOCAL_SOCKETS)
using namespace asio;
namespace local = asio::local;
typedef local::datagram_protocol dp;
typedef local::stream_protocol sp;
try
{
asio::io_context io_context;
asio::error_code ec1;
dp::socket s1(io_context);
dp::socket s2(io_context);
local::connect_pair(s1, s2);
dp::socket s3(io_context);
dp::socket s4(io_context);
local::connect_pair(s3, s4, ec1);
sp::socket s5(io_context);
sp::socket s6(io_context);
local::connect_pair(s5, s6);
sp::socket s7(io_context);
sp::socket s8(io_context);
local::connect_pair(s7, s8, ec1);
}
catch (std::exception&)
{
}
#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
}
} // namespace local_connect_pair_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"local/connect_pair",
ASIO_COMPILE_TEST_CASE(local_connect_pair_compile::test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/local/basic_endpoint.cpp | //
// basic_endpoint.cpp
// ~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/local/basic_endpoint.hpp"
#include "../unit_test.hpp"
ASIO_TEST_SUITE
(
"local/basic_endpoint",
ASIO_TEST_CASE(null_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/local/stream_protocol.cpp | //
// stream_protocol.cpp
// ~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/local/stream_protocol.hpp"
#include <cstring>
#include "asio/io_context.hpp"
#include "../unit_test.hpp"
//------------------------------------------------------------------------------
// local_stream_protocol_socket_compile test
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// The following test checks that all public member functions on the class
// local::stream_protocol::socket compile and link correctly. Runtime failures
// are ignored.
namespace local_stream_protocol_socket_compile {
void connect_handler(const asio::error_code&)
{
}
void send_handler(const asio::error_code&, std::size_t)
{
}
void receive_handler(const asio::error_code&, std::size_t)
{
}
void write_some_handler(const asio::error_code&, std::size_t)
{
}
void read_some_handler(const asio::error_code&, std::size_t)
{
}
void test()
{
#if defined(ASIO_HAS_LOCAL_SOCKETS)
using namespace asio;
namespace local = asio::local;
typedef local::stream_protocol sp;
try
{
io_context ioc;
const io_context::executor_type ioc_ex = ioc.get_executor();
char mutable_char_buffer[128] = "";
const char const_char_buffer[128] = "";
socket_base::message_flags in_flags = 0;
socket_base::keep_alive socket_option;
socket_base::bytes_readable io_control_command;
asio::error_code ec;
// basic_stream_socket constructors.
sp::socket socket1(ioc);
sp::socket socket2(ioc, sp());
sp::socket socket3(ioc, sp::endpoint(""));
int native_socket1 = ::socket(AF_UNIX, SOCK_STREAM, 0);
sp::socket socket4(ioc, sp(), native_socket1);
sp::socket socket5(ioc_ex);
sp::socket socket6(ioc_ex, sp());
sp::socket socket7(ioc_ex, sp::endpoint(""));
int native_socket2 = ::socket(AF_UNIX, SOCK_STREAM, 0);
sp::socket socket8(ioc_ex, sp(), native_socket2);
// basic_io_object functions.
sp::socket::executor_type ex = socket1.get_executor();
(void)ex;
// basic_socket functions.
sp::socket::lowest_layer_type& lowest_layer = socket1.lowest_layer();
(void)lowest_layer;
socket1.open(sp());
socket1.open(sp(), ec);
int native_socket3 = ::socket(AF_UNIX, SOCK_STREAM, 0);
socket1.assign(sp(), native_socket3);
int native_socket4 = ::socket(AF_UNIX, SOCK_STREAM, 0);
socket1.assign(sp(), native_socket4, ec);
bool is_open = socket1.is_open();
(void)is_open;
socket1.close();
socket1.close(ec);
sp::socket::native_handle_type native_socket5 = socket1.native_handle();
(void)native_socket5;
socket1.cancel();
socket1.cancel(ec);
bool at_mark1 = socket1.at_mark();
(void)at_mark1;
bool at_mark2 = socket1.at_mark(ec);
(void)at_mark2;
std::size_t available1 = socket1.available();
(void)available1;
std::size_t available2 = socket1.available(ec);
(void)available2;
socket1.bind(sp::endpoint(""));
socket1.bind(sp::endpoint(""), ec);
socket1.connect(sp::endpoint(""));
socket1.connect(sp::endpoint(""), ec);
socket1.async_connect(sp::endpoint(""), connect_handler);
socket1.set_option(socket_option);
socket1.set_option(socket_option, ec);
socket1.get_option(socket_option);
socket1.get_option(socket_option, ec);
socket1.io_control(io_control_command);
socket1.io_control(io_control_command, ec);
sp::endpoint endpoint1 = socket1.local_endpoint();
(void)endpoint1;
sp::endpoint endpoint2 = socket1.local_endpoint(ec);
(void)endpoint2;
sp::endpoint endpoint3 = socket1.remote_endpoint();
(void)endpoint3;
sp::endpoint endpoint4 = socket1.remote_endpoint(ec);
(void)endpoint4;
socket1.shutdown(socket_base::shutdown_both);
socket1.shutdown(socket_base::shutdown_both, ec);
// basic_stream_socket functions.
socket1.send(buffer(mutable_char_buffer));
socket1.send(buffer(const_char_buffer));
socket1.send(null_buffers());
socket1.send(buffer(mutable_char_buffer), in_flags);
socket1.send(buffer(const_char_buffer), in_flags);
socket1.send(null_buffers(), in_flags);
socket1.send(buffer(mutable_char_buffer), in_flags, ec);
socket1.send(buffer(const_char_buffer), in_flags, ec);
socket1.send(null_buffers(), in_flags, ec);
socket1.async_send(buffer(mutable_char_buffer), send_handler);
socket1.async_send(buffer(const_char_buffer), send_handler);
socket1.async_send(null_buffers(), send_handler);
socket1.async_send(buffer(mutable_char_buffer), in_flags, send_handler);
socket1.async_send(buffer(const_char_buffer), in_flags, send_handler);
socket1.async_send(null_buffers(), in_flags, send_handler);
socket1.receive(buffer(mutable_char_buffer));
socket1.receive(null_buffers());
socket1.receive(buffer(mutable_char_buffer), in_flags);
socket1.receive(null_buffers(), in_flags);
socket1.receive(buffer(mutable_char_buffer), in_flags, ec);
socket1.receive(null_buffers(), in_flags, ec);
socket1.async_receive(buffer(mutable_char_buffer), receive_handler);
socket1.async_receive(null_buffers(), receive_handler);
socket1.async_receive(buffer(mutable_char_buffer), in_flags,
receive_handler);
socket1.async_receive(null_buffers(), in_flags, receive_handler);
socket1.write_some(buffer(mutable_char_buffer));
socket1.write_some(buffer(const_char_buffer));
socket1.write_some(null_buffers());
socket1.write_some(buffer(mutable_char_buffer), ec);
socket1.write_some(buffer(const_char_buffer), ec);
socket1.write_some(null_buffers(), ec);
socket1.async_write_some(buffer(mutable_char_buffer), write_some_handler);
socket1.async_write_some(buffer(const_char_buffer), write_some_handler);
socket1.async_write_some(null_buffers(), write_some_handler);
socket1.read_some(buffer(mutable_char_buffer));
socket1.read_some(buffer(mutable_char_buffer), ec);
socket1.read_some(null_buffers(), ec);
socket1.async_read_some(buffer(mutable_char_buffer), read_some_handler);
socket1.async_read_some(null_buffers(), read_some_handler);
}
catch (std::exception&)
{
}
#endif // defined(ASIO_HAS_LOCAL_SOCKETS)
}
} // namespace local_stream_protocol_socket_compile
//------------------------------------------------------------------------------
ASIO_TEST_SUITE
(
"local/stream_protocol",
ASIO_COMPILE_TEST_CASE(local_stream_protocol_socket_compile::test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/execution/any_executor.cpp | //
// any_executor.cpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/execution/any_executor.hpp"
#include <cstring>
#include <functional>
#include "asio/thread_pool.hpp"
#include "../unit_test.hpp"
using namespace asio;
namespace bindns = std;
static bool next_nothrow_new_fails = false;
void* operator new(std::size_t n,
const std::nothrow_t&) noexcept
{
if (next_nothrow_new_fails)
{
next_nothrow_new_fails = false;
return 0;
}
return ::operator new(n);
}
struct fat_executor
{
fat_executor(int id)
: id_(id)
{
std::memset(data_, 0, sizeof(data_));
}
template <typename F>
void execute(const F&) const
{
}
std::size_t query(execution::occupancy_t) const
{
return 1;
}
friend bool operator==(const fat_executor& a,
const fat_executor& b) noexcept
{
return a.id_ == b.id_;
}
friend bool operator!=(const fat_executor& a,
const fat_executor& b) noexcept
{
return a.id_ != b.id_;
}
int id_;
unsigned char data_[1024];
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename F>
struct execute_member<fat_executor, F>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <>
struct query_member<fat_executor, execution::occupancy_t>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = false;
typedef std::size_t result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <>
struct equality_comparable<fat_executor>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
} // namespace traits
} // namespace asio
void increment(int* count)
{
++(*count);
}
void any_executor_construction_test()
{
typedef execution::any_executor<> ex_no_props_t;
typedef execution::any_executor<
execution::blocking_t
> ex_one_prop_t;
typedef execution::any_executor<
execution::blocking_t,
execution::occupancy_t
> ex_two_props_t;
thread_pool pool(1);
asio::nullptr_t null_ptr = asio::nullptr_t();
ex_two_props_t ex_two_props_1;
ASIO_CHECK(ex_two_props_1.target<void>() == 0);
ASIO_CHECK(ex_two_props_1 == null_ptr);
ex_two_props_t ex_two_props_2(null_ptr);
ASIO_CHECK(ex_two_props_2.target<void>() == 0);
ASIO_CHECK(ex_two_props_2 == null_ptr);
ASIO_CHECK(ex_two_props_2 == ex_two_props_1);
ex_two_props_t ex_two_props_3(pool.executor());
ASIO_CHECK(ex_two_props_3.target<void>() != 0);
ASIO_CHECK(ex_two_props_3 != null_ptr);
ASIO_CHECK(ex_two_props_3 != ex_two_props_1);
ex_two_props_t ex_two_props_4(ex_two_props_1);
ASIO_CHECK(ex_two_props_4.target<void>() == 0);
ASIO_CHECK(ex_two_props_4 == null_ptr);
ASIO_CHECK(ex_two_props_4 == ex_two_props_1);
ex_two_props_t ex_two_props_5(ex_two_props_3);
ASIO_CHECK(ex_two_props_5.target<void>() != 0);
ASIO_CHECK(ex_two_props_5 != null_ptr);
ASIO_CHECK(ex_two_props_5 == ex_two_props_3);
ex_two_props_t ex_two_props_6 = fat_executor(1);
ASIO_CHECK(ex_two_props_6.target<void>() != 0);
ASIO_CHECK(ex_two_props_6 != null_ptr);
ASIO_CHECK(ex_two_props_6 != ex_two_props_1);
ex_two_props_t ex_two_props_7 = fat_executor(1);
ASIO_CHECK(ex_two_props_7.target<void>() != 0);
ASIO_CHECK(ex_two_props_7 != null_ptr);
ASIO_CHECK(ex_two_props_7 != ex_two_props_1);
ASIO_CHECK(ex_two_props_7 == ex_two_props_6);
ex_two_props_t ex_two_props_8 = fat_executor(2);
ASIO_CHECK(ex_two_props_8.target<void>() != 0);
ASIO_CHECK(ex_two_props_8 != null_ptr);
ASIO_CHECK(ex_two_props_8 != ex_two_props_1);
ASIO_CHECK(ex_two_props_8 != ex_two_props_6);
ASIO_CHECK(ex_two_props_8 != ex_two_props_7);
ex_two_props_t ex_two_props_9(ex_two_props_6);
ASIO_CHECK(ex_two_props_9.target<void>() != 0);
ASIO_CHECK(ex_two_props_9 != null_ptr);
ASIO_CHECK(ex_two_props_9 != ex_two_props_1);
ASIO_CHECK(ex_two_props_9 == ex_two_props_6);
ASIO_CHECK(ex_two_props_9 == ex_two_props_7);
ASIO_CHECK(ex_two_props_9 != ex_two_props_8);
ex_two_props_t ex_two_props_10(std::move(ex_two_props_1));
ASIO_CHECK(ex_two_props_10.target<void>() == 0);
ASIO_CHECK(ex_two_props_10 == null_ptr);
ASIO_CHECK(ex_two_props_1.target<void>() == 0);
ASIO_CHECK(ex_two_props_1 == null_ptr);
ex_two_props_t ex_two_props_11(std::move(ex_two_props_3));
ASIO_CHECK(ex_two_props_11.target<void>() != 0);
ASIO_CHECK(ex_two_props_11 != null_ptr);
ASIO_CHECK(ex_two_props_3.target<void>() == 0);
ASIO_CHECK(ex_two_props_3 == null_ptr);
ASIO_CHECK(ex_two_props_11 == ex_two_props_5);
ex_two_props_t ex_two_props_12(std::move(ex_two_props_7));
ASIO_CHECK(ex_two_props_12.target<void>() != 0);
ASIO_CHECK(ex_two_props_12 != null_ptr);
ASIO_CHECK(ex_two_props_7.target<void>() == 0);
ASIO_CHECK(ex_two_props_7 == null_ptr);
ASIO_CHECK(ex_two_props_12 == ex_two_props_6);
ASIO_CHECK(ex_two_props_12 != ex_two_props_8);
ex_one_prop_t ex_one_prop_1;
ASIO_CHECK(ex_one_prop_1.target<void>() == 0);
ASIO_CHECK(ex_one_prop_1 == null_ptr);
ex_one_prop_t ex_one_prop_2(null_ptr);
ASIO_CHECK(ex_one_prop_2.target<void>() == 0);
ASIO_CHECK(ex_one_prop_2 == null_ptr);
ASIO_CHECK(ex_one_prop_2 == ex_one_prop_1);
ex_one_prop_t ex_one_prop_3(pool.executor());
ASIO_CHECK(ex_one_prop_3.target<void>() != 0);
ASIO_CHECK(ex_one_prop_3 != null_ptr);
ASIO_CHECK(ex_one_prop_3 != ex_one_prop_1);
ex_one_prop_t ex_one_prop_4(ex_one_prop_1);
ASIO_CHECK(ex_one_prop_4.target<void>() == 0);
ASIO_CHECK(ex_one_prop_4 == null_ptr);
ASIO_CHECK(ex_one_prop_4 == ex_one_prop_1);
ex_one_prop_t ex_one_prop_5(ex_one_prop_3);
ASIO_CHECK(ex_one_prop_5.target<void>() != 0);
ASIO_CHECK(ex_one_prop_5 != null_ptr);
ASIO_CHECK(ex_one_prop_5 == ex_one_prop_3);
ex_one_prop_t ex_one_prop_6 = fat_executor(1);
ASIO_CHECK(ex_one_prop_6.target<void>() != 0);
ASIO_CHECK(ex_one_prop_6 != null_ptr);
ASIO_CHECK(ex_one_prop_6 != ex_one_prop_1);
ex_one_prop_t ex_one_prop_7 = fat_executor(1);
ASIO_CHECK(ex_one_prop_7.target<void>() != 0);
ASIO_CHECK(ex_one_prop_7 != null_ptr);
ASIO_CHECK(ex_one_prop_7 != ex_one_prop_1);
ASIO_CHECK(ex_one_prop_7 == ex_one_prop_6);
ex_one_prop_t ex_one_prop_8 = fat_executor(2);
ASIO_CHECK(ex_one_prop_8.target<void>() != 0);
ASIO_CHECK(ex_one_prop_8 != null_ptr);
ASIO_CHECK(ex_one_prop_8 != ex_one_prop_1);
ASIO_CHECK(ex_one_prop_8 != ex_one_prop_6);
ASIO_CHECK(ex_one_prop_8 != ex_one_prop_7);
ex_one_prop_t ex_one_prop_9(ex_one_prop_6);
ASIO_CHECK(ex_one_prop_9.target<void>() != 0);
ASIO_CHECK(ex_one_prop_9 != null_ptr);
ASIO_CHECK(ex_one_prop_9 != ex_one_prop_1);
ASIO_CHECK(ex_one_prop_9 == ex_one_prop_6);
ASIO_CHECK(ex_one_prop_9 == ex_one_prop_7);
ASIO_CHECK(ex_one_prop_9 != ex_one_prop_8);
ex_one_prop_t ex_one_prop_10(std::move(ex_one_prop_1));
ASIO_CHECK(ex_one_prop_10.target<void>() == 0);
ASIO_CHECK(ex_one_prop_10 == null_ptr);
ASIO_CHECK(ex_one_prop_1.target<void>() == 0);
ASIO_CHECK(ex_one_prop_1 == null_ptr);
ex_one_prop_t ex_one_prop_11(std::move(ex_one_prop_3));
ASIO_CHECK(ex_one_prop_11.target<void>() != 0);
ASIO_CHECK(ex_one_prop_11 != null_ptr);
ASIO_CHECK(ex_one_prop_3.target<void>() == 0);
ASIO_CHECK(ex_one_prop_3 == null_ptr);
ASIO_CHECK(ex_one_prop_11 == ex_one_prop_5);
ex_one_prop_t ex_one_prop_12(std::move(ex_one_prop_7));
ASIO_CHECK(ex_one_prop_12.target<void>() != 0);
ASIO_CHECK(ex_one_prop_12 != null_ptr);
ASIO_CHECK(ex_one_prop_7.target<void>() == 0);
ASIO_CHECK(ex_one_prop_7 == null_ptr);
ASIO_CHECK(ex_one_prop_12 == ex_one_prop_6);
ASIO_CHECK(ex_one_prop_12 != ex_one_prop_8);
ex_one_prop_t ex_one_prop_13(ex_two_props_1);
ASIO_CHECK(ex_one_prop_13.target<void>() == 0);
ASIO_CHECK(ex_one_prop_13 == null_ptr);
ex_one_prop_t ex_one_prop_14(ex_two_props_5);
ASIO_CHECK(ex_one_prop_14.target<void>() != 0);
ASIO_CHECK(ex_one_prop_14 != null_ptr);
ex_one_prop_t ex_one_prop_15(ex_two_props_9);
ASIO_CHECK(ex_one_prop_15.target<void>() != 0);
ASIO_CHECK(ex_one_prop_15 != null_ptr);
ex_no_props_t ex_no_props_1;
ASIO_CHECK(ex_no_props_1.target<void>() == 0);
ASIO_CHECK(ex_no_props_1 == null_ptr);
ex_no_props_t ex_no_props_2(null_ptr);
ASIO_CHECK(ex_no_props_2.target<void>() == 0);
ASIO_CHECK(ex_no_props_2 == null_ptr);
ASIO_CHECK(ex_no_props_2 == ex_no_props_1);
ex_no_props_t ex_no_props_3(pool.executor());
ASIO_CHECK(ex_no_props_3.target<void>() != 0);
ASIO_CHECK(ex_no_props_3 != null_ptr);
ASIO_CHECK(ex_no_props_3 != ex_no_props_1);
ex_no_props_t ex_no_props_4(ex_no_props_1);
ASIO_CHECK(ex_no_props_4.target<void>() == 0);
ASIO_CHECK(ex_no_props_4 == null_ptr);
ASIO_CHECK(ex_no_props_4 == ex_no_props_1);
ex_no_props_t ex_no_props_5(ex_no_props_3);
ASIO_CHECK(ex_no_props_5.target<void>() != 0);
ASIO_CHECK(ex_no_props_5 != null_ptr);
ASIO_CHECK(ex_no_props_5 == ex_no_props_3);
ex_no_props_t ex_no_props_6 = fat_executor(1);
ASIO_CHECK(ex_no_props_6.target<void>() != 0);
ASIO_CHECK(ex_no_props_6 != null_ptr);
ASIO_CHECK(ex_no_props_6 != ex_no_props_1);
ex_no_props_t ex_no_props_7 = fat_executor(1);
ASIO_CHECK(ex_no_props_7.target<void>() != 0);
ASIO_CHECK(ex_no_props_7 != null_ptr);
ASIO_CHECK(ex_no_props_7 != ex_no_props_1);
ASIO_CHECK(ex_no_props_7 == ex_no_props_6);
ex_no_props_t ex_no_props_8 = fat_executor(2);
ASIO_CHECK(ex_no_props_8.target<void>() != 0);
ASIO_CHECK(ex_no_props_8 != null_ptr);
ASIO_CHECK(ex_no_props_8 != ex_no_props_1);
ASIO_CHECK(ex_no_props_8 != ex_no_props_6);
ASIO_CHECK(ex_no_props_8 != ex_no_props_7);
ex_no_props_t ex_no_props_9(ex_no_props_6);
ASIO_CHECK(ex_no_props_9.target<void>() != 0);
ASIO_CHECK(ex_no_props_9 != null_ptr);
ASIO_CHECK(ex_no_props_9 != ex_no_props_1);
ASIO_CHECK(ex_no_props_9 == ex_no_props_6);
ASIO_CHECK(ex_no_props_9 == ex_no_props_7);
ASIO_CHECK(ex_no_props_9 != ex_no_props_8);
ex_no_props_t ex_no_props_10(std::move(ex_no_props_1));
ASIO_CHECK(ex_no_props_10.target<void>() == 0);
ASIO_CHECK(ex_no_props_10 == null_ptr);
ASIO_CHECK(ex_no_props_1.target<void>() == 0);
ASIO_CHECK(ex_no_props_1 == null_ptr);
ex_no_props_t ex_no_props_11(std::move(ex_no_props_3));
ASIO_CHECK(ex_no_props_11.target<void>() != 0);
ASIO_CHECK(ex_no_props_11 != null_ptr);
ASIO_CHECK(ex_no_props_3.target<void>() == 0);
ASIO_CHECK(ex_no_props_3 == null_ptr);
ASIO_CHECK(ex_no_props_11 == ex_no_props_5);
ex_no_props_t ex_no_props_12(std::move(ex_no_props_7));
ASIO_CHECK(ex_no_props_12.target<void>() != 0);
ASIO_CHECK(ex_no_props_12 != null_ptr);
ASIO_CHECK(ex_no_props_7.target<void>() == 0);
ASIO_CHECK(ex_no_props_7 == null_ptr);
ASIO_CHECK(ex_no_props_12 == ex_no_props_6);
ASIO_CHECK(ex_no_props_12 != ex_no_props_8);
ex_no_props_t ex_no_props_13(ex_two_props_1);
ASIO_CHECK(ex_no_props_13.target<void>() == 0);
ASIO_CHECK(ex_no_props_13 == null_ptr);
ex_no_props_t ex_no_props_14(ex_two_props_5);
ASIO_CHECK(ex_no_props_14.target<void>() != 0);
ASIO_CHECK(ex_no_props_14 != null_ptr);
ex_no_props_t ex_no_props_15(ex_two_props_9);
ASIO_CHECK(ex_no_props_15.target<void>() != 0);
ASIO_CHECK(ex_no_props_15 != null_ptr);
ex_no_props_t ex_no_props_16(ex_one_prop_1);
ASIO_CHECK(ex_no_props_16.target<void>() == 0);
ASIO_CHECK(ex_no_props_16 == null_ptr);
ex_no_props_t ex_no_props_17(ex_one_prop_5);
ASIO_CHECK(ex_no_props_17.target<void>() != 0);
ASIO_CHECK(ex_no_props_17 != null_ptr);
ex_no_props_t ex_no_props_18(ex_one_prop_9);
ASIO_CHECK(ex_no_props_18.target<void>() != 0);
ASIO_CHECK(ex_no_props_18 != null_ptr);
}
void any_executor_nothrow_construction_test()
{
typedef execution::any_executor<> ex_no_props_t;
typedef execution::any_executor<
execution::blocking_t
> ex_one_prop_t;
typedef execution::any_executor<
execution::blocking_t,
execution::occupancy_t
> ex_two_props_t;
thread_pool pool(1);
asio::nullptr_t null_ptr = asio::nullptr_t();
ex_two_props_t ex_two_props_1;
ASIO_CHECK(ex_two_props_1.target<void>() == 0);
ASIO_CHECK(ex_two_props_1 == null_ptr);
ex_two_props_t ex_two_props_2(null_ptr);
ASIO_CHECK(ex_two_props_2.target<void>() == 0);
ASIO_CHECK(ex_two_props_2 == null_ptr);
ASIO_CHECK(ex_two_props_2 == ex_two_props_1);
ex_two_props_t ex_two_props_3(std::nothrow, pool.executor());
ASIO_CHECK(ex_two_props_3.target<void>() != 0);
ASIO_CHECK(ex_two_props_3 != null_ptr);
ASIO_CHECK(ex_two_props_3 != ex_two_props_1);
ex_two_props_t ex_two_props_4(std::nothrow, ex_two_props_1);
ASIO_CHECK(ex_two_props_4.target<void>() == 0);
ASIO_CHECK(ex_two_props_4 == null_ptr);
ASIO_CHECK(ex_two_props_4 == ex_two_props_1);
ex_two_props_t ex_two_props_5(std::nothrow, ex_two_props_3);
ASIO_CHECK(ex_two_props_5.target<void>() != 0);
ASIO_CHECK(ex_two_props_5 != null_ptr);
ASIO_CHECK(ex_two_props_5 == ex_two_props_3);
ex_two_props_t ex_two_props_6(std::nothrow, fat_executor(1));
ASIO_CHECK(ex_two_props_6.target<void>() != 0);
ASIO_CHECK(ex_two_props_6 != null_ptr);
ASIO_CHECK(ex_two_props_6 != ex_two_props_1);
ex_two_props_t ex_two_props_7(std::nothrow, fat_executor(1));
ASIO_CHECK(ex_two_props_7.target<void>() != 0);
ASIO_CHECK(ex_two_props_7 != null_ptr);
ASIO_CHECK(ex_two_props_7 != ex_two_props_1);
ASIO_CHECK(ex_two_props_7 == ex_two_props_6);
ex_two_props_t ex_two_props_8(std::nothrow, fat_executor(2));
ASIO_CHECK(ex_two_props_8.target<void>() != 0);
ASIO_CHECK(ex_two_props_8 != null_ptr);
ASIO_CHECK(ex_two_props_8 != ex_two_props_1);
ASIO_CHECK(ex_two_props_8 != ex_two_props_6);
ASIO_CHECK(ex_two_props_8 != ex_two_props_7);
ex_two_props_t ex_two_props_9(std::nothrow, ex_two_props_6);
ASIO_CHECK(ex_two_props_9.target<void>() != 0);
ASIO_CHECK(ex_two_props_9 != null_ptr);
ASIO_CHECK(ex_two_props_9 != ex_two_props_1);
ASIO_CHECK(ex_two_props_9 == ex_two_props_6);
ASIO_CHECK(ex_two_props_9 == ex_two_props_7);
ASIO_CHECK(ex_two_props_9 != ex_two_props_8);
ex_two_props_t ex_two_props_10(std::nothrow, std::move(ex_two_props_1));
ASIO_CHECK(ex_two_props_10.target<void>() == 0);
ASIO_CHECK(ex_two_props_10 == null_ptr);
ASIO_CHECK(ex_two_props_1.target<void>() == 0);
ASIO_CHECK(ex_two_props_1 == null_ptr);
ex_two_props_t ex_two_props_11(std::nothrow, std::move(ex_two_props_3));
ASIO_CHECK(ex_two_props_11.target<void>() != 0);
ASIO_CHECK(ex_two_props_11 != null_ptr);
ASIO_CHECK(ex_two_props_3.target<void>() == 0);
ASIO_CHECK(ex_two_props_3 == null_ptr);
ASIO_CHECK(ex_two_props_11 == ex_two_props_5);
ex_two_props_t ex_two_props_12(std::nothrow, std::move(ex_two_props_7));
ASIO_CHECK(ex_two_props_12.target<void>() != 0);
ASIO_CHECK(ex_two_props_12 != null_ptr);
ASIO_CHECK(ex_two_props_7.target<void>() == 0);
ASIO_CHECK(ex_two_props_7 == null_ptr);
ASIO_CHECK(ex_two_props_12 == ex_two_props_6);
ASIO_CHECK(ex_two_props_12 != ex_two_props_8);
next_nothrow_new_fails = true;
ex_two_props_t ex_two_props_13(std::nothrow, fat_executor(3));
ASIO_CHECK(ex_two_props_13.target<void>() == 0);
ASIO_CHECK(ex_two_props_13 == null_ptr);
ASIO_CHECK(ex_two_props_13 == ex_two_props_1);
ex_one_prop_t ex_one_prop_1;
ASIO_CHECK(ex_one_prop_1.target<void>() == 0);
ASIO_CHECK(ex_one_prop_1 == null_ptr);
ex_one_prop_t ex_one_prop_2(null_ptr);
ASIO_CHECK(ex_one_prop_2.target<void>() == 0);
ASIO_CHECK(ex_one_prop_2 == null_ptr);
ASIO_CHECK(ex_one_prop_2 == ex_one_prop_1);
ex_one_prop_t ex_one_prop_3(std::nothrow, pool.executor());
ASIO_CHECK(ex_one_prop_3.target<void>() != 0);
ASIO_CHECK(ex_one_prop_3 != null_ptr);
ASIO_CHECK(ex_one_prop_3 != ex_one_prop_1);
ex_one_prop_t ex_one_prop_4(std::nothrow, ex_one_prop_1);
ASIO_CHECK(ex_one_prop_4.target<void>() == 0);
ASIO_CHECK(ex_one_prop_4 == null_ptr);
ASIO_CHECK(ex_one_prop_4 == ex_one_prop_1);
ex_one_prop_t ex_one_prop_5(std::nothrow, ex_one_prop_3);
ASIO_CHECK(ex_one_prop_5.target<void>() != 0);
ASIO_CHECK(ex_one_prop_5 != null_ptr);
ASIO_CHECK(ex_one_prop_5 == ex_one_prop_3);
ex_one_prop_t ex_one_prop_6 = fat_executor(1);
ASIO_CHECK(ex_one_prop_6.target<void>() != 0);
ASIO_CHECK(ex_one_prop_6 != null_ptr);
ASIO_CHECK(ex_one_prop_6 != ex_one_prop_1);
ex_one_prop_t ex_one_prop_7(std::nothrow, fat_executor(1));
ASIO_CHECK(ex_one_prop_7.target<void>() != 0);
ASIO_CHECK(ex_one_prop_7 != null_ptr);
ASIO_CHECK(ex_one_prop_7 != ex_one_prop_1);
ASIO_CHECK(ex_one_prop_7 == ex_one_prop_6);
ex_one_prop_t ex_one_prop_8(std::nothrow, fat_executor(2));
ASIO_CHECK(ex_one_prop_8.target<void>() != 0);
ASIO_CHECK(ex_one_prop_8 != null_ptr);
ASIO_CHECK(ex_one_prop_8 != ex_one_prop_1);
ASIO_CHECK(ex_one_prop_8 != ex_one_prop_6);
ASIO_CHECK(ex_one_prop_8 != ex_one_prop_7);
ex_one_prop_t ex_one_prop_9(std::nothrow, ex_one_prop_6);
ASIO_CHECK(ex_one_prop_9.target<void>() != 0);
ASIO_CHECK(ex_one_prop_9 != null_ptr);
ASIO_CHECK(ex_one_prop_9 != ex_one_prop_1);
ASIO_CHECK(ex_one_prop_9 == ex_one_prop_6);
ASIO_CHECK(ex_one_prop_9 == ex_one_prop_7);
ASIO_CHECK(ex_one_prop_9 != ex_one_prop_8);
ex_one_prop_t ex_one_prop_10(std::nothrow, std::move(ex_one_prop_1));
ASIO_CHECK(ex_one_prop_10.target<void>() == 0);
ASIO_CHECK(ex_one_prop_10 == null_ptr);
ASIO_CHECK(ex_one_prop_1.target<void>() == 0);
ASIO_CHECK(ex_one_prop_1 == null_ptr);
ex_one_prop_t ex_one_prop_11(std::nothrow, std::move(ex_one_prop_3));
ASIO_CHECK(ex_one_prop_11.target<void>() != 0);
ASIO_CHECK(ex_one_prop_11 != null_ptr);
ASIO_CHECK(ex_one_prop_3.target<void>() == 0);
ASIO_CHECK(ex_one_prop_3 == null_ptr);
ASIO_CHECK(ex_one_prop_11 == ex_one_prop_5);
ex_one_prop_t ex_one_prop_12(std::nothrow, std::move(ex_one_prop_7));
ASIO_CHECK(ex_one_prop_12.target<void>() != 0);
ASIO_CHECK(ex_one_prop_12 != null_ptr);
ASIO_CHECK(ex_one_prop_7.target<void>() == 0);
ASIO_CHECK(ex_one_prop_7 == null_ptr);
ASIO_CHECK(ex_one_prop_12 == ex_one_prop_6);
ASIO_CHECK(ex_one_prop_12 != ex_one_prop_8);
ex_one_prop_t ex_one_prop_13(std::nothrow, ex_two_props_1);
ASIO_CHECK(ex_one_prop_13.target<void>() == 0);
ASIO_CHECK(ex_one_prop_13 == null_ptr);
ex_one_prop_t ex_one_prop_14(std::nothrow, ex_two_props_5);
ASIO_CHECK(ex_one_prop_14.target<void>() != 0);
ASIO_CHECK(ex_one_prop_14 != null_ptr);
ex_one_prop_t ex_one_prop_15(std::nothrow, ex_two_props_9);
ASIO_CHECK(ex_one_prop_15.target<void>() != 0);
ASIO_CHECK(ex_one_prop_15 != null_ptr);
next_nothrow_new_fails = true;
ex_one_prop_t ex_one_prop_16(std::nothrow, fat_executor(3));
ASIO_CHECK(ex_one_prop_16.target<void>() == 0);
ASIO_CHECK(ex_one_prop_16 == null_ptr);
ASIO_CHECK(ex_one_prop_16 == ex_one_prop_1);
ex_no_props_t ex_no_props_1;
ASIO_CHECK(ex_no_props_1.target<void>() == 0);
ASIO_CHECK(ex_no_props_1 == null_ptr);
ex_no_props_t ex_no_props_2(null_ptr);
ASIO_CHECK(ex_no_props_2.target<void>() == 0);
ASIO_CHECK(ex_no_props_2 == null_ptr);
ASIO_CHECK(ex_no_props_2 == ex_no_props_1);
ex_no_props_t ex_no_props_3(std::nothrow, pool.executor());
ASIO_CHECK(ex_no_props_3.target<void>() != 0);
ASIO_CHECK(ex_no_props_3 != null_ptr);
ASIO_CHECK(ex_no_props_3 != ex_no_props_1);
ex_no_props_t ex_no_props_4(std::nothrow, ex_no_props_1);
ASIO_CHECK(ex_no_props_4.target<void>() == 0);
ASIO_CHECK(ex_no_props_4 == null_ptr);
ASIO_CHECK(ex_no_props_4 == ex_no_props_1);
ex_no_props_t ex_no_props_5(std::nothrow, ex_no_props_3);
ASIO_CHECK(ex_no_props_5.target<void>() != 0);
ASIO_CHECK(ex_no_props_5 != null_ptr);
ASIO_CHECK(ex_no_props_5 == ex_no_props_3);
ex_no_props_t ex_no_props_6(std::nothrow, fat_executor(1));
ASIO_CHECK(ex_no_props_6.target<void>() != 0);
ASIO_CHECK(ex_no_props_6 != null_ptr);
ASIO_CHECK(ex_no_props_6 != ex_no_props_1);
ex_no_props_t ex_no_props_7(std::nothrow, fat_executor(1));
ASIO_CHECK(ex_no_props_7.target<void>() != 0);
ASIO_CHECK(ex_no_props_7 != null_ptr);
ASIO_CHECK(ex_no_props_7 != ex_no_props_1);
ASIO_CHECK(ex_no_props_7 == ex_no_props_6);
ex_no_props_t ex_no_props_8(std::nothrow, fat_executor(2));
ASIO_CHECK(ex_no_props_8.target<void>() != 0);
ASIO_CHECK(ex_no_props_8 != null_ptr);
ASIO_CHECK(ex_no_props_8 != ex_no_props_1);
ASIO_CHECK(ex_no_props_8 != ex_no_props_6);
ASIO_CHECK(ex_no_props_8 != ex_no_props_7);
ex_no_props_t ex_no_props_9(std::nothrow, ex_no_props_6);
ASIO_CHECK(ex_no_props_9.target<void>() != 0);
ASIO_CHECK(ex_no_props_9 != null_ptr);
ASIO_CHECK(ex_no_props_9 != ex_no_props_1);
ASIO_CHECK(ex_no_props_9 == ex_no_props_6);
ASIO_CHECK(ex_no_props_9 == ex_no_props_7);
ASIO_CHECK(ex_no_props_9 != ex_no_props_8);
ex_no_props_t ex_no_props_10(std::nothrow, std::move(ex_no_props_1));
ASIO_CHECK(ex_no_props_10.target<void>() == 0);
ASIO_CHECK(ex_no_props_10 == null_ptr);
ASIO_CHECK(ex_no_props_1.target<void>() == 0);
ASIO_CHECK(ex_no_props_1 == null_ptr);
ex_no_props_t ex_no_props_11(std::nothrow, std::move(ex_no_props_3));
ASIO_CHECK(ex_no_props_11.target<void>() != 0);
ASIO_CHECK(ex_no_props_11 != null_ptr);
ASIO_CHECK(ex_no_props_3.target<void>() == 0);
ASIO_CHECK(ex_no_props_3 == null_ptr);
ASIO_CHECK(ex_no_props_11 == ex_no_props_5);
ex_no_props_t ex_no_props_12(std::nothrow, std::move(ex_no_props_7));
ASIO_CHECK(ex_no_props_12.target<void>() != 0);
ASIO_CHECK(ex_no_props_12 != null_ptr);
ASIO_CHECK(ex_no_props_7.target<void>() == 0);
ASIO_CHECK(ex_no_props_7 == null_ptr);
ASIO_CHECK(ex_no_props_12 == ex_no_props_6);
ASIO_CHECK(ex_no_props_12 != ex_no_props_8);
ex_no_props_t ex_no_props_13(std::nothrow, ex_two_props_1);
ASIO_CHECK(ex_no_props_13.target<void>() == 0);
ASIO_CHECK(ex_no_props_13 == null_ptr);
ex_no_props_t ex_no_props_14(std::nothrow, ex_two_props_5);
ASIO_CHECK(ex_no_props_14.target<void>() != 0);
ASIO_CHECK(ex_no_props_14 != null_ptr);
ex_no_props_t ex_no_props_15(std::nothrow, ex_two_props_9);
ASIO_CHECK(ex_no_props_15.target<void>() != 0);
ASIO_CHECK(ex_no_props_15 != null_ptr);
ex_no_props_t ex_no_props_16(std::nothrow, ex_one_prop_1);
ASIO_CHECK(ex_no_props_16.target<void>() == 0);
ASIO_CHECK(ex_no_props_16 == null_ptr);
ex_no_props_t ex_no_props_17(std::nothrow, ex_one_prop_5);
ASIO_CHECK(ex_no_props_17.target<void>() != 0);
ASIO_CHECK(ex_no_props_17 != null_ptr);
ex_no_props_t ex_no_props_18(std::nothrow, ex_one_prop_9);
ASIO_CHECK(ex_no_props_18.target<void>() != 0);
ASIO_CHECK(ex_no_props_18 != null_ptr);
next_nothrow_new_fails = true;
ex_no_props_t ex_no_props_19(std::nothrow, fat_executor(3));
ASIO_CHECK(ex_no_props_19.target<void>() == 0);
ASIO_CHECK(ex_no_props_19 == null_ptr);
ASIO_CHECK(ex_no_props_19 == ex_no_props_1);
}
void any_executor_assignment_test()
{
typedef execution::any_executor<> ex_no_props_t;
typedef execution::any_executor<
execution::blocking_t
> ex_one_prop_t;
typedef execution::any_executor<
execution::blocking_t,
execution::occupancy_t
> ex_two_props_t;
thread_pool pool(1);
asio::nullptr_t null_ptr = asio::nullptr_t();
ex_two_props_t ex_two_props_1;
ex_two_props_t ex_two_props_2;
ex_two_props_2 = null_ptr;
ASIO_CHECK(ex_two_props_2.target<void>() == 0);
ex_two_props_t ex_two_props_3;
ex_two_props_3 = pool.executor();
ASIO_CHECK(ex_two_props_3.target<void>() != 0);
ex_two_props_t ex_two_props_4;
ex_two_props_4 = ex_two_props_1;
ASIO_CHECK(ex_two_props_4.target<void>() == 0);
ASIO_CHECK(ex_two_props_4 == ex_two_props_1);
ex_two_props_4 = ex_two_props_3;
ASIO_CHECK(ex_two_props_4.target<void>() != 0);
ASIO_CHECK(ex_two_props_4 == ex_two_props_3);
ex_two_props_t ex_two_props_5;
ex_two_props_5 = fat_executor(1);
ASIO_CHECK(ex_two_props_5.target<void>() != 0);
ASIO_CHECK(ex_two_props_5 != null_ptr);
ASIO_CHECK(ex_two_props_5 != ex_two_props_1);
ex_two_props_t ex_two_props_6;
ex_two_props_6 = fat_executor(1);
ASIO_CHECK(ex_two_props_6.target<void>() != 0);
ASIO_CHECK(ex_two_props_6 != null_ptr);
ASIO_CHECK(ex_two_props_6 != ex_two_props_1);
ASIO_CHECK(ex_two_props_6 == ex_two_props_5);
ex_two_props_6 = fat_executor(2);
ASIO_CHECK(ex_two_props_6.target<void>() != 0);
ASIO_CHECK(ex_two_props_6 != null_ptr);
ASIO_CHECK(ex_two_props_6 != ex_two_props_1);
ASIO_CHECK(ex_two_props_6 != ex_two_props_5);
ex_two_props_t ex_two_props_7;
ex_two_props_7 = ex_two_props_5;
ASIO_CHECK(ex_two_props_7.target<void>() != 0);
ASIO_CHECK(ex_two_props_7 != null_ptr);
ASIO_CHECK(ex_two_props_7 != ex_two_props_1);
ASIO_CHECK(ex_two_props_7 == ex_two_props_5);
ASIO_CHECK(ex_two_props_7 != ex_two_props_6);
ex_two_props_t ex_two_props_8;
ex_two_props_8 = std::move(ex_two_props_1);
ASIO_CHECK(ex_two_props_8.target<void>() == 0);
ASIO_CHECK(ex_two_props_1.target<void>() == 0);
ex_two_props_8 = std::move(ex_two_props_3);
ASIO_CHECK(ex_two_props_8.target<void>() != 0);
ASIO_CHECK(ex_two_props_3.target<void>() == 0);
ASIO_CHECK(ex_two_props_8 == ex_two_props_4);
ex_two_props_8 = std::move(ex_two_props_5);
ASIO_CHECK(ex_two_props_8.target<void>() != 0);
ASIO_CHECK(ex_two_props_5.target<void>() == 0);
ASIO_CHECK(ex_two_props_8 == ex_two_props_7);
ex_one_prop_t ex_one_prop_1;
ex_one_prop_t ex_one_prop_2;
ex_one_prop_2 = null_ptr;
ASIO_CHECK(ex_one_prop_2.target<void>() == 0);
ex_one_prop_t ex_one_prop_3;
ex_one_prop_3 = pool.executor();
ASIO_CHECK(ex_one_prop_3.target<void>() != 0);
ex_one_prop_t ex_one_prop_4;
ex_one_prop_4 = ex_one_prop_1;
ASIO_CHECK(ex_one_prop_4.target<void>() == 0);
ASIO_CHECK(ex_one_prop_4 == ex_one_prop_1);
ex_one_prop_4 = ex_one_prop_3;
ASIO_CHECK(ex_one_prop_4.target<void>() != 0);
ASIO_CHECK(ex_one_prop_4 == ex_one_prop_3);
ex_one_prop_t ex_one_prop_5;
ex_one_prop_5 = fat_executor(1);
ASIO_CHECK(ex_one_prop_5.target<void>() != 0);
ASIO_CHECK(ex_one_prop_5 != null_ptr);
ASIO_CHECK(ex_one_prop_5 != ex_one_prop_1);
ex_one_prop_t ex_one_prop_6;
ex_one_prop_6 = fat_executor(1);
ASIO_CHECK(ex_one_prop_6.target<void>() != 0);
ASIO_CHECK(ex_one_prop_6 != null_ptr);
ASIO_CHECK(ex_one_prop_6 != ex_one_prop_1);
ASIO_CHECK(ex_one_prop_6 == ex_one_prop_5);
ex_one_prop_6 = fat_executor(2);
ASIO_CHECK(ex_one_prop_6.target<void>() != 0);
ASIO_CHECK(ex_one_prop_6 != null_ptr);
ASIO_CHECK(ex_one_prop_6 != ex_one_prop_1);
ASIO_CHECK(ex_one_prop_6 != ex_one_prop_5);
ex_one_prop_t ex_one_prop_7;
ex_one_prop_7 = ex_one_prop_5;
ASIO_CHECK(ex_one_prop_7.target<void>() != 0);
ASIO_CHECK(ex_one_prop_7 != null_ptr);
ASIO_CHECK(ex_one_prop_7 != ex_one_prop_1);
ASIO_CHECK(ex_one_prop_7 == ex_one_prop_5);
ASIO_CHECK(ex_one_prop_7 != ex_one_prop_6);
ex_one_prop_t ex_one_prop_8;
ex_one_prop_8 = std::move(ex_one_prop_1);
ASIO_CHECK(ex_one_prop_8.target<void>() == 0);
ASIO_CHECK(ex_one_prop_1.target<void>() == 0);
ex_one_prop_8 = std::move(ex_one_prop_3);
ASIO_CHECK(ex_one_prop_8.target<void>() != 0);
ASIO_CHECK(ex_one_prop_3.target<void>() == 0);
ASIO_CHECK(ex_one_prop_8 == ex_one_prop_4);
ex_one_prop_8 = std::move(ex_one_prop_5);
ASIO_CHECK(ex_one_prop_8.target<void>() != 0);
ASIO_CHECK(ex_one_prop_5.target<void>() == 0);
ASIO_CHECK(ex_one_prop_8 == ex_one_prop_7);
ex_one_prop_t ex_one_prop_9;
ex_one_prop_9 = ex_two_props_1;
ASIO_CHECK(ex_one_prop_9.target<void>() == 0);
ex_one_prop_9 = ex_two_props_4;
ASIO_CHECK(ex_one_prop_9.target<void>() != 0);
ex_one_prop_9 = ex_two_props_7;
ASIO_CHECK(ex_one_prop_9.target<void>() != 0);
ex_no_props_t ex_no_props_1;
ex_no_props_t ex_no_props_2;
ex_no_props_2 = null_ptr;
ASIO_CHECK(ex_no_props_2.target<void>() == 0);
ex_no_props_t ex_no_props_3;
ex_no_props_3 = pool.executor();
ASIO_CHECK(ex_no_props_3.target<void>() != 0);
ex_no_props_t ex_no_props_4;
ex_no_props_4 = ex_no_props_1;
ASIO_CHECK(ex_no_props_4.target<void>() == 0);
ASIO_CHECK(ex_no_props_4 == ex_no_props_1);
ex_no_props_4 = ex_no_props_3;
ASIO_CHECK(ex_no_props_4.target<void>() != 0);
ASIO_CHECK(ex_no_props_4 == ex_no_props_3);
ex_no_props_t ex_no_props_5;
ex_no_props_5 = fat_executor(1);
ASIO_CHECK(ex_no_props_5.target<void>() != 0);
ASIO_CHECK(ex_no_props_5 != null_ptr);
ASIO_CHECK(ex_no_props_5 != ex_no_props_1);
ex_no_props_t ex_no_props_6;
ex_no_props_6 = fat_executor(1);
ASIO_CHECK(ex_no_props_6.target<void>() != 0);
ASIO_CHECK(ex_no_props_6 != null_ptr);
ASIO_CHECK(ex_no_props_6 != ex_no_props_1);
ASIO_CHECK(ex_no_props_6 == ex_no_props_5);
ex_no_props_6 = fat_executor(2);
ASIO_CHECK(ex_no_props_6.target<void>() != 0);
ASIO_CHECK(ex_no_props_6 != null_ptr);
ASIO_CHECK(ex_no_props_6 != ex_no_props_1);
ASIO_CHECK(ex_no_props_6 != ex_no_props_5);
ex_no_props_t ex_no_props_7;
ex_no_props_7 = ex_no_props_5;
ASIO_CHECK(ex_no_props_7.target<void>() != 0);
ASIO_CHECK(ex_no_props_7 != null_ptr);
ASIO_CHECK(ex_no_props_7 != ex_no_props_1);
ASIO_CHECK(ex_no_props_7 == ex_no_props_5);
ASIO_CHECK(ex_no_props_7 != ex_no_props_6);
ex_no_props_t ex_no_props_8;
ex_no_props_8 = std::move(ex_no_props_1);
ASIO_CHECK(ex_no_props_8.target<void>() == 0);
ASIO_CHECK(ex_no_props_1.target<void>() == 0);
ex_no_props_8 = std::move(ex_no_props_3);
ASIO_CHECK(ex_no_props_8.target<void>() != 0);
ASIO_CHECK(ex_no_props_3.target<void>() == 0);
ASIO_CHECK(ex_no_props_8 == ex_no_props_4);
ex_no_props_8 = std::move(ex_no_props_5);
ASIO_CHECK(ex_no_props_8.target<void>() != 0);
ASIO_CHECK(ex_no_props_5.target<void>() == 0);
ASIO_CHECK(ex_no_props_8 == ex_no_props_7);
ex_no_props_t ex_no_props_9;
ex_no_props_9 = ex_two_props_1;
ASIO_CHECK(ex_no_props_9.target<void>() == 0);
ex_no_props_9 = ex_two_props_4;
ASIO_CHECK(ex_no_props_9.target<void>() != 0);
ex_no_props_9 = ex_two_props_7;
ASIO_CHECK(ex_no_props_9.target<void>() != 0);
ex_no_props_9 = ex_one_prop_1;
ASIO_CHECK(ex_no_props_9.target<void>() == 0);
ex_no_props_9 = ex_one_prop_4;
ASIO_CHECK(ex_no_props_9.target<void>() != 0);
ex_no_props_9 = ex_one_prop_7;
ASIO_CHECK(ex_no_props_9.target<void>() != 0);
}
void any_executor_swap_test()
{
typedef execution::any_executor<> ex_no_props_t;
typedef execution::any_executor<
execution::blocking_t
> ex_one_prop_t;
typedef execution::any_executor<
execution::blocking_t,
execution::occupancy_t
> ex_two_props_t;
thread_pool pool1(1);
thread_pool pool2(1);
ex_no_props_t ex_no_props_1(pool1.executor());
ex_no_props_t ex_no_props_2(pool2.executor());
ex_no_props_t ex_no_props_3(ex_no_props_1);
ex_no_props_t ex_no_props_4(ex_no_props_2);
ASIO_CHECK(ex_no_props_3 == ex_no_props_1);
ASIO_CHECK(ex_no_props_4 == ex_no_props_2);
ex_no_props_3.swap(ex_no_props_4);
ASIO_CHECK(ex_no_props_3 == ex_no_props_2);
ASIO_CHECK(ex_no_props_4 == ex_no_props_1);
execution::swap(ex_no_props_3, ex_no_props_4);
ASIO_CHECK(ex_no_props_3 == ex_no_props_1);
ASIO_CHECK(ex_no_props_4 == ex_no_props_2);
ex_one_prop_t ex_one_prop_1(pool1.executor());
ex_one_prop_t ex_one_prop_2(pool2.executor());
ex_one_prop_t ex_one_prop_3(ex_one_prop_1);
ex_one_prop_t ex_one_prop_4(ex_one_prop_2);
ASIO_CHECK(ex_one_prop_3 == ex_one_prop_1);
ASIO_CHECK(ex_one_prop_4 == ex_one_prop_2);
ex_one_prop_3.swap(ex_one_prop_4);
ASIO_CHECK(ex_one_prop_3 == ex_one_prop_2);
ASIO_CHECK(ex_one_prop_4 == ex_one_prop_1);
execution::swap(ex_one_prop_3, ex_one_prop_4);
ASIO_CHECK(ex_one_prop_3 == ex_one_prop_1);
ASIO_CHECK(ex_one_prop_4 == ex_one_prop_2);
ex_two_props_t ex_two_props_1(pool1.executor());
ex_two_props_t ex_two_props_2(pool2.executor());
ex_two_props_t ex_two_props_3(ex_two_props_1);
ex_two_props_t ex_two_props_4(ex_two_props_2);
ASIO_CHECK(ex_two_props_3 == ex_two_props_1);
ASIO_CHECK(ex_two_props_4 == ex_two_props_2);
ex_two_props_3.swap(ex_two_props_4);
ASIO_CHECK(ex_two_props_3 == ex_two_props_2);
ASIO_CHECK(ex_two_props_4 == ex_two_props_1);
execution::swap(ex_two_props_3, ex_two_props_4);
ASIO_CHECK(ex_two_props_3 == ex_two_props_1);
ASIO_CHECK(ex_two_props_4 == ex_two_props_2);
}
void any_executor_query_test()
{
thread_pool pool(1);
execution::any_executor<
execution::blocking_t,
execution::outstanding_work_t,
execution::relationship_t,
execution::mapping_t::thread_t,
execution::occupancy_t>
ex(pool.executor());
ASIO_CHECK(
asio::query(ex, asio::execution::blocking)
== asio::execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex, asio::execution::blocking.possibly)
== asio::execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex, asio::execution::outstanding_work)
== asio::execution::outstanding_work.untracked);
ASIO_CHECK(
asio::query(ex, asio::execution::outstanding_work.untracked)
== asio::execution::outstanding_work.untracked);
ASIO_CHECK(
asio::query(ex, asio::execution::relationship)
== asio::execution::relationship.fork);
ASIO_CHECK(
asio::query(ex, asio::execution::relationship.fork)
== asio::execution::relationship.fork);
ASIO_CHECK(
asio::query(ex, asio::execution::mapping)
== asio::execution::mapping.thread);
ASIO_CHECK(
asio::query(ex, asio::execution::occupancy)
== 1);
}
void any_executor_execute_test()
{
int count = 0;
thread_pool pool(1);
execution::any_executor<
execution::blocking_t::possibly_t,
execution::blocking_t::never_t,
execution::outstanding_work_t::untracked_t,
execution::outstanding_work_t::tracked_t,
execution::relationship_t::continuation_t>
ex(pool.executor());
ex.execute(bindns::bind(increment, &count));
asio::require(ex, asio::execution::blocking.possibly).execute(
bindns::bind(increment, &count));
asio::require(ex, asio::execution::blocking.never).execute(
bindns::bind(increment, &count));
asio::require(ex,
asio::execution::blocking.never,
asio::execution::outstanding_work.tracked
).execute(bindns::bind(increment, &count));
asio::require(ex,
asio::execution::blocking.never,
asio::execution::outstanding_work.untracked
).execute(bindns::bind(increment, &count));
asio::require(ex,
asio::execution::blocking.never,
asio::execution::outstanding_work.untracked,
asio::execution::relationship.continuation
).execute(bindns::bind(increment, &count));
pool.wait();
ASIO_CHECK(count == 6);
}
ASIO_TEST_SUITE
(
"any_executor",
ASIO_TEST_CASE(any_executor_construction_test)
ASIO_TEST_CASE(any_executor_nothrow_construction_test)
ASIO_TEST_CASE(any_executor_assignment_test)
ASIO_TEST_CASE(any_executor_swap_test)
ASIO_TEST_CASE(any_executor_query_test)
ASIO_TEST_CASE(any_executor_execute_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/execution/prefer_only.cpp | //
// prefer_only.cpp
// ~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/execution/prefer_only.hpp"
#include <functional>
#include "asio/execution/any_executor.hpp"
#include "../unit_test.hpp"
using namespace asio;
namespace bindns = std;
static int possibly_blocking_count = 0;
static int never_blocking_count = 0;
struct possibly_blocking_executor
{
template <typename F>
void execute(const F&) const
{
++possibly_blocking_count;
}
friend bool operator==(const possibly_blocking_executor&,
const possibly_blocking_executor&) noexcept
{
return true;
}
friend bool operator!=(const possibly_blocking_executor&,
const possibly_blocking_executor&) noexcept
{
return false;
}
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename F>
struct execute_member<possibly_blocking_executor, F>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <>
struct equality_comparable<possibly_blocking_executor>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
} // namespace traits
} // namespace asio
struct never_blocking_executor
{
static constexpr execution::blocking_t::never_t
query(execution::blocking_t) noexcept
{
return execution::blocking_t::never_t();
}
template <typename F>
void execute(const F&) const
{
++never_blocking_count;
}
friend bool operator==(const never_blocking_executor&,
const never_blocking_executor&) noexcept
{
return true;
}
friend bool operator!=(const never_blocking_executor&,
const never_blocking_executor&) noexcept
{
return false;
}
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename F>
struct execute_member<never_blocking_executor, F>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <>
struct equality_comparable<never_blocking_executor>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
template <typename Param>
struct query_static_constexpr_member<
never_blocking_executor, Param,
typename asio::enable_if<
asio::is_convertible<Param, execution::blocking_t>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef execution::blocking_t::never_t result_type;
static constexpr result_type value()
{
return result_type();
}
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
struct either_blocking_executor
{
execution::blocking_t blocking_;
explicit either_blocking_executor(execution::blocking_t b)
: blocking_(b)
{
}
execution::blocking_t query(execution::blocking_t) const noexcept
{
return blocking_;
}
either_blocking_executor require(execution::blocking_t::possibly_t) const
{
return either_blocking_executor(execution::blocking.possibly);
}
either_blocking_executor require(execution::blocking_t::never_t) const
{
return either_blocking_executor(execution::blocking.never);
}
template <typename F>
void execute(const F&) const
{
if (blocking_ == execution::blocking.never)
++never_blocking_count;
else
++possibly_blocking_count;
}
friend bool operator==(const either_blocking_executor& a,
const either_blocking_executor& b) noexcept
{
return a.blocking_ == b.blocking_;
}
friend bool operator!=(const either_blocking_executor& a,
const either_blocking_executor& b) noexcept
{
return a.blocking_ != b.blocking_;
}
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename F>
struct execute_member<either_blocking_executor, F>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <>
struct equality_comparable<either_blocking_executor>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename Param>
struct query_member<
either_blocking_executor, Param,
typename asio::enable_if<
asio::is_convertible<Param, execution::blocking_t>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef execution::blocking_t result_type;
};
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename Param>
struct require_member<
either_blocking_executor, Param,
typename asio::enable_if<
asio::is_convertible<Param, execution::blocking_t>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = false;
typedef either_blocking_executor result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
void prefer_only_executor_query_test()
{
typedef execution::any_executor<
execution::blocking_t,
execution::prefer_only<execution::blocking_t::possibly_t>,
execution::prefer_only<execution::blocking_t::never_t>
> executor_type;
executor_type ex1 = possibly_blocking_executor();
ASIO_CHECK(
asio::query(ex1, execution::blocking)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex1, execution::blocking.possibly)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex1, execution::blocking.never)
== execution::blocking.possibly);
executor_type ex2 = asio::prefer(ex1, execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex2, execution::blocking)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex2, execution::blocking.possibly)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex2, execution::blocking.never)
== execution::blocking.possibly);
executor_type ex3 = asio::prefer(ex1, execution::blocking.never);
ASIO_CHECK(
asio::query(ex3, execution::blocking)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex3, execution::blocking.possibly)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex3, execution::blocking.never)
== execution::blocking.possibly);
executor_type ex4 = never_blocking_executor();
ASIO_CHECK(
asio::query(ex4, execution::blocking)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex4, execution::blocking.possibly)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex4, execution::blocking.never)
== execution::blocking.never);
executor_type ex5 = asio::prefer(ex4, execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex5, execution::blocking)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex5, execution::blocking.possibly)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex5, execution::blocking.never)
== execution::blocking.never);
executor_type ex6 = asio::prefer(ex4, execution::blocking.never);
ASIO_CHECK(
asio::query(ex6, execution::blocking)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex6, execution::blocking.possibly)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex6, execution::blocking.never)
== execution::blocking.never);
executor_type ex7 = either_blocking_executor(execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex7, execution::blocking)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex7, execution::blocking.possibly)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex7, execution::blocking.never)
== execution::blocking.possibly);
executor_type ex8 = asio::prefer(ex7, execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex8, execution::blocking)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex8, execution::blocking.possibly)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex8, execution::blocking.never)
== execution::blocking.possibly);
executor_type ex9 = asio::prefer(ex7, execution::blocking.never);
ASIO_CHECK(
asio::query(ex9, execution::blocking)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex9, execution::blocking.possibly)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex9, execution::blocking.never)
== execution::blocking.never);
executor_type ex10 = either_blocking_executor(execution::blocking.never);
ASIO_CHECK(
asio::query(ex10, execution::blocking)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex10, execution::blocking.possibly)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex10, execution::blocking.never)
== execution::blocking.never);
executor_type ex11 = asio::prefer(ex7, execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex11, execution::blocking)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex11, execution::blocking.possibly)
== execution::blocking.possibly);
ASIO_CHECK(
asio::query(ex11, execution::blocking.never)
== execution::blocking.possibly);
executor_type ex12 = asio::prefer(ex7, execution::blocking.never);
ASIO_CHECK(
asio::query(ex12, execution::blocking)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex12, execution::blocking.possibly)
== execution::blocking.never);
ASIO_CHECK(
asio::query(ex12, execution::blocking.never)
== execution::blocking.never);
}
void do_nothing()
{
}
void prefer_only_executor_execute_test()
{
typedef execution::any_executor<
execution::blocking_t,
execution::prefer_only<execution::blocking_t::possibly_t>,
execution::prefer_only<execution::blocking_t::never_t>
> executor_type;
executor_type ex1 = possibly_blocking_executor();
ex1.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 1);
ASIO_CHECK(never_blocking_count == 0);
executor_type ex2 = asio::prefer(ex1, execution::blocking.possibly);
ex2.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 2);
ASIO_CHECK(never_blocking_count == 0);
executor_type ex3 = asio::prefer(ex1, execution::blocking.never);
ex3.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 3);
ASIO_CHECK(never_blocking_count == 0);
executor_type ex4 = never_blocking_executor();
ex4.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 3);
ASIO_CHECK(never_blocking_count == 1);
executor_type ex5 = asio::prefer(ex4, execution::blocking.possibly);
ex5.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 3);
ASIO_CHECK(never_blocking_count == 2);
executor_type ex6 = asio::prefer(ex4, execution::blocking.never);
ex6.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 3);
ASIO_CHECK(never_blocking_count == 3);
executor_type ex7 = either_blocking_executor(execution::blocking.possibly);
ex7.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 4);
ASIO_CHECK(never_blocking_count == 3);
executor_type ex8 = asio::prefer(ex7, execution::blocking.possibly);
ex8.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 5);
ASIO_CHECK(never_blocking_count == 3);
executor_type ex9 = asio::prefer(ex7, execution::blocking.never);
ex9.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 5);
ASIO_CHECK(never_blocking_count == 4);
executor_type ex10 = either_blocking_executor(execution::blocking.never);
ex10.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 5);
ASIO_CHECK(never_blocking_count == 5);
executor_type ex11 = asio::prefer(ex7, execution::blocking.possibly);
ex11.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 6);
ASIO_CHECK(never_blocking_count == 5);
executor_type ex12 = asio::prefer(ex7, execution::blocking.never);
ex12.execute(&do_nothing);
ASIO_CHECK(possibly_blocking_count == 6);
ASIO_CHECK(never_blocking_count == 6);
}
ASIO_TEST_SUITE
(
"prefer_only",
ASIO_TEST_CASE(prefer_only_executor_query_test)
ASIO_TEST_CASE(prefer_only_executor_execute_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/execution/context_as.cpp | //
// context_as.cpp
// ~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/execution/context_as.hpp"
#include <functional>
#include "asio/execution/any_executor.hpp"
#include "asio/io_context.hpp"
#include "asio/static_thread_pool.hpp"
#include "../unit_test.hpp"
using namespace asio;
namespace bindns = std;
void context_as_executor_query_test()
{
static_thread_pool pool(1);
ASIO_CHECK(
&asio::query(pool.executor(),
execution::context_as_t<static_thread_pool&>())
== &pool);
execution::any_executor<
execution::context_as_t<static_thread_pool&>
> ex1 = pool.executor();
ASIO_CHECK(
&asio::query(ex1,
execution::context_as_t<static_thread_pool&>())
== &pool);
ASIO_CHECK(
&asio::query(ex1, execution::context)
== &pool);
ASIO_CHECK(
&asio::query(pool.executor(),
execution::context_as_t<const static_thread_pool&>())
== &pool);
execution::any_executor<
execution::context_as_t<const static_thread_pool&>
> ex2 = pool.executor();
ASIO_CHECK(
&asio::query(ex2,
execution::context_as_t<const static_thread_pool&>())
== &pool);
ASIO_CHECK(
&asio::query(ex2, execution::context)
== &pool);
io_context io_ctx;
ASIO_CHECK(
&asio::query(io_ctx.get_executor(),
execution::context_as_t<io_context&>())
== &io_ctx);
execution::any_executor<
execution::context_as_t<io_context&>
> ex3 = io_ctx.get_executor();
ASIO_CHECK(
&asio::query(ex3,
execution::context_as_t<io_context&>())
== &io_ctx);
ASIO_CHECK(
&asio::query(ex3, execution::context)
== &io_ctx);
ASIO_CHECK(
&asio::query(io_ctx.get_executor(),
execution::context_as_t<const io_context&>())
== &io_ctx);
execution::any_executor<
execution::context_as_t<const io_context&>
> ex4 = io_ctx.get_executor();
ASIO_CHECK(
&asio::query(ex4,
execution::context_as_t<const io_context&>())
== &io_ctx);
ASIO_CHECK(
&asio::query(ex4, execution::context)
== &io_ctx);
ASIO_CHECK(
&asio::query(io_ctx.get_executor(),
execution::context_as_t<execution_context&>())
== &io_ctx);
execution::any_executor<
execution::context_as_t<execution_context&>
> ex5 = io_ctx.get_executor();
ASIO_CHECK(
&asio::query(ex5,
execution::context_as_t<execution_context&>())
== &io_ctx);
ASIO_CHECK(
&asio::query(ex5, execution::context)
== &io_ctx);
ASIO_CHECK(
&asio::query(io_ctx.get_executor(),
execution::context_as_t<const execution_context&>())
== &io_ctx);
execution::any_executor<
execution::context_as_t<const execution_context&>
> ex6 = io_ctx.get_executor();
ASIO_CHECK(
&asio::query(ex6,
execution::context_as_t<const execution_context&>())
== &io_ctx);
ASIO_CHECK(
&asio::query(ex6, execution::context)
== &io_ctx);
}
ASIO_TEST_SUITE
(
"context_as",
ASIO_TEST_CASE(context_as_executor_query_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/execution/relationship.cpp | //
// relationship.cpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/execution/relationship.hpp"
#include "asio/prefer.hpp"
#include "asio/query.hpp"
#include "asio/require.hpp"
#include "../unit_test.hpp"
namespace exec = asio::execution;
typedef exec::relationship_t s;
typedef exec::relationship_t::fork_t n1;
typedef exec::relationship_t::continuation_t n2;
struct ex_nq_nr
{
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <>
struct is_executor<ex_nq_nr> : asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
template <typename ResultType, typename ParamType, typename Result>
struct ex_cq_nr
{
static constexpr ResultType query(ParamType) noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_cq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_static_constexpr_member<
ex_cq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef Result result_type; // Must return raw result type.
static constexpr result_type value()
{
return Result();
}
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_mq_nr
{
ResultType query(ParamType) const noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_mq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_member<
ex_mq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_fq_nr
{
friend ResultType query(const ex_fq_nr&, ParamType) noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_fq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_free<
ex_fq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
} // namespace traits
} // namespace asio
template <typename CurrentType, typename OtherType>
struct ex_mq_mr
{
CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
CurrentType query(OtherType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, OtherType> require(
CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, OtherType>();
}
ex_mq_mr<OtherType, CurrentType> require(
OtherType) const noexcept
{
return ex_mq_mr<OtherType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
};
template <typename CurrentType>
struct ex_mq_mr<CurrentType, CurrentType>
{
CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, CurrentType> require(
CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename CurrentType, typename OtherType>
struct is_executor<ex_mq_mr<CurrentType, OtherType> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct query_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct require_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_mq_mr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct require_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_mq_mr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename CurrentType, typename OtherType>
struct ex_fq_fr
{
friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend CurrentType query(const ex_fq_fr&, OtherType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, OtherType> require(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> require(
const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
friend ex_fq_fr<CurrentType, OtherType> prefer(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> prefer(
const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
};
template <typename CurrentType>
struct ex_fq_fr<CurrentType, CurrentType>
{
friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, CurrentType> require(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
friend ex_fq_fr<CurrentType, CurrentType> prefer(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename CurrentType, typename OtherType>
struct is_executor<ex_fq_fr<CurrentType, OtherType> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct query_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct require_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct require_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct prefer_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct prefer_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
} // namespace traits
} // namespace asio
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_query()
{
constexpr bool b1 =
asio::can_query<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_query<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_query<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_query<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_query()
{
exec::relationship_t result1 = asio::query(Executor(), Param());
ASIO_CHECK(result1 == ExpectedResult());
Executor ex1 = {};
exec::relationship_t result2 = asio::query(ex1, Param());
ASIO_CHECK(result2 == ExpectedResult());
const Executor ex2 = {};
exec::relationship_t result3 = asio::query(ex2, Param());
ASIO_CHECK(result3 == ExpectedResult());
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_constexpr_query()
{
constexpr Executor ex1 = {};
constexpr exec::relationship_t result1 = asio::query(ex1, Param());
ASIO_CHECK(result1 == ExpectedResult());
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_require()
{
constexpr bool b1 =
asio::can_require<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_require<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_require<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_require<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_require()
{
ASIO_CHECK(
asio::query(
asio::require(Executor(), Param()),
Param()) == ExpectedResult());
Executor ex1 = {};
ASIO_CHECK(
asio::query(
asio::require(ex1, Param()),
Param()) == ExpectedResult());
const Executor ex2 = {};
ASIO_CHECK(
asio::query(
asio::require(ex2, Param()),
Param()) == ExpectedResult());
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_prefer()
{
constexpr bool b1 =
asio::can_prefer<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_prefer<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_prefer<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_prefer<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_prefer()
{
ASIO_CHECK(
s(asio::query(
asio::prefer(Executor(), Param()),
s())) == s(ExpectedResult()));
Executor ex1 = {};
ASIO_CHECK(
s(asio::query(
asio::prefer(ex1, Param()),
s())) == s(ExpectedResult()));
const Executor ex2 = {};
ASIO_CHECK(
s(asio::query(
asio::prefer(ex2, Param()),
s())) == s(ExpectedResult()));
}
void test_vars()
{
ASIO_CHECK(s() == exec::relationship);
ASIO_CHECK(s() != exec::relationship.fork);
ASIO_CHECK(s() != exec::relationship.continuation);
ASIO_CHECK(n1() == exec::relationship.fork);
ASIO_CHECK(n1() != exec::relationship.continuation);
ASIO_CHECK(n2() == exec::relationship.continuation);
ASIO_CHECK(n2() != exec::relationship.fork);
}
ASIO_TEST_SUITE
(
"relationship",
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, s, true>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_query<ex_nq_nr, s, n1>)
ASIO_TEST_CASE3(test_query<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, s, n1>)
ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, s, false>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_require<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, s, false>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n2, true>)
ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n2, n1>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n2, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n2, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE(test_vars)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/execution/mapping.cpp | //
// mapping.cpp
// ~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/execution/mapping.hpp"
#include "asio/prefer.hpp"
#include "asio/query.hpp"
#include "asio/require.hpp"
#include "../unit_test.hpp"
namespace exec = asio::execution;
typedef exec::mapping_t s;
typedef exec::mapping_t::thread_t n1;
typedef exec::mapping_t::new_thread_t n2;
typedef exec::mapping_t::other_t n3;
struct ex_nq_nr
{
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <>
struct is_executor<ex_nq_nr> : asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
template <typename ResultType, typename ParamType, typename Result>
struct ex_cq_nr
{
static constexpr ResultType query(ParamType) noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_cq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_static_constexpr_member<
ex_cq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef Result result_type; // Must return raw result type.
static constexpr result_type value()
{
return Result();
}
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_mq_nr
{
ResultType query(ParamType) const noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_mq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_member<
ex_mq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_fq_nr
{
friend ResultType query(const ex_fq_nr&, ParamType) noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_fq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_free<
ex_fq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
} // namespace traits
} // namespace asio
template <typename CurrentType, typename OtherType>
struct ex_mq_mr
{
CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
CurrentType query(OtherType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, OtherType> require(
CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, OtherType>();
}
ex_mq_mr<OtherType, CurrentType> require(
OtherType) const noexcept
{
return ex_mq_mr<OtherType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
};
template <typename CurrentType>
struct ex_mq_mr<CurrentType, CurrentType>
{
CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, CurrentType> require(
CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename CurrentType, typename OtherType>
struct is_executor<ex_mq_mr<CurrentType, OtherType> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct query_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct require_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_mq_mr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct require_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_mq_mr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename CurrentType, typename OtherType>
struct ex_fq_fr
{
friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend CurrentType query(const ex_fq_fr&, OtherType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, OtherType> require(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> require(
const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
friend ex_fq_fr<CurrentType, OtherType> prefer(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> prefer(
const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
};
template <typename CurrentType>
struct ex_fq_fr<CurrentType, CurrentType>
{
friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, CurrentType> require(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
friend ex_fq_fr<CurrentType, CurrentType> prefer(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename CurrentType, typename OtherType>
struct is_executor<ex_fq_fr<CurrentType, OtherType> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct query_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct require_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct require_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct prefer_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct prefer_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
} // namespace traits
} // namespace asio
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_query()
{
constexpr bool b1 =
asio::can_query<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_query<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_query<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_query<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_query()
{
exec::mapping_t result1 = asio::query(Executor(), Param());
ASIO_CHECK(result1 == ExpectedResult());
Executor ex1 = {};
exec::mapping_t result2 = asio::query(ex1, Param());
ASIO_CHECK(result2 == ExpectedResult());
const Executor ex2 = {};
exec::mapping_t result3 = asio::query(ex2, Param());
ASIO_CHECK(result3 == ExpectedResult());
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_constexpr_query()
{
constexpr Executor ex1 = {};
constexpr exec::mapping_t result1 = asio::query(ex1, Param());
ASIO_CHECK(result1 == ExpectedResult());
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_require()
{
constexpr bool b1 =
asio::can_require<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_require<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_require<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_require<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_require()
{
ASIO_CHECK(
asio::query(
asio::require(Executor(), Param()),
Param()) == ExpectedResult());
Executor ex1 = {};
ASIO_CHECK(
asio::query(
asio::require(ex1, Param()),
Param()) == ExpectedResult());
const Executor ex2 = {};
ASIO_CHECK(
asio::query(
asio::require(ex2, Param()),
Param()) == ExpectedResult());
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_prefer()
{
constexpr bool b1 =
asio::can_prefer<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_prefer<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_prefer<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_prefer<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_prefer()
{
ASIO_CHECK(
s(asio::query(
asio::prefer(Executor(), Param()),
s())) == s(ExpectedResult()));
Executor ex1 = {};
ASIO_CHECK(
s(asio::query(
asio::prefer(ex1, Param()),
s())) == s(ExpectedResult()));
const Executor ex2 = {};
ASIO_CHECK(
s(asio::query(
asio::prefer(ex2, Param()),
s())) == s(ExpectedResult()));
}
void test_vars()
{
ASIO_CHECK(s() == exec::mapping);
ASIO_CHECK(s() != exec::mapping.thread);
ASIO_CHECK(s() != exec::mapping.new_thread);
ASIO_CHECK(s() != exec::mapping.other);
ASIO_CHECK(n1() == exec::mapping.thread);
ASIO_CHECK(n1() != exec::mapping.new_thread);
ASIO_CHECK(n1() != exec::mapping.other);
ASIO_CHECK(n2() == exec::mapping.new_thread);
ASIO_CHECK(n2() != exec::mapping.thread);
ASIO_CHECK(n2() != exec::mapping.other);
ASIO_CHECK(n3() == exec::mapping.other);
ASIO_CHECK(n3() != exec::mapping.thread);
ASIO_CHECK(n3() != exec::mapping.new_thread);
}
ASIO_TEST_SUITE
(
"mapping",
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, s, true>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n3, false>)
ASIO_TEST_CASE3(test_query<ex_nq_nr, s, n1>)
ASIO_TEST_CASE3(test_query<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, s, n1>)
ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, s, false>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n3, false>)
ASIO_TEST_CASE3(test_require<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, s, false>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n2, true>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n3, true>)
ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n2, n1>)
ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n3, n1>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n3>, s, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n3>, s, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n3>, s, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n3>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n3>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n3>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n1>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n2>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n3>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n3>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n3>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n3>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n2, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n3, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n3, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n3>, n2, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n3>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n3, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n3, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n3>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n3>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n3>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n1>, n2, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n2>, n1, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n2>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n3>, n1, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n3>, n2, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n3>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n3>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n3>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n1>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n2>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n3>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n3>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n3>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n3>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n2, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n3, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n3, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n3>, n2, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n3>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n3, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n3, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n3>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n3>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n3>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n1>, n2, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n2>, n1, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n2>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n3>, n1, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n3>, n2, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n3>, n3, n3>)
ASIO_TEST_CASE(test_vars)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/execution/executor.cpp | //
// executor.cpp
// ~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/execution/executor.hpp"
#include "../unit_test.hpp"
struct not_an_executor
{
};
struct executor
{
executor()
{
}
executor(const executor&) noexcept
{
}
executor(executor&&) noexcept
{
}
template <typename F>
void execute(F&& f) const noexcept
{
(void)f;
}
bool operator==(const executor&) const noexcept
{
return true;
}
bool operator!=(const executor&) const noexcept
{
return false;
}
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename F>
struct execute_member<executor, F>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <>
struct equality_comparable<executor>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
} // namespace traits
} // namespace asio
void is_executor_test()
{
ASIO_CHECK((
!asio::execution::is_executor<
void
>::value));
ASIO_CHECK((
!asio::execution::is_executor<
not_an_executor
>::value));
ASIO_CHECK((
asio::execution::is_executor<
executor
>::value));
}
ASIO_TEST_SUITE
(
"executor",
ASIO_TEST_CASE(is_executor_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/execution/outstanding_work.cpp | //
// outstanding_work.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/execution/outstanding_work.hpp"
#include "asio/prefer.hpp"
#include "asio/query.hpp"
#include "asio/require.hpp"
#include "../unit_test.hpp"
namespace exec = asio::execution;
typedef exec::outstanding_work_t s;
typedef exec::outstanding_work_t::untracked_t n1;
typedef exec::outstanding_work_t::tracked_t n2;
struct ex_nq_nr
{
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <>
struct is_executor<ex_nq_nr> : asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
template <typename ResultType, typename ParamType, typename Result>
struct ex_cq_nr
{
static constexpr ResultType query(ParamType) noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_cq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_static_constexpr_member<
ex_cq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef Result result_type; // Must return raw result type.
static constexpr result_type value()
{
return Result();
}
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_mq_nr
{
ResultType query(ParamType) const noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_mq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_member<
ex_mq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_fq_nr
{
friend ResultType query(const ex_fq_nr&, ParamType) noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_fq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_free<
ex_fq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
} // namespace traits
} // namespace asio
template <typename CurrentType, typename OtherType>
struct ex_mq_mr
{
CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
CurrentType query(OtherType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, OtherType> require(
CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, OtherType>();
}
ex_mq_mr<OtherType, CurrentType> require(
OtherType) const noexcept
{
return ex_mq_mr<OtherType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
};
template <typename CurrentType>
struct ex_mq_mr<CurrentType, CurrentType>
{
CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, CurrentType> require(
CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename CurrentType, typename OtherType>
struct is_executor<ex_mq_mr<CurrentType, OtherType> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct query_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct require_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_mq_mr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct require_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_mq_mr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename CurrentType, typename OtherType>
struct ex_fq_fr
{
friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend CurrentType query(const ex_fq_fr&, OtherType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, OtherType> require(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> require(
const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
friend ex_fq_fr<CurrentType, OtherType> prefer(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> prefer(
const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
};
template <typename CurrentType>
struct ex_fq_fr<CurrentType, CurrentType>
{
friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, CurrentType> require(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
friend ex_fq_fr<CurrentType, CurrentType> prefer(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename CurrentType, typename OtherType>
struct is_executor<ex_fq_fr<CurrentType, OtherType> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct query_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct require_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct require_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct prefer_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct prefer_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
} // namespace traits
} // namespace asio
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_query()
{
constexpr bool b1 =
asio::can_query<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_query<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_query<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_query<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_query()
{
exec::outstanding_work_t result1 = asio::query(Executor(), Param());
ASIO_CHECK(result1 == ExpectedResult());
Executor ex1 = {};
exec::outstanding_work_t result2 = asio::query(ex1, Param());
ASIO_CHECK(result2 == ExpectedResult());
const Executor ex2 = {};
exec::outstanding_work_t result3 = asio::query(ex2, Param());
ASIO_CHECK(result3 == ExpectedResult());
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_constexpr_query()
{
constexpr Executor ex1 = {};
constexpr exec::outstanding_work_t result1 = asio::query(ex1, Param());
ASIO_CHECK(result1 == ExpectedResult());
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_require()
{
constexpr bool b1 =
asio::can_require<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_require<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_require<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_require<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_require()
{
ASIO_CHECK(
asio::query(
asio::require(Executor(), Param()),
Param()) == ExpectedResult());
Executor ex1 = {};
ASIO_CHECK(
asio::query(
asio::require(ex1, Param()),
Param()) == ExpectedResult());
const Executor ex2 = {};
ASIO_CHECK(
asio::query(
asio::require(ex2, Param()),
Param()) == ExpectedResult());
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_prefer()
{
constexpr bool b1 =
asio::can_prefer<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_prefer<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_prefer<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_prefer<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_prefer()
{
ASIO_CHECK(
s(asio::query(
asio::prefer(Executor(), Param()),
s())) == s(ExpectedResult()));
Executor ex1 = {};
ASIO_CHECK(
s(asio::query(
asio::prefer(ex1, Param()),
s())) == s(ExpectedResult()));
const Executor ex2 = {};
ASIO_CHECK(
s(asio::query(
asio::prefer(ex2, Param()),
s())) == s(ExpectedResult()));
}
void test_vars()
{
ASIO_CHECK(s() == exec::outstanding_work);
ASIO_CHECK(s() != exec::outstanding_work.untracked);
ASIO_CHECK(s() != exec::outstanding_work.tracked);
ASIO_CHECK(n1() == exec::outstanding_work.untracked);
ASIO_CHECK(n1() != exec::outstanding_work.tracked);
ASIO_CHECK(n2() == exec::outstanding_work.tracked);
ASIO_CHECK(n2() != exec::outstanding_work.untracked);
}
ASIO_TEST_SUITE
(
"outstanding_work",
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, s, true>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_query<ex_nq_nr, s, n1>)
ASIO_TEST_CASE3(test_query<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, s, n1>)
ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, s, false>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_require<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, s, false>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n2, true>)
ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n2, n1>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n2, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n2, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE(test_vars)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/execution/blocking.cpp | //
// blocking.cpp
// ~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/execution/blocking.hpp"
#include "asio/prefer.hpp"
#include "asio/query.hpp"
#include "asio/require.hpp"
#include "../unit_test.hpp"
namespace exec = asio::execution;
typedef exec::blocking_t s;
typedef exec::blocking_t::possibly_t n1;
typedef exec::blocking_t::always_t n2;
typedef exec::blocking_t::never_t n3;
struct ex_nq_nr
{
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <>
struct is_executor<ex_nq_nr> : asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
template <typename ResultType, typename ParamType, typename Result>
struct ex_cq_nr
{
static constexpr ResultType query(ParamType) noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_cq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_static_constexpr_member<
ex_cq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef Result result_type; // Must return raw result type.
static constexpr result_type value()
{
return Result();
}
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_mq_nr
{
ResultType query(ParamType) const noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_mq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_member<
ex_mq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_fq_nr
{
friend ResultType query(const ex_fq_nr&, ParamType) noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename ResultType, typename ParamType, typename Result>
struct is_executor<ex_fq_nr<ResultType, ParamType, Result> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_free<
ex_fq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
} // namespace traits
} // namespace asio
template <typename CurrentType, typename OtherType>
struct ex_mq_mr
{
CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
CurrentType query(OtherType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, OtherType> require(
CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, OtherType>();
}
ex_mq_mr<OtherType, CurrentType> require(
OtherType) const noexcept
{
return ex_mq_mr<OtherType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
};
template <typename CurrentType>
struct ex_mq_mr<CurrentType, CurrentType>
{
CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, CurrentType> require(
CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename CurrentType, typename OtherType>
struct is_executor<ex_mq_mr<CurrentType, OtherType> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct query_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct require_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_mq_mr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct require_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_mq_mr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename CurrentType, typename OtherType>
struct ex_fq_fr
{
friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend CurrentType query(const ex_fq_fr&, OtherType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, OtherType> require(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> require(
const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
friend ex_fq_fr<CurrentType, OtherType> prefer(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> prefer(
const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
};
template <typename CurrentType>
struct ex_fq_fr<CurrentType, CurrentType>
{
friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, CurrentType> require(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
friend ex_fq_fr<CurrentType, CurrentType> prefer(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
};
#if !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace execution {
template <typename CurrentType, typename OtherType>
struct is_executor<ex_fq_fr<CurrentType, OtherType> >
: asio::true_type
{
};
} // namespace execution
} // namespace asio
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTION_IS_EXECUTOR_TRAIT)
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct query_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct require_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct require_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct prefer_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct prefer_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
} // namespace traits
} // namespace asio
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_query()
{
constexpr bool b1 =
asio::can_query<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_query<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_query<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_query<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_query()
{
exec::blocking_t result1 = asio::query(Executor(), Param());
ASIO_CHECK(result1 == ExpectedResult());
Executor ex1 = {};
exec::blocking_t result2 = asio::query(ex1, Param());
ASIO_CHECK(result2 == ExpectedResult());
const Executor ex2 = {};
exec::blocking_t result3 = asio::query(ex2, Param());
ASIO_CHECK(result3 == ExpectedResult());
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_constexpr_query()
{
constexpr Executor ex1 = {};
constexpr exec::blocking_t result1 = asio::query(ex1, Param());
ASIO_CHECK(result1 == ExpectedResult());
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_require()
{
constexpr bool b1 =
asio::can_require<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_require<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_require<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_require<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_require()
{
ASIO_CHECK(
asio::query(
asio::require(Executor(), Param()),
Param()) == ExpectedResult());
Executor ex1 = {};
ASIO_CHECK(
asio::query(
asio::require(ex1, Param()),
Param()) == ExpectedResult());
const Executor ex2 = {};
ASIO_CHECK(
asio::query(
asio::require(ex2, Param()),
Param()) == ExpectedResult());
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_prefer()
{
constexpr bool b1 =
asio::can_prefer<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_prefer<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_prefer<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_prefer<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_prefer()
{
ASIO_CHECK(
s(asio::query(
asio::prefer(Executor(), Param()),
s())) == s(ExpectedResult()));
Executor ex1 = {};
ASIO_CHECK(
s(asio::query(
asio::prefer(ex1, Param()),
s())) == s(ExpectedResult()));
const Executor ex2 = {};
ASIO_CHECK(
s(asio::query(
asio::prefer(ex2, Param()),
s())) == s(ExpectedResult()));
}
void test_vars()
{
ASIO_CHECK(s() == exec::blocking);
ASIO_CHECK(s() != exec::blocking.possibly);
ASIO_CHECK(s() != exec::blocking.always);
ASIO_CHECK(s() != exec::blocking.never);
ASIO_CHECK(n1() == exec::blocking.possibly);
ASIO_CHECK(n1() != exec::blocking.always);
ASIO_CHECK(n1() != exec::blocking.never);
ASIO_CHECK(n2() == exec::blocking.always);
ASIO_CHECK(n2() != exec::blocking.possibly);
ASIO_CHECK(n2() != exec::blocking.never);
ASIO_CHECK(n3() == exec::blocking.never);
ASIO_CHECK(n3() != exec::blocking.possibly);
ASIO_CHECK(n3() != exec::blocking.always);
}
ASIO_TEST_SUITE
(
"blocking",
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, s, true>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n3, false>)
ASIO_TEST_CASE3(test_query<ex_nq_nr, s, n1>)
ASIO_TEST_CASE3(test_query<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, s, n1>)
ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, s, false>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n3, false>)
ASIO_TEST_CASE3(test_require<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, s, false>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n3, true>)
ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n3, n1>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n3>, s, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n3>, s, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n3>, s, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n3, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n3, s, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, s, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, n2, n3>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n3, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n3, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n3, s, n3>, n3, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n3, n3>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n3, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n3, s, n3>, n3, true>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n3, n3>, n3, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n3, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n3, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n3, s, n3>, n1, n3>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n3, s, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n3>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n3>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n3>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n1>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n2>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n3>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n3, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n3>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n3>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n3>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n3, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n3, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n3, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n3>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n3, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n3, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n3>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n3>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n2>, n1, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n3>, n1, n3>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n3, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n3>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n3>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n3>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n1>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n2>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n3>, s, n3>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n3, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n3, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n3>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n3>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n3>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n3, n3>, n3, n3>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n3>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n1>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n2>, n3, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n3, n3>, n3, true>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n3, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n3, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n3>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n3>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n3, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n3, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n3>, n1, n2>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n3>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n1>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n2>, n1, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n2>, n3, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n3>, n1, n3>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n3, n3>, n3, n3>)
ASIO_TEST_CASE(test_vars)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/execution/blocking_adaptation.cpp | //
// blocking_adaptation.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/execution/blocking_adaptation.hpp"
#include "asio/prefer.hpp"
#include "asio/query.hpp"
#include "asio/require.hpp"
#include "../unit_test.hpp"
namespace exec = asio::execution;
typedef exec::blocking_adaptation_t s;
typedef exec::blocking_adaptation_t::disallowed_t n1;
typedef exec::blocking_adaptation_t::allowed_t n2;
struct ex_nq_nr
{
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_nq_nr&, const ex_nq_nr&) noexcept
{
return false;
}
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <>
struct equality_comparable<ex_nq_nr>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename Function>
struct execute_member<ex_nq_nr, Function>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = false;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_cq_nr
{
static constexpr ResultType query(ParamType) noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_cq_nr&, const ex_cq_nr&) noexcept
{
return false;
}
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <typename ResultType, typename ParamType, typename Result>
struct equality_comparable<ex_cq_nr<ResultType, ParamType, Result> >
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Function>
struct execute_member<ex_cq_nr<ResultType, ParamType, Result>, Function>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = false;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_static_constexpr_member<
ex_cq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef Result result_type; // Must return raw result type.
static constexpr result_type value()
{
return Result();
}
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_STATIC_CONSTEXPR_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_mq_nr
{
ResultType query(ParamType) const noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_nr&, const ex_mq_nr&) noexcept
{
return false;
}
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <typename ResultType, typename ParamType, typename Result>
struct equality_comparable<ex_mq_nr<ResultType, ParamType, Result> >
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Function>
struct execute_member<ex_mq_nr<ResultType, ParamType, Result>, Function>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = false;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_member<
ex_mq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename ResultType, typename ParamType, typename Result>
struct ex_fq_nr
{
friend ResultType query(const ex_fq_nr&, ParamType) noexcept
{
return Result();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_nr&, const ex_fq_nr&) noexcept
{
return false;
}
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <typename ResultType, typename ParamType, typename Result>
struct equality_comparable<ex_fq_nr<ResultType, ParamType, Result> >
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Function>
struct execute_member<ex_fq_nr<ResultType, ParamType, Result>, Function>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = false;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename ResultType, typename ParamType,
typename Result, typename Param>
struct query_free<
ex_fq_nr<ResultType, ParamType, Result>, Param,
typename asio::enable_if<
asio::is_convertible<Param, ParamType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ResultType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
} // namespace traits
} // namespace asio
template <typename CurrentType, typename OtherType>
struct ex_mq_mr
{
CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
CurrentType query(OtherType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, OtherType> require(
CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, OtherType>();
}
ex_mq_mr<OtherType, CurrentType> require(
OtherType) const noexcept
{
return ex_mq_mr<OtherType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
};
template <typename CurrentType>
struct ex_mq_mr<CurrentType, CurrentType>
{
CurrentType query(CurrentType) const noexcept
{
return CurrentType();
}
ex_mq_mr<CurrentType, CurrentType> require(
CurrentType) const noexcept
{
return ex_mq_mr<CurrentType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return true;
}
friend bool operator!=(const ex_mq_mr&, const ex_mq_mr&) noexcept
{
return false;
}
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <typename CurrentType, typename OtherType>
struct equality_comparable<ex_mq_mr<CurrentType, OtherType> >
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Function>
struct execute_member<ex_mq_mr<CurrentType, OtherType>, Function>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = false;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct query_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct require_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_mq_mr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct require_member<
ex_mq_mr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_mq_mr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_MEMBER_TRAIT)
} // namespace traits
} // namespace asio
template <typename CurrentType, typename OtherType>
struct ex_fq_fr
{
friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend CurrentType query(const ex_fq_fr&, OtherType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, OtherType> require(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> require(
const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
friend ex_fq_fr<CurrentType, OtherType> prefer(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, OtherType>();
}
friend ex_fq_fr<OtherType, CurrentType> prefer(
const ex_fq_fr&, OtherType) noexcept
{
return ex_fq_fr<OtherType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
};
template <typename CurrentType>
struct ex_fq_fr<CurrentType, CurrentType>
{
friend CurrentType query(const ex_fq_fr&, CurrentType) noexcept
{
return CurrentType();
}
friend ex_fq_fr<CurrentType, CurrentType> require(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
friend ex_fq_fr<CurrentType, CurrentType> prefer(
const ex_fq_fr&, CurrentType) noexcept
{
return ex_fq_fr<CurrentType, CurrentType>();
}
template <typename F>
void execute(const F&) const
{
}
friend bool operator==(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return true;
}
friend bool operator!=(const ex_fq_fr&, const ex_fq_fr&) noexcept
{
return false;
}
};
namespace asio {
namespace traits {
#if !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
template <typename CurrentType, typename OtherType>
struct equality_comparable<ex_fq_fr<CurrentType, OtherType> >
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
};
#endif // !defined(ASIO_HAS_DEDUCED_EQUALITY_COMPARABLE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
template <typename CurrentType, typename OtherType, typename Function>
struct execute_member<ex_fq_fr<CurrentType, OtherType>, Function>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = false;
typedef void result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_EXECUTE_MEMBER_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct query_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
|| asio::is_convertible<Param, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef CurrentType result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_QUERY_FREE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct require_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct require_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_REQUIRE_FREE_TRAIT)
#if !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
template <typename CurrentType, typename OtherType, typename Param>
struct prefer_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, CurrentType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<CurrentType, OtherType> result_type;
};
template <typename CurrentType, typename OtherType, typename Param>
struct prefer_free<
ex_fq_fr<CurrentType, OtherType>, Param,
typename asio::enable_if<
asio::is_convertible<Param, OtherType>::value
&& !asio::is_same<CurrentType, OtherType>::value
>::type>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef ex_fq_fr<OtherType, CurrentType> result_type;
};
#endif // !defined(ASIO_HAS_DEDUCED_PREFER_FREE_TRAIT)
} // namespace traits
} // namespace asio
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_query()
{
constexpr bool b1 =
asio::can_query<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_query<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_query<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_query<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_query()
{
exec::blocking_adaptation_t result1 = asio::query(Executor(), Param());
ASIO_CHECK(result1 == ExpectedResult());
Executor ex1 = {};
exec::blocking_adaptation_t result2 = asio::query(ex1, Param());
ASIO_CHECK(result2 == ExpectedResult());
const Executor ex2 = {};
exec::blocking_adaptation_t result3 = asio::query(ex2, Param());
ASIO_CHECK(result3 == ExpectedResult());
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_constexpr_query()
{
constexpr Executor ex1 = {};
constexpr exec::blocking_adaptation_t result1 = asio::query(ex1, Param());
ASIO_CHECK(result1 == ExpectedResult());
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_require()
{
constexpr bool b1 =
asio::can_require<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_require<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_require<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_require<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
void do_nothing()
{
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_require()
{
ASIO_CHECK(
asio::query(
asio::require(Executor(), Param()),
Param()) == ExpectedResult());
Executor ex1 = {};
ASIO_CHECK(
asio::query(
asio::require(ex1, Param()),
Param()) == ExpectedResult());
ASIO_CHECK((
asio::execution::is_executor<
typename asio::decay<
typename asio::require_result<Executor&, Param>::type
>::type
>::value));
const Executor ex2 = {};
ASIO_CHECK(
asio::query(
asio::require(ex2, Param()),
Param()) == ExpectedResult());
ASIO_CHECK((
asio::execution::is_executor<
typename asio::decay<
typename asio::require_result<const Executor&, Param>::type
>::type
>::value));
}
template <typename Executor, typename Param, bool ExpectedResult>
void test_can_prefer()
{
constexpr bool b1 =
asio::can_prefer<Executor, Param>::value;
ASIO_CHECK(b1 == ExpectedResult);
constexpr bool b2 =
asio::can_prefer<const Executor, Param>::value;
ASIO_CHECK(b2 == ExpectedResult);
constexpr bool b3 =
asio::can_prefer<Executor&, Param>::value;
ASIO_CHECK(b3 == ExpectedResult);
constexpr bool b4 =
asio::can_prefer<const Executor&, Param>::value;
ASIO_CHECK(b4 == ExpectedResult);
}
template <typename Executor, typename Param, typename ExpectedResult>
void test_prefer()
{
ASIO_CHECK(
s(asio::query(
asio::prefer(Executor(), Param()),
s())) == s(ExpectedResult()));
Executor ex1 = {};
ASIO_CHECK(
s(asio::query(
asio::prefer(ex1, Param()),
s())) == s(ExpectedResult()));
const Executor ex2 = {};
ASIO_CHECK(
s(asio::query(
asio::prefer(ex2, Param()),
s())) == s(ExpectedResult()));
}
void test_vars()
{
ASIO_CHECK(s() == exec::blocking_adaptation);
ASIO_CHECK(s() != exec::blocking_adaptation.disallowed);
ASIO_CHECK(s() != exec::blocking_adaptation.allowed);
ASIO_CHECK(n1() == exec::blocking_adaptation.disallowed);
ASIO_CHECK(n1() != exec::blocking_adaptation.allowed);
ASIO_CHECK(n2() == exec::blocking_adaptation.allowed);
ASIO_CHECK(n2() != exec::blocking_adaptation.disallowed);
}
ASIO_TEST_SUITE
(
"blocking_adaptation",
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, s, true>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_query<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_query<ex_nq_nr, s, n1>)
ASIO_TEST_CASE3(test_query<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, s, n1>)
ASIO_TEST_CASE3(test_constexpr_query<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, s, false>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_require<ex_nq_nr, n2, true>)
ASIO_TEST_CASE3(test_require<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE3(test_require<ex_nq_nr, n2, n2>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, s, false>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n1, true>)
ASIO_TEST_CASE3(test_can_prefer<ex_nq_nr, n2, false>)
ASIO_TEST_CASE3(test_prefer<ex_nq_nr, n1, n1>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_constexpr_query<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_cq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n1, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n2, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n1, s, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_cq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_cq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_cq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_mq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_mq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_mq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_require<ex_mq_nr<s, s, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_mq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_mq_nr<s, n1, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_mq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_mq_nr<s, n2, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_mq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_mq_nr<n1, s, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_mq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_mq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_mq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, s, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_query<ex_fq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, s, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n1, s, n1>, n2, n1>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, s, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_query<ex_fq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n1, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<s, n2, n2>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n1, s, n1>, n2, true>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n1, false>)
ASIO_TEST_CASE5(test_can_require<ex_fq_nr<n2, s, n2>, n2, true>)
ASIO_TEST_CASE5(test_require<ex_fq_nr<s, s, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_fq_nr<s, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_fq_nr<s, n1, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_fq_nr<s, n1, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_fq_nr<s, n2, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_fq_nr<s, n2, n2>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_fq_nr<n1, s, n1>, n2, n2>)
ASIO_TEST_CASE5(test_require<ex_fq_nr<n2, s, n2>, n2, n2>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n1, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<s, n2, n2>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n1, s, n1>, n2, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, s, false>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n1, true>)
ASIO_TEST_CASE5(test_can_prefer<ex_fq_nr<n2, s, n2>, n2, false>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, s, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n1, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<s, n2, n2>, n1, n2>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n1, s, n1>, n1, n1>)
ASIO_TEST_CASE5(test_prefer<ex_fq_nr<n2, s, n2>, n1, n2>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_mq_mr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_mq_mr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n1, n2>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_mq_mr<n2, n2>, n2, false>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_mq_mr<n2, n2>, n1, n2>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, s, true>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_query<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, s, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, s, n2>)
ASIO_TEST_CASE4(test_query<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n1, n2>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n1>, n2, true>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n1, false>)
ASIO_TEST_CASE4(test_can_require<ex_fq_fr<n2, n2>, n2, true>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n1, n2>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n1>, n2, n2>)
ASIO_TEST_CASE4(test_require<ex_fq_fr<n2, n2>, n2, n2>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n1, n2>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n1>, n2, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, s, false>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n1, true>)
ASIO_TEST_CASE4(test_can_prefer<ex_fq_fr<n2, n2>, n2, false>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n1, n2>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n1>, n1, n1>)
ASIO_TEST_CASE4(test_prefer<ex_fq_fr<n2, n2>, n1, n2>)
ASIO_TEST_CASE(test_vars)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/execution/invocable_archetype.cpp | //
// invocable_archetype.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Disable autolinking for unit tests.
#if !defined(BOOST_ALL_NO_LIB)
#define BOOST_ALL_NO_LIB 1
#endif // !defined(BOOST_ALL_NO_LIB)
// Test that header file is self-contained.
#include "asio/execution/invocable_archetype.hpp"
#include "../unit_test.hpp"
ASIO_TEST_SUITE
(
"invocable_archetype",
ASIO_TEST_CASE(null_test)
)
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/archetypes/gettable_socket_option.hpp | //
// gettable_socket_option.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef ARCHETYPES_GETTABLE_SOCKET_OPTION_HPP
#define ARCHETYPES_GETTABLE_SOCKET_OPTION_HPP
#include <cstddef>
namespace archetypes {
template <typename PointerType>
class gettable_socket_option
{
public:
template <typename Protocol>
int level(const Protocol&) const
{
return 0;
}
template <typename Protocol>
int name(const Protocol&) const
{
return 0;
}
template <typename Protocol>
PointerType* data(const Protocol&)
{
return 0;
}
template <typename Protocol>
std::size_t size(const Protocol&) const
{
return 0;
}
template <typename Protocol>
void resize(const Protocol&, std::size_t)
{
}
};
} // namespace archetypes
#endif // ARCHETYPES_GETTABLE_SOCKET_OPTION_HPP
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/archetypes/async_ops.hpp | //
// archetypes/async_ops.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef ARCHETYPES_ASYNC_OPS_HPP
#define ARCHETYPES_ASYNC_OPS_HPP
#include <functional>
#include "asio/associated_allocator.hpp"
#include "asio/associated_executor.hpp"
#include "asio/async_result.hpp"
#include "asio/error.hpp"
namespace archetypes {
namespace bindns = std;
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void()>::return_type
async_op_0(CompletionToken&& token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void()>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
void()> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
ex.post(static_cast<handler_type&&>(completion.completion_handler), a);
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code)>::return_type
async_op_ec_0(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code)>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
void(asio::error_code)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
if (ok)
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
asio::error_code()), a);
}
else
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(asio::error::operation_aborted)), a);
}
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr)>::return_type
async_op_ex_0(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr)>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
void(std::exception_ptr)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
if (ok)
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
std::exception_ptr()), a);
}
else
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
std::make_exception_ptr(std::runtime_error("blah"))), a);
}
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(int)>::return_type
async_op_1(ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(int)>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
void(int)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
42), a);
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code, int)>::return_type
async_op_ec_1(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code, int)>::completion_handler_type
handler_type;
asio::async_completion<CompletionToken,
void(asio::error_code, int)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
if (ok)
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(), 42), a);
}
else
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(asio::error::operation_aborted),
0), a);
}
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr, int)>::return_type
async_op_ex_1(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr, int)>::completion_handler_type
handler_type;
asio::async_completion<CompletionToken,
void(std::exception_ptr, int)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
if (ok)
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
std::exception_ptr(), 42), a);
}
else
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
std::make_exception_ptr(std::runtime_error("blah")), 0), a);
}
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(int, double)>::return_type
async_op_2(ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(int, double)>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
void(int, double)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
42, 2.0), a);
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code, int, double)>::return_type
async_op_ec_2(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code, int, double)>::completion_handler_type
handler_type;
asio::async_completion<CompletionToken,
void(asio::error_code, int, double)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
if (ok)
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(), 42, 2.0), a);
}
else
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(asio::error::operation_aborted),
0, 0.0), a);
}
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr, int, double)>::return_type
async_op_ex_2(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr, int, double)>::completion_handler_type
handler_type;
asio::async_completion<CompletionToken,
void(std::exception_ptr, int, double)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
if (ok)
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
std::exception_ptr(), 42, 2.0), a);
}
else
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
std::make_exception_ptr(std::runtime_error("blah")), 0, 0.0), a);
}
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(int, double, char)>::return_type
async_op_3(ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(int, double, char)>::completion_handler_type handler_type;
asio::async_completion<CompletionToken,
void(int, double, char)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
42, 2.0, 'a'), a);
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code, int, double, char)>::return_type
async_op_ec_3(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(asio::error_code, int, double, char)>::completion_handler_type
handler_type;
asio::async_completion<CompletionToken,
void(asio::error_code, int, double, char)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
if (ok)
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(), 42, 2.0, 'a'), a);
}
else
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
asio::error_code(asio::error::operation_aborted),
0, 0.0, 'z'), a);
}
return completion.result.get();
}
template <typename CompletionToken>
typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr, int, double, char)>::return_type
async_op_ex_3(bool ok, ASIO_MOVE_ARG(CompletionToken) token)
{
typedef typename asio::async_result<asio::decay_t<CompletionToken>,
void(std::exception_ptr, int, double, char)>::completion_handler_type
handler_type;
asio::async_completion<CompletionToken,
void(std::exception_ptr, int, double, char)> completion(token);
typename asio::associated_allocator<handler_type>::type a
= asio::get_associated_allocator(completion.completion_handler);
typename asio::associated_executor<handler_type>::type ex
= asio::get_associated_executor(completion.completion_handler);
if (ok)
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
std::exception_ptr(), 42, 2.0, 'a'), a);
}
else
{
ex.post(
bindns::bind(
static_cast<handler_type&&>(completion.completion_handler),
std::make_exception_ptr(std::runtime_error("blah")),
0, 0.0, 'z'), a);
}
return completion.result.get();
}
} // namespace archetypes
#endif // ARCHETYPES_ASYNC_OPS_HPP
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/archetypes/settable_socket_option.hpp | //
// settable_socket_option.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef ARCHETYPES_SETTABLE_SOCKET_OPTION_HPP
#define ARCHETYPES_SETTABLE_SOCKET_OPTION_HPP
#include <cstddef>
namespace archetypes {
template <typename PointerType>
class settable_socket_option
{
public:
template <typename Protocol>
int level(const Protocol&) const
{
return 0;
}
template <typename Protocol>
int name(const Protocol&) const
{
return 0;
}
template <typename Protocol>
const PointerType* data(const Protocol&) const
{
return 0;
}
template <typename Protocol>
std::size_t size(const Protocol&) const
{
return 0;
}
};
} // namespace archetypes
#endif // ARCHETYPES_SETTABLE_SOCKET_OPTION_HPP
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/archetypes/io_control_command.hpp | //
// io_control_command.hpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef ARCHETYPES_IO_CONTROL_COMMAND_HPP
#define ARCHETYPES_IO_CONTROL_COMMAND_HPP
namespace archetypes {
class io_control_command
{
public:
int name() const
{
return 0;
}
void* data()
{
return 0;
}
};
} // namespace archetypes
#endif // ARCHETYPES_IO_CONTROL_COMMAND_HPP
|
0 | repos/asio/asio/src/tests/unit | repos/asio/asio/src/tests/unit/archetypes/async_result.hpp | //
// async_result.hpp
// ~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef ARCHETYPES_ASYNC_RESULT_HPP
#define ARCHETYPES_ASYNC_RESULT_HPP
#include <asio/async_result.hpp>
#include <asio/system_executor.hpp>
namespace archetypes {
struct immediate_handler
{
};
struct lazy_handler
{
};
template <typename Signature>
struct concrete_handler;
template <typename R, typename Arg1>
struct concrete_handler<R(Arg1)>
{
concrete_handler()
{
}
void operator()(typename asio::decay<Arg1>::type)
{
}
concrete_handler(concrete_handler&&) {}
private:
concrete_handler(const concrete_handler&);
};
template <typename R, typename Arg1, typename Arg2>
struct concrete_handler<R(Arg1, Arg2)>
{
concrete_handler()
{
}
void operator()(typename asio::decay<Arg1>::type,
typename asio::decay<Arg2>::type)
{
}
};
template <typename Signature>
struct immediate_concrete_handler : concrete_handler<Signature>
{
typedef asio::system_executor immediate_executor_type;
immediate_concrete_handler(immediate_handler)
{
}
immediate_executor_type get_immediate_executor() const noexcept
{
return immediate_executor_type();
}
immediate_concrete_handler(immediate_concrete_handler&&) {}
private:
immediate_concrete_handler(const immediate_concrete_handler&);
};
template <typename Signature>
struct lazy_concrete_handler : concrete_handler<Signature>
{
lazy_concrete_handler(lazy_handler)
{
}
lazy_concrete_handler(lazy_concrete_handler&&) {}
private:
lazy_concrete_handler(const lazy_concrete_handler&);
};
} // namespace archetypes
namespace asio {
template <typename Signature>
class async_result<archetypes::immediate_handler, Signature>
{
public:
// The concrete completion handler type.
typedef archetypes::immediate_concrete_handler<Signature>
completion_handler_type;
// The return type of the initiating function.
typedef void return_type;
// Construct an async_result from a given handler.
explicit async_result(completion_handler_type&)
{
}
// Obtain the value to be returned from the initiating function.
void get()
{
}
private:
// Disallow copying and assignment.
async_result(const async_result&) = delete;
async_result& operator=(const async_result&) = delete;
};
template <typename Signature>
class async_result<archetypes::lazy_handler, Signature>
{
public:
// The concrete completion handler type.
typedef archetypes::lazy_concrete_handler<Signature> completion_handler_type;
// The return type of the initiating function.
typedef int return_type;
// Construct an async_result from a given handler.
explicit async_result(completion_handler_type&)
{
}
// Obtain the value to be returned from the initiating function.
return_type get()
{
return 42;
}
private:
// Disallow copying and assignment.
async_result(const async_result&) = delete;
async_result& operator=(const async_result&) = delete;
};
} // namespace asio
#endif // ARCHETYPES_ASYNC_RESULT_HPP
|
0 | repos/asio/asio/src/tests | repos/asio/asio/src/tests/performance/handler_allocator.hpp | //
// handler_allocator.cpp
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef HANDLER_ALLOCATOR_HPP
#define HANDLER_ALLOCATOR_HPP
#include "asio.hpp"
#include <boost/aligned_storage.hpp>
#include <boost/noncopyable.hpp>
// Class to manage the memory to be used for handler-based custom allocation.
// It contains a single block of memory which may be returned for allocation
// requests. If the memory is in use when an allocation request is made, the
// allocator delegates allocation to the global heap.
class handler_allocator
: private boost::noncopyable
{
public:
handler_allocator()
: in_use_(false)
{
}
void* allocate(std::size_t size)
{
if (!in_use_ && size < storage_.size)
{
in_use_ = true;
return storage_.address();
}
return ::operator new(size);
}
void deallocate(void* pointer)
{
if (pointer == storage_.address())
{
in_use_ = false;
}
else
{
::operator delete(pointer);
}
}
private:
// Storage space used for handler-based custom memory allocation.
boost::aligned_storage<1024> storage_;
// Whether the handler-based custom allocation storage has been used.
bool in_use_;
};
// Wrapper class template for handler objects to allow handler memory
// allocation to be customised. Calls to operator() are forwarded to the
// encapsulated handler.
template <typename Handler>
class custom_alloc_handler
{
public:
custom_alloc_handler(handler_allocator& a, Handler h)
: allocator_(a),
handler_(h)
{
}
template <typename Arg1>
void operator()(Arg1 arg1)
{
handler_(arg1);
}
template <typename Arg1, typename Arg2>
void operator()(Arg1 arg1, Arg2 arg2)
{
handler_(arg1, arg2);
}
friend void* asio_handler_allocate(std::size_t size,
custom_alloc_handler<Handler>* this_handler)
{
return this_handler->allocator_.allocate(size);
}
friend void asio_handler_deallocate(void* pointer, std::size_t /*size*/,
custom_alloc_handler<Handler>* this_handler)
{
this_handler->allocator_.deallocate(pointer);
}
private:
handler_allocator& allocator_;
Handler handler_;
};
// Helper function to wrap a handler object to add custom allocation.
template <typename Handler>
inline custom_alloc_handler<Handler> make_custom_alloc_handler(
handler_allocator& a, Handler h)
{
return custom_alloc_handler<Handler>(a, h);
}
#endif // HANDLER_ALLOCATOR_HPP
|
0 | repos/asio/asio/src/tests | repos/asio/asio/src/tests/performance/server.cpp | //
// server.cpp
// ~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio.hpp"
#include <algorithm>
#include <boost/bind/bind.hpp>
#include <iostream>
#include <list>
#include "handler_allocator.hpp"
class session
{
public:
session(asio::io_context& ioc, size_t block_size)
: io_context_(ioc),
strand_(ioc.get_executor()),
socket_(ioc),
block_size_(block_size),
read_data_(new char[block_size]),
read_data_length_(0),
write_data_(new char[block_size]),
unsent_count_(0),
op_count_(0)
{
}
~session()
{
delete[] read_data_;
delete[] write_data_;
}
asio::ip::tcp::socket& socket()
{
return socket_;
}
void start()
{
asio::error_code set_option_err;
asio::ip::tcp::no_delay no_delay(true);
socket_.set_option(no_delay, set_option_err);
if (!set_option_err)
{
++op_count_;
socket_.async_read_some(asio::buffer(read_data_, block_size_),
asio::bind_executor(strand_,
make_custom_alloc_handler(read_allocator_,
boost::bind(&session::handle_read, this,
asio::placeholders::error,
asio::placeholders::bytes_transferred))));
}
else
{
asio::post(io_context_, boost::bind(&session::destroy, this));
}
}
void handle_read(const asio::error_code& err, size_t length)
{
--op_count_;
if (!err)
{
read_data_length_ = length;
++unsent_count_;
if (unsent_count_ == 1)
{
op_count_ += 2;
std::swap(read_data_, write_data_);
async_write(socket_, asio::buffer(write_data_, read_data_length_),
asio::bind_executor(strand_,
make_custom_alloc_handler(write_allocator_,
boost::bind(&session::handle_write, this,
asio::placeholders::error))));
socket_.async_read_some(asio::buffer(read_data_, block_size_),
asio::bind_executor(strand_,
make_custom_alloc_handler(read_allocator_,
boost::bind(&session::handle_read, this,
asio::placeholders::error,
asio::placeholders::bytes_transferred))));
}
}
if (op_count_ == 0)
asio::post(io_context_, boost::bind(&session::destroy, this));
}
void handle_write(const asio::error_code& err)
{
--op_count_;
if (!err)
{
--unsent_count_;
if (unsent_count_ == 1)
{
op_count_ += 2;
std::swap(read_data_, write_data_);
async_write(socket_, asio::buffer(write_data_, read_data_length_),
asio::bind_executor(strand_,
make_custom_alloc_handler(write_allocator_,
boost::bind(&session::handle_write, this,
asio::placeholders::error))));
socket_.async_read_some(asio::buffer(read_data_, block_size_),
asio::bind_executor(strand_,
make_custom_alloc_handler(read_allocator_,
boost::bind(&session::handle_read, this,
asio::placeholders::error,
asio::placeholders::bytes_transferred))));
}
}
if (op_count_ == 0)
asio::post(io_context_, boost::bind(&session::destroy, this));
}
static void destroy(session* s)
{
delete s;
}
private:
asio::io_context& io_context_;
asio::strand<asio::io_context::executor_type> strand_;
asio::ip::tcp::socket socket_;
size_t block_size_;
char* read_data_;
size_t read_data_length_;
char* write_data_;
int unsent_count_;
int op_count_;
handler_allocator read_allocator_;
handler_allocator write_allocator_;
};
class server
{
public:
server(asio::io_context& ioc, const asio::ip::tcp::endpoint& endpoint,
size_t block_size)
: io_context_(ioc),
acceptor_(ioc),
block_size_(block_size)
{
acceptor_.open(endpoint.protocol());
acceptor_.set_option(asio::ip::tcp::acceptor::reuse_address(1));
acceptor_.bind(endpoint);
acceptor_.listen();
start_accept();
}
void start_accept()
{
session* new_session = new session(io_context_, block_size_);
acceptor_.async_accept(new_session->socket(),
boost::bind(&server::handle_accept, this, new_session,
asio::placeholders::error));
}
void handle_accept(session* new_session, const asio::error_code& err)
{
if (!err)
{
new_session->start();
}
else
{
delete new_session;
}
start_accept();
}
private:
asio::io_context& io_context_;
asio::ip::tcp::acceptor acceptor_;
size_t block_size_;
};
int main(int argc, char* argv[])
{
try
{
if (argc != 5)
{
std::cerr << "Usage: server <address> <port> <threads> <blocksize>\n";
return 1;
}
using namespace std; // For atoi.
asio::ip::address address = asio::ip::make_address(argv[1]);
short port = atoi(argv[2]);
int thread_count = atoi(argv[3]);
size_t block_size = atoi(argv[4]);
asio::io_context ioc;
server s(ioc, asio::ip::tcp::endpoint(address, port), block_size);
// Threads not currently supported in this test.
std::list<asio::thread*> threads;
while (--thread_count > 0)
{
asio::thread* new_thread = new asio::thread(
boost::bind(&asio::io_context::run, &ioc));
threads.push_back(new_thread);
}
ioc.run();
while (!threads.empty())
{
threads.front()->join();
delete threads.front();
threads.pop_front();
}
}
catch (std::exception& e)
{
std::cerr << "Exception: " << e.what() << "\n";
}
return 0;
}
|
0 | repos/asio/asio/src/tests | repos/asio/asio/src/tests/performance/client.cpp | //
// client.cpp
// ~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio.hpp"
#include <algorithm>
#include <boost/bind/bind.hpp>
#include <boost/mem_fn.hpp>
#include <iostream>
#include <list>
#include <string>
#include "handler_allocator.hpp"
class stats
{
public:
stats()
: mutex_(),
total_bytes_written_(0),
total_bytes_read_(0)
{
}
void add(size_t bytes_written, size_t bytes_read)
{
asio::detail::mutex::scoped_lock lock(mutex_);
total_bytes_written_ += bytes_written;
total_bytes_read_ += bytes_read;
}
void print()
{
asio::detail::mutex::scoped_lock lock(mutex_);
std::cout << total_bytes_written_ << " total bytes written\n";
std::cout << total_bytes_read_ << " total bytes read\n";
}
private:
asio::detail::mutex mutex_;
size_t total_bytes_written_;
size_t total_bytes_read_;
};
class session
{
public:
session(asio::io_context& ioc, size_t block_size, stats& s)
: strand_(ioc.get_executor()),
socket_(ioc),
block_size_(block_size),
read_data_(new char[block_size]),
read_data_length_(0),
write_data_(new char[block_size]),
unwritten_count_(0),
bytes_written_(0),
bytes_read_(0),
stats_(s)
{
for (size_t i = 0; i < block_size_; ++i)
write_data_[i] = static_cast<char>(i % 128);
}
~session()
{
stats_.add(bytes_written_, bytes_read_);
delete[] read_data_;
delete[] write_data_;
}
void start(asio::ip::tcp::resolver::results_type endpoints)
{
asio::async_connect(socket_, endpoints,
asio::bind_executor(strand_,
boost::bind(&session::handle_connect, this,
asio::placeholders::error)));
}
void stop()
{
asio::post(strand_, boost::bind(&session::close_socket, this));
}
private:
void handle_connect(const asio::error_code& err)
{
if (!err)
{
asio::error_code set_option_err;
asio::ip::tcp::no_delay no_delay(true);
socket_.set_option(no_delay, set_option_err);
if (!set_option_err)
{
++unwritten_count_;
async_write(socket_, asio::buffer(write_data_, block_size_),
asio::bind_executor(strand_,
make_custom_alloc_handler(write_allocator_,
boost::bind(&session::handle_write, this,
asio::placeholders::error,
asio::placeholders::bytes_transferred))));
socket_.async_read_some(asio::buffer(read_data_, block_size_),
asio::bind_executor(strand_,
make_custom_alloc_handler(read_allocator_,
boost::bind(&session::handle_read, this,
asio::placeholders::error,
asio::placeholders::bytes_transferred))));
}
}
}
void handle_read(const asio::error_code& err, size_t length)
{
if (!err)
{
bytes_read_ += length;
read_data_length_ = length;
++unwritten_count_;
if (unwritten_count_ == 1)
{
std::swap(read_data_, write_data_);
async_write(socket_, asio::buffer(write_data_, read_data_length_),
asio::bind_executor(strand_,
make_custom_alloc_handler(write_allocator_,
boost::bind(&session::handle_write, this,
asio::placeholders::error,
asio::placeholders::bytes_transferred))));
socket_.async_read_some(asio::buffer(read_data_, block_size_),
asio::bind_executor(strand_,
make_custom_alloc_handler(read_allocator_,
boost::bind(&session::handle_read, this,
asio::placeholders::error,
asio::placeholders::bytes_transferred))));
}
}
}
void handle_write(const asio::error_code& err, size_t length)
{
if (!err && length > 0)
{
bytes_written_ += length;
--unwritten_count_;
if (unwritten_count_ == 1)
{
std::swap(read_data_, write_data_);
async_write(socket_, asio::buffer(write_data_, read_data_length_),
asio::bind_executor(strand_,
make_custom_alloc_handler(write_allocator_,
boost::bind(&session::handle_write, this,
asio::placeholders::error,
asio::placeholders::bytes_transferred))));
socket_.async_read_some(asio::buffer(read_data_, block_size_),
asio::bind_executor(strand_,
make_custom_alloc_handler(read_allocator_,
boost::bind(&session::handle_read, this,
asio::placeholders::error,
asio::placeholders::bytes_transferred))));
}
}
}
void close_socket()
{
socket_.close();
}
private:
asio::strand<asio::io_context::executor_type> strand_;
asio::ip::tcp::socket socket_;
size_t block_size_;
char* read_data_;
size_t read_data_length_;
char* write_data_;
int unwritten_count_;
size_t bytes_written_;
size_t bytes_read_;
stats& stats_;
handler_allocator read_allocator_;
handler_allocator write_allocator_;
};
class client
{
public:
client(asio::io_context& ioc,
const asio::ip::tcp::resolver::results_type endpoints,
size_t block_size, size_t session_count, int timeout)
: io_context_(ioc),
stop_timer_(ioc),
sessions_(),
stats_()
{
stop_timer_.expires_after(asio::chrono::seconds(timeout));
stop_timer_.async_wait(boost::bind(&client::handle_timeout, this));
for (size_t i = 0; i < session_count; ++i)
{
session* new_session = new session(io_context_, block_size, stats_);
new_session->start(endpoints);
sessions_.push_back(new_session);
}
}
~client()
{
while (!sessions_.empty())
{
delete sessions_.front();
sessions_.pop_front();
}
stats_.print();
}
void handle_timeout()
{
std::for_each(sessions_.begin(), sessions_.end(),
boost::mem_fn(&session::stop));
}
private:
asio::io_context& io_context_;
asio::steady_timer stop_timer_;
std::list<session*> sessions_;
stats stats_;
};
int main(int argc, char* argv[])
{
try
{
if (argc != 7)
{
std::cerr << "Usage: client <host> <port> <threads> <blocksize> ";
std::cerr << "<sessions> <time>\n";
return 1;
}
using namespace std; // For atoi.
const char* host = argv[1];
const char* port = argv[2];
int thread_count = atoi(argv[3]);
size_t block_size = atoi(argv[4]);
size_t session_count = atoi(argv[5]);
int timeout = atoi(argv[6]);
asio::io_context ioc;
asio::ip::tcp::resolver r(ioc);
asio::ip::tcp::resolver::results_type endpoints =
r.resolve(host, port);
client c(ioc, endpoints, block_size, session_count, timeout);
std::list<asio::thread*> threads;
while (--thread_count > 0)
{
asio::thread* new_thread = new asio::thread(
boost::bind(&asio::io_context::run, &ioc));
threads.push_back(new_thread);
}
ioc.run();
while (!threads.empty())
{
threads.front()->join();
delete threads.front();
threads.pop_front();
}
}
catch (std::exception& e)
{
std::cerr << "Exception: " << e.what() << "\n";
}
return 0;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/prefer_member_prefer.cpp | //
// cpp03/prefer_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
object<N> prefer(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct prefer_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
object<2> o2 = asio::prefer(o1, prop<2>());
object<3> o3 = asio::prefer(o1, prop<2>(), prop<3>());
object<4> o4 = asio::prefer(o1, prop<2>(), prop<3>(), prop<4>());
(void)o2;
(void)o3;
(void)o4;
const object<1> o5 = {};
object<2> o6 = asio::prefer(o5, prop<2>());
object<3> o7 = asio::prefer(o5, prop<2>(), prop<3>());
object<4> o8 = asio::prefer(o5, prop<2>(), prop<3>(), prop<4>());
(void)o6;
(void)o7;
(void)o8;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_query_static.cpp | //
// cpp03/can_query_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
};
namespace asio {
template<>
struct is_applicable_property<object, prop>
{
static const bool value = true;
};
namespace traits {
template<>
struct static_query<object, prop>
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef int result_type;
static int value() { return 123; }
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_query<object, prop>::value));
assert((asio::can_query<const object, prop>::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_unsupported.cpp | //
// cpp03/can_prefer_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
} // namespace asio
int main()
{
assert((asio::can_prefer<object<1>, prop<2> >::value));
assert((asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((asio::can_prefer<const object<1>, prop<2> >::value));
assert((asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/prefer_member_require.cpp | //
// cpp03/prefer_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
object<N> require(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
object<2> o2 = asio::prefer(o1, prop<2>());
object<3> o3 = asio::prefer(o1, prop<2>(), prop<3>());
object<4> o4 = asio::prefer(o1, prop<2>(), prop<3>(), prop<4>());
(void)o2;
(void)o3;
(void)o4;
const object<1> o5 = {};
object<2> o6 = asio::prefer(o5, prop<2>());
object<3> o7 = asio::prefer(o5, prop<2>(), prop<3>());
object<4> o8 = asio::prefer(o5, prop<2>(), prop<3>(), prop<4>());
(void)o6;
(void)o7;
(void)o8;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_applicable_static.cpp | //
// cpp03/can_prefer_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
};
namespace asio {
namespace traits {
template<int N>
struct static_require<object<N>, prop<N> >
{
static const bool is_valid = true;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<1> >::value));
assert((!asio::can_prefer<object<1>, prop<1>, prop<1> >::value));
assert((!asio::can_prefer<object<1>, prop<1>, prop<1>, prop<1> >::value));
assert((!asio::can_prefer<const object<1>, prop<1> >::value));
assert((!asio::can_prefer<const object<1>, prop<1>, prop<1> >::value));
assert((!asio::can_prefer<const object<1>, prop<1>, prop<1>, prop<1> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_unsupported.cpp | //
// cpp03/can_require_concept_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
};
template <int>
struct object
{
};
int main()
{
assert((!asio::can_require_concept<object<1>, prop<2> >::value));
assert((!asio::can_require_concept<const object<1>, prop<2> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_prefer.cpp | //
// cpp03/can_prefer_not_preferable_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = false;
};
template <int>
struct object
{
template <int N>
object<N> prefer(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct prefer_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<2> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_prefer<const object<1>, prop<2> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_not_applicable_free.cpp | //
// cpp03/can_require_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable = true;
};
template <int>
struct object
{
template <int N>
friend object<N> require(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
namespace traits {
template<int N, int M>
struct require_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_require<object<1>, prop<2> >::value));
assert((!asio::can_require<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_require<const object<1>, prop<2> >::value));
assert((!asio::can_require<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_member_require.cpp | //
// cpp03/can_prefer_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
object<N> require(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_prefer<object<1>, prop<2> >::value));
assert((asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((asio::can_prefer<const object<1>, prop<2> >::value));
assert((asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_prefer.cpp | //
// cpp03/can_prefer_not_applicable_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
friend object<N> prefer(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
namespace traits {
template<int N, int M>
struct prefer_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<2> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_prefer<const object<1>, prop<2> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_not_applicable_unsupported.cpp | //
// cpp03/can_require_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
};
template <int>
struct object
{
};
int main()
{
assert((!asio::can_require<object<1>, prop<2> >::value));
assert((!asio::can_require<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_require<const object<1>, prop<2> >::value));
assert((!asio::can_require<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_prefer.cpp | //
// cpp03/can_prefer_not_preferable_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = false;
};
template <int>
struct object
{
template <int N>
friend object<N> prefer(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct prefer_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<2> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_prefer<const object<1>, prop<2> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/query_member.cpp | //
// cpp03/query_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
int query(prop) const { return 123; }
};
namespace asio {
template<>
struct is_applicable_property<object, prop>
{
static const bool value = true;
};
namespace traits {
template<>
struct query_member<object, prop>
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef int result_type;
};
} // namespace traits
} // namespace asio
int main()
{
object o1 = {};
int result1 = asio::query(o1, prop());
assert(result1 == 123);
(void)result1;
const object o2 = {};
int result2 = asio::query(o2, prop());
assert(result2 == 123);
(void)result2;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_not_applicable_static.cpp | //
// cpp03/can_require_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable = true;
};
template <int>
struct object
{
};
namespace asio {
namespace traits {
template<int N>
struct static_require<object<N>, prop<N> >
{
static const bool is_valid = true;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_require<object<1>, prop<1> >::value));
assert((!asio::can_require<object<1>, prop<1>, prop<1> >::value));
assert((!asio::can_require<object<1>, prop<1>, prop<1>, prop<1> >::value));
assert((!asio::can_require<const object<1>, prop<1> >::value));
assert((!asio::can_require<const object<1>, prop<1>, prop<1> >::value));
assert((!asio::can_require<const object<1>, prop<1>, prop<1>, prop<1> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_concept_unsupported.cpp | //
// cpp03/can_require_concept_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
} // namespace asio
int main()
{
assert((!asio::can_require_concept<object<1>, prop<2> >::value));
assert((!asio::can_require_concept<const object<1>, prop<2> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_query_member.cpp | //
// cpp03/can_query_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
int query(prop) const { return 123; }
};
namespace asio {
template<>
struct is_applicable_property<object, prop>
{
static const bool value = true;
};
namespace traits {
template<>
struct query_member<object, prop>
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef int result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_query<object, prop>::value));
assert((asio::can_query<const object, prop>::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_preferable_unsupported.cpp | //
// cpp03/can_prefer_not_preferable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = false;
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<2> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_prefer<const object<1>, prop<2> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/prefer_unsupported.cpp | //
// cpp03/prefer_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
} // namespace asio
int main()
{
object<1> o1 = {};
const object<1>& o2 = asio::prefer(o1, prop<1>());
assert(&o1 == &o2);
(void)o2;
const object<1> o3 = {};
const object<1>& o4 = asio::prefer(o3, prop<1>());
assert(&o3 == &o4);
(void)o4;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_applicable_unsupported.cpp | //
// cpp03/can_prefer_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
};
int main()
{
assert((!asio::can_prefer<object<1>, prop<2> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_prefer<const object<1>, prop<2> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_free_require.cpp | //
// cpp03/can_prefer_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
friend object<N> require(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_prefer<object<1>, prop<2> >::value));
assert((asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((asio::can_prefer<const object<1>, prop<2> >::value));
assert((asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_preferable_free_require.cpp | //
// cpp03/can_prefer_not_preferable_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = false;
};
template <int>
struct object
{
template <int N>
friend object<N> require(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<2> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_prefer<const object<1>, prop<2> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_unsupported.cpp | //
// cpp03/can_require_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
} // namespace asio
int main()
{
assert((!asio::can_require<object<1>, prop<2> >::value));
assert((!asio::can_require<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_require<const object<1>, prop<2> >::value));
assert((!asio::can_require<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_concept_free.cpp | //
// cpp03/can_require_concept_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable_concept = true;
};
template <int>
struct object
{
template <int N>
friend object<N> require_concept(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_concept_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_require_concept<object<1>, prop<2> >::value));
assert((asio::can_require_concept<const object<1>, prop<2> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_static.cpp | //
// cpp03/can_require_concept_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable_concept = true;
};
template <int>
struct object
{
};
namespace asio {
namespace traits {
template<int N>
struct static_require_concept<object<N>, prop<N> >
{
static const bool is_valid = true;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_require_concept<object<1>, prop<2> >::value));
assert((!asio::can_require_concept<const object<1>, prop<2> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_query_not_applicable_free.cpp | //
// cpp03/can_query_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
friend int query(const object&, prop) { return 123; }
};
namespace asio {
namespace traits {
template<>
struct query_free<object, prop>
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef int result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_query<object, prop>::value));
assert((!asio::can_query<const object, prop>::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_preferable_static.cpp | //
// cpp03/can_prefer_not_preferable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = false;
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N>
struct static_require<object<N>, prop<N> >
{
static const bool is_valid = true;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<1> >::value));
assert((!asio::can_prefer<object<1>, prop<1>, prop<1> >::value));
assert((!asio::can_prefer<object<1>, prop<1>, prop<1>, prop<1> >::value));
assert((!asio::can_prefer<const object<1>, prop<1> >::value));
assert((!asio::can_prefer<const object<1>, prop<1>, prop<1> >::value));
assert((!asio::can_prefer<const object<1>, prop<1>, prop<1>, prop<1> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_free.cpp | //
// cpp03/can_require_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable = true;
};
template <int>
struct object
{
template <int N>
friend object<N> require(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_require<object<1>, prop<2> >::value));
assert((asio::can_require<object<1>, prop<2>, prop<3> >::value));
assert((asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((asio::can_require<const object<1>, prop<2> >::value));
assert((asio::can_require<const object<1>, prop<2>, prop<3> >::value));
assert((asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_free_prefer.cpp | //
// cpp03/can_prefer_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
friend object<N> prefer(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct prefer_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_prefer<object<1>, prop<2> >::value));
assert((asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((asio::can_prefer<const object<1>, prop<2> >::value));
assert((asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_query_not_applicable_static.cpp | //
// cpp03/can_query_not_applicable_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
};
namespace asio {
namespace traits {
template<>
struct static_query<object, prop>
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef int result_type;
static int value() { return 123; }
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_query<object, prop>::value));
assert((!asio::can_query<const object, prop>::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_require.cpp | //
// cpp03/can_prefer_not_applicable_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
object<N> require(prop<N>) const
{
return object<N>();
}
};
namespace asio {
namespace traits {
template<int N, int M>
struct require_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<2> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_prefer<const object<1>, prop<2> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/require_concept_member.cpp | //
// cpp03/require_concept_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable_concept = true;
};
template <int>
struct object
{
template <int N>
object<N> require_concept(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_concept_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
object<2> o2 = asio::require_concept(o1, prop<2>());
(void)o2;
const object<1> o3 = {};
object<2> o4 = asio::require_concept(o3, prop<2>());
(void)o4;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/require_concept_static.cpp | //
// cpp03/require_concept_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable_concept = true;
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N>
struct static_require_concept<object<N>, prop<N> >
{
static const bool is_valid = true;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
const object<1>& o2 = asio::require_concept(o1, prop<1>());
assert(&o1 == &o2);
(void)o2;
const object<1> o3 = {};
const object<1>& o4 = asio::require_concept(o3, prop<1>());
assert(&o3 == &o4);
(void)o4;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/prefer_free_prefer.cpp | //
// cpp03/prefer_free_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
friend object<N> prefer(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct prefer_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
object<2> o2 = asio::prefer(o1, prop<2>());
object<3> o3 = asio::prefer(o1, prop<2>(), prop<3>());
object<4> o4 = asio::prefer(o1, prop<2>(), prop<3>(), prop<4>());
(void)o2;
(void)o3;
(void)o4;
const object<1> o5 = {};
object<2> o6 = asio::prefer(o5, prop<2>());
object<3> o7 = asio::prefer(o5, prop<2>(), prop<3>());
object<4> o8 = asio::prefer(o5, prop<2>(), prop<3>(), prop<4>());
(void)o6;
(void)o7;
(void)o8;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_free.cpp | //
// cpp03/can_require_concept_not_applicable_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable_concept = true;
};
template <int>
struct object
{
template <int N>
friend object<N> require_concept(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
namespace traits {
template<int N, int M>
struct require_concept_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_require_concept<object<1>, prop<2> >::value));
assert((!asio::can_require_concept<const object<1>, prop<2> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_concept_member.cpp | //
// cpp03/can_require_concept_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable_concept = true;
};
template <int>
struct object
{
template <int N>
object<N> require_concept(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_concept_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_require_concept<object<1>, prop<2> >::value));
assert((asio::can_require_concept<const object<1>, prop<2> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/query_free.cpp | //
// cpp03/query_free.cpp
// ~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
friend int query(const object&, prop) { return 123; }
};
namespace asio {
template<>
struct is_applicable_property<object, prop>
{
static const bool value = true;
};
namespace traits {
template<>
struct query_free<object, prop>
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef int result_type;
};
} // namespace traits
} // namespace asio
int main()
{
object o1 = {};
int result1 = asio::query(o1, prop());
assert(result1 == 123);
(void)result1;
const object o2 = {};
int result2 = asio::query(o2, prop());
assert(result2 == 123);
(void)result2;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_static.cpp | //
// cpp03/can_require_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable = true;
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N>
struct static_require<object<N>, prop<N> >
{
static const bool is_valid = true;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_require<object<1>, prop<1> >::value));
assert((asio::can_require<object<1>, prop<1>, prop<1> >::value));
assert((asio::can_require<object<1>, prop<1>, prop<1>, prop<1> >::value));
assert((asio::can_require<const object<1>, prop<1> >::value));
assert((asio::can_require<const object<1>, prop<1>, prop<1> >::value));
assert((asio::can_require<const object<1>, prop<1>, prop<1>, prop<1> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/require_free.cpp | //
// cpp03/require_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable = true;
};
template <int>
struct object
{
template <int N>
friend object<N> require(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
object<2> o2 = asio::require(o1, prop<2>());
object<3> o3 = asio::require(o1, prop<2>(), prop<3>());
object<4> o4 = asio::require(o1, prop<2>(), prop<3>(), prop<4>());
(void)o2;
(void)o3;
(void)o4;
const object<1> o5 = {};
object<2> o6 = asio::require(o5, prop<2>());
object<3> o7 = asio::require(o5, prop<2>(), prop<3>());
object<4> o8 = asio::require(o5, prop<2>(), prop<3>(), prop<4>());
(void)o6;
(void)o7;
(void)o8;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_concept_not_applicable_member.cpp | //
// cpp03/can_require_concept_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable_concept = true;
};
template <int>
struct object
{
template <int N>
object<N> require_concept(prop<N>) const
{
return object<N>();
}
};
namespace asio {
namespace traits {
template<int N, int M>
struct require_concept_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_require_concept<object<1>, prop<2> >::value));
assert((!asio::can_require_concept<const object<1>, prop<2> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/require_concept_free.cpp | //
// cpp03/require_concept_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable_concept = true;
};
template <int>
struct object
{
template <int N>
friend object<N> require_concept(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_concept_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
object<2> o2 = asio::require_concept(o1, prop<2>());
(void)o2;
const object<1> o3 = {};
object<2> o4 = asio::require_concept(o3, prop<2>());
(void)o4;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_preferable_member_require.cpp | //
// cpp03/can_prefer_not_preferable_member_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = false;
};
template <int>
struct object
{
template <int N>
object<N> require(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<2> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_prefer<const object<1>, prop<2> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/prefer_static.cpp | //
// cpp03/prefer_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N>
struct static_require<object<N>, prop<N> >
{
static const bool is_valid = true;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
object<1> o2 = asio::prefer(o1, prop<1>());
object<1> o3 = asio::prefer(o1, prop<1>(), prop<1>());
object<1> o4 = asio::prefer(o1, prop<1>(), prop<1>(), prop<1>());
(void)o2;
(void)o3;
(void)o4;
const object<1> o5 = {};
object<1> o6 = asio::prefer(o5, prop<1>());
object<1> o7 = asio::prefer(o5, prop<1>(), prop<1>());
object<1> o8 = asio::prefer(o5, prop<1>(), prop<1>(), prop<1>());
(void)o6;
(void)o7;
(void)o8;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_query_unsupported.cpp | //
// cpp03/can_query_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
};
namespace asio {
template <>
struct is_applicable_property<object, prop>
{
static const bool value = true;
};
} // namespace asio
int main()
{
assert((!asio::can_query<object, prop>::value));
assert((!asio::can_query<const object, prop>::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/require_member.cpp | //
// cpp03/require_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable = true;
};
template <int>
struct object
{
template <int N>
object<N> require(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
object<2> o2 = asio::require(o1, prop<2>());
object<3> o3 = asio::require(o1, prop<2>(), prop<3>());
object<4> o4 = asio::require(o1, prop<2>(), prop<3>(), prop<4>());
(void)o2;
(void)o3;
(void)o4;
const object<1> o5 = {};
object<2> o6 = asio::require(o5, prop<2>());
object<3> o7 = asio::require(o5, prop<2>(), prop<3>());
object<4> o8 = asio::require(o5, prop<2>(), prop<3>(), prop<4>());
(void)o6;
(void)o7;
(void)o8;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_member.cpp | //
// cpp03/can_require_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable = true;
};
template <int>
struct object
{
template <int N>
object<N> require(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_require<object<1>, prop<2> >::value));
assert((asio::can_require<object<1>, prop<2>, prop<3> >::value));
assert((asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((asio::can_require<const object<1>, prop<2> >::value));
assert((asio::can_require<const object<1>, prop<2>, prop<3> >::value));
assert((asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_member_prefer.cpp | //
// cpp03/can_prefer_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
object<N> prefer(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct prefer_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_prefer<object<1>, prop<2> >::value));
assert((asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((asio::can_prefer<const object<1>, prop<2> >::value));
assert((asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_applicable_member_prefer.cpp | //
// cpp03/can_prefer_not_applicable_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
object<N> prefer(prop<N>) const
{
return object<N>();
}
};
namespace asio {
namespace traits {
template<int N, int M>
struct prefer_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<2> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_prefer<const object<1>, prop<2> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_query_not_applicable_unsupported.cpp | //
// cpp03/can_query_not_applicable_unsupported.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
};
int main()
{
assert((!asio::can_query<object, prop>::value));
assert((!asio::can_query<const object, prop>::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_query_free.cpp | //
// cpp03/can_query_free.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
friend int query(const object&, prop) { return 123; }
};
namespace asio {
template<>
struct is_applicable_property<object, prop>
{
static const bool value = true;
};
namespace traits {
template<>
struct query_free<object, prop>
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef int result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_query<object, prop>::value));
assert((asio::can_query<const object, prop>::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/require_static.cpp | //
// cpp03/require_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable = true;
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N>
struct static_require<object<N>, prop<N> >
{
static const bool is_valid = true;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
object<1> o2 = asio::require(o1, prop<1>());
object<1> o3 = asio::require(o1, prop<1>(), prop<1>());
object<1> o4 = asio::require(o1, prop<1>(), prop<1>(), prop<1>());
(void)o2;
(void)o3;
(void)o4;
const object<1> o5 = {};
object<1> o6 = asio::require(o5, prop<1>());
object<1> o7 = asio::require(o5, prop<1>(), prop<1>());
object<1> o8 = asio::require(o5, prop<1>(), prop<1>(), prop<1>());
(void)o6;
(void)o7;
(void)o8;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/prefer_free_require.cpp | //
// cpp03/prefer_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
friend object<N> require(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N, int M>
struct require_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
object<1> o1 = {};
object<2> o2 = asio::prefer(o1, prop<2>());
object<3> o3 = asio::prefer(o1, prop<2>(), prop<3>());
object<4> o4 = asio::prefer(o1, prop<2>(), prop<3>(), prop<4>());
(void)o2;
(void)o3;
(void)o4;
const object<1> o5 = {};
object<2> o6 = asio::prefer(o5, prop<2>());
object<3> o7 = asio::prefer(o5, prop<2>(), prop<3>());
object<4> o8 = asio::prefer(o5, prop<2>(), prop<3>(), prop<4>());
(void)o6;
(void)o7;
(void)o8;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/query_static.cpp | //
// cpp03/query_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
};
namespace asio {
template<>
struct is_applicable_property<object, prop>
{
static const bool value = true;
};
namespace traits {
template<>
struct static_query<object, prop>
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef int result_type;
static int value() { return 123; }
};
} // namespace traits
} // namespace asio
int main()
{
object o1 = {};
int result1 = asio::query(o1, prop());
assert(result1 == 123);
(void)result1;
const object o2 = {};
int result2 = asio::query(o2, prop());
assert(result2 == 123);
(void)result2;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_query_not_applicable_member.cpp | //
// cpp03/can_query_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
int query(prop) const { return 123; }
};
namespace asio {
namespace traits {
template<>
struct query_member<object, prop>
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef int result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_query<object, prop>::value));
assert((!asio::can_query<const object, prop>::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_concept_static.cpp | //
// cpp03/can_require_concept_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require_concept.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable_concept = true;
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N>
struct static_require_concept<object<N>, prop<N> >
{
static const bool is_valid = true;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_require_concept<object<1>, prop<1> >::value));
assert((asio::can_require_concept<const object<1>, prop<1> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_static.cpp | //
// cpp03/can_prefer_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static const bool value = true;
};
namespace traits {
template<int N>
struct static_require<object<N>, prop<N> >
{
static const bool is_valid = true;
};
} // namespace traits
} // namespace asio
int main()
{
assert((asio::can_prefer<object<1>, prop<1> >::value));
assert((asio::can_prefer<object<1>, prop<1>, prop<1> >::value));
assert((asio::can_prefer<object<1>, prop<1>, prop<1>, prop<1> >::value));
assert((asio::can_prefer<const object<1>, prop<1> >::value));
assert((asio::can_prefer<const object<1>, prop<1>, prop<1> >::value));
assert((asio::can_prefer<const object<1>, prop<1>, prop<1>, prop<1> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_prefer_not_applicable_free_require.cpp | //
// cpp03/can_prefer_not_applicable_free_require.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
friend object<N> require(const object&, prop<N>)
{
return object<N>();
}
};
namespace asio {
namespace traits {
template<int N, int M>
struct require_free<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_prefer<object<1>, prop<2> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_prefer<const object<1>, prop<2> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_prefer<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp03/can_require_not_applicable_member.cpp | //
// cpp03/can_require_not_applicable_member.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/require.hpp"
#include <cassert>
template <int>
struct prop
{
static const bool is_requirable = true;
};
template <int>
struct object
{
template <int N>
object<N> require(prop<N>) const
{
return object<N>();
}
};
namespace asio {
namespace traits {
template<int N, int M>
struct require_member<object<N>, prop<M> >
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef object<M> result_type;
};
} // namespace traits
} // namespace asio
int main()
{
assert((!asio::can_require<object<1>, prop<2> >::value));
assert((!asio::can_require<object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_require<object<1>, prop<2>, prop<3>, prop<4> >::value));
assert((!asio::can_require<const object<1>, prop<2> >::value));
assert((!asio::can_require<const object<1>, prop<2>, prop<3> >::value));
assert((!asio::can_require<const object<1>, prop<2>, prop<3>, prop<4> >::value));
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp11/prefer_member_prefer.cpp | //
// cpp11/prefer_member_prefer.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/prefer.hpp"
#include <cassert>
template <int>
struct prop
{
static constexpr bool is_preferable = true;
};
template <int>
struct object
{
template <int N>
constexpr object<N> prefer(prop<N>) const
{
return object<N>();
}
};
namespace asio {
template<int N, int M>
struct is_applicable_property<object<N>, prop<M> >
{
static constexpr bool value = true;
};
} // namespace asio
int main()
{
object<1> o1 = {};
object<2> o2 = asio::prefer(o1, prop<2>());
object<3> o3 = asio::prefer(o1, prop<2>(), prop<3>());
object<4> o4 = asio::prefer(o1, prop<2>(), prop<3>(), prop<4>());
(void)o2;
(void)o3;
(void)o4;
const object<1> o5 = {};
object<2> o6 = asio::prefer(o5, prop<2>());
object<3> o7 = asio::prefer(o5, prop<2>(), prop<3>());
object<4> o8 = asio::prefer(o5, prop<2>(), prop<3>(), prop<4>());
(void)o6;
(void)o7;
(void)o8;
constexpr object<2> o9 = asio::prefer(object<1>(), prop<2>());
constexpr object<3> o10 = asio::prefer(object<1>(), prop<2>(), prop<3>());
constexpr object<4> o11 = asio::prefer(object<1>(), prop<2>(), prop<3>(), prop<4>());
(void)o9;
(void)o10;
(void)o11;
}
|
0 | repos/asio/asio/src/tests/properties | repos/asio/asio/src/tests/properties/cpp11/can_query_static.cpp | //
// cpp11/can_query_static.cpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "asio/query.hpp"
#include <cassert>
struct prop
{
};
struct object
{
};
namespace asio {
template<>
struct is_applicable_property<object, prop>
{
static constexpr bool value = true;
};
namespace traits {
template<>
struct static_query<object, prop>
{
static constexpr bool is_valid = true;
static constexpr bool is_noexcept = true;
typedef int result_type;
static constexpr int value() { return 123; }
};
} // namespace traits
} // namespace asio
int main()
{
static_assert(asio::can_query<object, prop>::value, "");
static_assert(asio::can_query<const object, prop>::value, "");
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.