Skip to content

Commit 35435bf

Browse files
committed
Add N=1089 test case to test/mp_find_if_q.cpp
1 parent c084518 commit 35435bf

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

test/mp_find_if_q.cpp

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
2-
// Copyright 2015, 2017 Peter Dimov.
3-
//
1+
// Copyright 2015, 2017, 2024 Peter Dimov
42
// Distributed under the Boost Software License, Version 1.0.
5-
//
6-
// See accompanying file LICENSE_1_0.txt or copy at
7-
// http://www.boost.org/LICENSE_1_0.txt
8-
3+
// https://www.boost.org/LICENSE_1_0.txt
94

105
#include <boost/mp11/algorithm.hpp>
116
#include <boost/mp11/list.hpp>
127
#include <boost/mp11/integral.hpp>
138
#include <boost/mp11/utility.hpp>
9+
#include <boost/mp11/bind.hpp>
1410
#include <boost/core/lightweight_test_trait.hpp>
1511
#include <type_traits>
1612
#include <tuple>
@@ -57,5 +53,26 @@ int main()
5753
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_find_if_q<L2, mp_quote<std::is_pointer>>, mp_size_t<1>>));
5854
}
5955

56+
{
57+
using boost::mp11::mp_iota_c;
58+
using boost::mp11::mp_bind_front;
59+
using boost::mp11::mp_less;
60+
61+
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
62+
63+
int const N = 257;
64+
65+
#else
66+
67+
int const N = 1089;
68+
69+
#endif
70+
71+
using L = mp_iota_c<N>;
72+
using R = mp_find_if_q< L, mp_bind_front<mp_less, mp_size_t<N/2>> >;
73+
74+
BOOST_TEST_TRAIT_TRUE((std::is_same<R, mp_size_t<N/2+1>>));
75+
}
76+
6077
return boost::report_errors();
6178
}

0 commit comments

Comments
 (0)