|
1 | | - |
2 | | -// Copyright 2015, 2017 Peter Dimov. |
3 | | -// |
| 1 | +// Copyright 2015, 2017, 2024 Peter Dimov |
4 | 2 | // 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 |
9 | 4 |
|
10 | 5 | #include <boost/mp11/algorithm.hpp> |
11 | 6 | #include <boost/mp11/list.hpp> |
12 | 7 | #include <boost/mp11/integral.hpp> |
13 | 8 | #include <boost/mp11/utility.hpp> |
| 9 | +#include <boost/mp11/bind.hpp> |
14 | 10 | #include <boost/core/lightweight_test_trait.hpp> |
15 | 11 | #include <type_traits> |
16 | 12 | #include <tuple> |
@@ -57,5 +53,26 @@ int main() |
57 | 53 | BOOST_TEST_TRAIT_TRUE((std::is_same<mp_find_if_q<L2, mp_quote<std::is_pointer>>, mp_size_t<1>>)); |
58 | 54 | } |
59 | 55 |
|
| 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 | + |
60 | 77 | return boost::report_errors(); |
61 | 78 | } |
0 commit comments