Skip to content

Commit

Permalink
Add N=1089 test case to test/mp_find_if_q.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Dec 21, 2024
1 parent c084518 commit 35435bf
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions test/mp_find_if_q.cpp
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -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();
}

0 comments on commit 35435bf

Please sign in to comment.