From 9e1a5d014fcbc9ebeff019b5b16d60f3c943c172 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 18 Dec 2023 01:52:29 +0200 Subject: [PATCH] Add mp_transform_q test for up to 32 lists --- test/Jamfile | 1 + test/mp_transform_q_2.cpp | 48 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 test/mp_transform_q_2.cpp diff --git a/test/Jamfile b/test/Jamfile index 538e66a..4522892 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -74,6 +74,7 @@ run mp_is_value_list.cpp ; # algorithm run mp_transform.cpp ; run mp_transform_q.cpp ; +run mp_transform_q_2.cpp ; run mp_transform_sf.cpp ; run mp_transform_if.cpp ; run mp_transform_if_q.cpp ; diff --git a/test/mp_transform_q_2.cpp b/test/mp_transform_q_2.cpp new file mode 100644 index 0000000..be9e851 --- /dev/null +++ b/test/mp_transform_q_2.cpp @@ -0,0 +1,48 @@ +// Copyright 2023 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include +#include +#include +#include +#include + +struct X1 {}; +struct X2 {}; + +struct Test +{ + void operator()( boost::mp11::mp_size_t<0> ) + { + } + + template void operator()( N ) + { + using boost::mp11::mp_repeat; + using boost::mp11::mp_list; + using boost::mp11::mp_apply_q; + using boost::mp11::mp_bind_front; + using boost::mp11::mp_transform_q; + using boost::mp11::mp_quote; + + using L1 = mp_repeat< mp_list>, N >; // mp_list, pair, ...> + using L2 = mp_apply_q< mp_bind_front>, L1>; // pair, mp_list> + + using R1 = mp_repeat, N>; // mp_list + using R2 = mp_repeat, N>; // mp_list + + BOOST_TEST_TRAIT_SAME(L2, std::pair); + } +}; + +int main() +{ + using boost::mp11::mp_for_each; + using boost::mp11::mp_iota_c; + + mp_for_each< mp_iota_c<32> >( Test() ); + + return boost::report_errors(); +}