14 #define BOOST_TEST_MODULE ( zip_test )
15 #include <boost/test/unit_test.hpp>
32 constexpr std::size_t
N = 7U;
34 std::array<int, N> twice;
35 std::vector<double> thrice(N + 1);
37 for (std::size_t i = 0; i <
N; ++i) {
46 unsigned int iLoop = 0;
47 for (
auto&& [
a, b ]:
util::zip(twice, thrice)) {
49 BOOST_TEST(
a == twice[iLoop]);
50 BOOST_TEST(&
a == &(twice[iLoop]));
52 BOOST_TEST(b == thrice[iLoop]);
53 BOOST_TEST(&b == &thrice[iLoop]);
57 BOOST_TEST(iLoop == twice.size());
66 assert(thrice.size() == N - 1);
69 for (
auto&& [
a, b ]: util::zip<1>(twice, thrice)) {
71 BOOST_TEST(
a == twice[iLoop]);
72 BOOST_TEST(&
a == &(twice[iLoop]));
74 BOOST_TEST(b == thrice[iLoop]);
75 BOOST_TEST(&b == &thrice[iLoop]);
79 BOOST_TEST(iLoop == thrice.size());
88 unsigned int iLoop = 0U;
89 for (
auto&& i [[gnu::unused]]:
util::zip()) {}
91 BOOST_TEST(iLoop == 0);
Definition of util::zip().
process_name largeant stream1 can override from command line with o or output physics producers generator N
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.