Test mp_fold and mp_reverse_fold with std::pair. Refs #108.

This commit is contained in:
Peter Dimov
2025-10-21 18:48:33 +03:00
parent 50e2a0a1b8
commit d27d821192
4 changed files with 28 additions and 28 deletions

View File

@@ -1,11 +1,6 @@
// Copyright 2015-2017 Peter Dimov.
//
// Copyright 2015-2017, 2025 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>
@@ -14,6 +9,7 @@
#include <boost/core/lightweight_test_trait.hpp>
#include <type_traits>
#include <tuple>
#include <utility>
struct X1 {};
struct X2 {};
@@ -46,6 +42,10 @@ int main()
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_reverse_fold_q<std::tuple<X1, X2, X3, X4>, void, Q>, F<X1, F<X2, F<X3, F<X4, void>>>>>));
}
{
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_reverse_fold_q<std::pair<X1, X2>, void, Q>, F<X1, F<X2, void>>>));
}
using boost::mp11::mp_bind;
using boost::mp11::_1;
using boost::mp11::_2;