1
0
forked from boostorg/mp11

Add N=1089 test case to test/mp_find_if_q.cpp

This commit is contained in:
Peter Dimov
2024-12-21 21:40:56 +02:00
parent c08451873c
commit 35435bf206

View File

@@ -1,16 +1,12 @@
// Copyright 2015, 2017 Peter Dimov.
//
// Copyright 2015, 2017, 2024 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
//
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/mp11/algorithm.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/mp11/bind.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <type_traits>
#include <tuple>
@@ -57,5 +53,26 @@ int main()
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_find_if_q<L2, mp_quote<std::is_pointer>>, mp_size_t<1>>));
}
{
using boost::mp11::mp_iota_c;
using boost::mp11::mp_bind_front;
using boost::mp11::mp_less;
#if BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1920 )
int const N = 257;
#else
int const N = 1089;
#endif
using L = mp_iota_c<N>;
using R = mp_find_if_q< L, mp_bind_front<mp_less, mp_size_t<N/2>> >;
BOOST_TEST_TRAIT_TRUE((std::is_same<R, mp_size_t<N/2+1>>));
}
return boost::report_errors();
}