Skip to content

Commit 9460c43

Browse files
committed
tidy
1 parent 4725b46 commit 9460c43

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

test/ranges_zip.cpp

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Distributed under the Boost Software License, Version 1.0.
33
// https://www.boost.org/LICENSE_1_0.txt
44

5-
#include <boost/multi/array.hpp>
5+
#include <boost/multi/array.hpp> // IWYU pragma: keep
66

77
#include <boost/core/lightweight_test.hpp>
88

@@ -16,7 +16,7 @@
1616
#include <ranges> // IWYU pragma: keep
1717
#endif
1818

19-
namespace multi = boost::multi;
19+
namespace multi = boost::multi; // NOLINT(misc-unused-alias-decls)
2020

2121
auto main() -> int { // NOLINT(bugprone-exception-escape)
2222
#if defined(__cpp_lib_ranges_zip) and (__cpp_lib_ranges_zip >= 202110L)
@@ -56,6 +56,31 @@ auto main() -> int { // NOLINT(bugprone-exception-escape)
5656
BOOST_TEST( e1 == 5 );
5757
BOOST_TEST( e2 == 6 );
5858
}
59+
{
60+
multi::array<int, 1> arr1({10}, 5);
61+
multi::array<int, 1> arr2({10}, 6);
62+
63+
auto zp = std::views::zip(arr1(), arr2());
64+
65+
auto [e1, e2] = zp[3];
66+
67+
BOOST_TEST( e1 == 5 );
68+
BOOST_TEST( e2 == 6 );
69+
}
70+
{
71+
multi::array<int, 1> arr1({10}, 5);
72+
multi::array<int, 1> arr2({10}, 6);
73+
74+
auto es1 = arr1().elements();
75+
auto es2 = arr2().elements();
76+
77+
auto zp = std::views::zip(arr1, arr2);
78+
79+
auto [e1, e2] = zp[3];
80+
81+
BOOST_TEST( e1 == 5 );
82+
BOOST_TEST( e2 == 6 );
83+
}
5984
#endif
6085

6186
return boost::report_errors();

0 commit comments

Comments
 (0)