boost/libs/mp11/test/mp_max.cpp
2018-01-12 21:47:58 +01:00

27 lines
781 B
C++

// Copyright 2017 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
#include <boost/mp11/function.hpp>
#include <boost/mp11/integral.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <type_traits>
int main()
{
using boost::mp11::mp_max;
using boost::mp11::mp_int;
using boost::mp11::mp_size_t;
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_max<mp_int<1>>, mp_int<1>>));
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_max<mp_int<2>, mp_int<1>, mp_int<2>, mp_int<3>>, mp_int<3>>));
BOOST_TEST_TRAIT_TRUE((std::is_same<mp_max<mp_int<-1>, mp_size_t<1>, mp_int<-2>, mp_size_t<2>>, mp_size_t<2>>));
return boost::report_errors();
}