3
3
// Distributed under the Boost Software License, Version 1.0.
4
4
// https://www.boost.org/LICENSE_1_0.txt
5
5
6
- #include < boost/core/lightweight_test.hpp>
7
-
8
6
#include < boost/multi/array.hpp> // for layout_t, apply, subarray, array... // IWYU pragma: keep // bug in iwyu 8.22
9
7
8
+ #include < boost/core/lightweight_test.hpp>
9
+
10
10
#include < algorithm> // for equal
11
11
#include < array> // for array // IWYU pragma: keep // bug in iwyu 8.22
12
12
#include < memory> // for addressof
@@ -25,11 +25,11 @@ auto main() -> int { // NOLINT(readability-function-cognitive-complexity,bugpro
25
25
namespace multi = boost::multi;
26
26
27
27
#ifndef _MSC_VER // MSVC 14.40 is not constexpr ready?
28
- // BOOST_AUTO_TEST_CASE(constexpr_ptr_access) {
29
- // static constexpr auto test = [] {
30
- // std::array<int, 12> buffer{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}};
31
- // multi::array_ref<int, 2> arr({3, 3}, buffer.data());
32
- // auto ptr = &arr;
28
+ // BOOST_AUTO_TEST_CASE(constexpr_ptr_access) {
29
+ // static constexpr auto test = [] {
30
+ // std::array<int, 12> buffer{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}};
31
+ // multi::array_ref<int, 2> arr({3, 3}, buffer.data());
32
+ // auto ptr = &arr;
33
33
34
34
// return (ptr->base() == buffer.data());
35
35
// }();
@@ -90,15 +90,15 @@ auto main() -> int { // NOLINT(readability-function-cognitive-complexity,bugpro
90
90
BOOST_TEST ( &std::as_const (arr)[2 ] == &ac2 );
91
91
BOOST_TEST ( &ac2 == & arr [2 ] );
92
92
93
- // auto pac2 = &ac2;
94
- // auto parr2 = &arr[2];
95
- // BOOST_TEST( pac2 == parr2 );
93
+ auto pac2 = &ac2;
94
+ auto parr2 = &arr[2 ];
95
+ BOOST_TEST ( pac2 == parr2 );
96
96
97
- // pac2 = nullptr;
98
- // BOOST_TEST( pac2 != parr2 );
97
+ pac2 = nullptr ;
98
+ BOOST_TEST ( pac2 != parr2 );
99
99
100
- // parr2 = nullptr;
101
- // BOOST_TEST( pac2 == parr2 );
100
+ parr2 = nullptr ;
101
+ BOOST_TEST ( pac2 == parr2 );
102
102
}
103
103
104
104
BOOST_AUTO_TEST_CASE (subarray_ptr_1D) {
@@ -219,17 +219,17 @@ auto main() -> int { // NOLINT(readability-function-cognitive-complexity,bugpro
219
219
220
220
using my_span = multi::array_ref<int , 1 >;
221
221
222
- #if defined(__clang__)
223
- # pragma clang diagnostic push
224
- # pragma clang diagnostic ignored "-Wunknown-warning-option"
225
- # pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
226
- #endif
222
+ #if defined(__clang__)
223
+ # pragma clang diagnostic push
224
+ # pragma clang diagnostic ignored "-Wunknown-warning-option"
225
+ # pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
226
+ #endif
227
227
228
228
auto aP = &my_span{vec.data () + 2 , {5 }}; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
229
229
230
- #if defined(__clang__)
231
- # pragma clang diagnostic pop
232
- #endif
230
+ #if defined(__clang__)
231
+ # pragma clang diagnostic pop
232
+ #endif
233
233
234
234
BOOST_TEST ( (*aP).size () == 5 );
235
235
BOOST_TEST ( aP->size () == 5 ); // doesn't work on MSVC?
0 commit comments