forked from boostorg/mp11
Add test/mpl_tuple.cpp
This commit is contained in:
@@ -192,6 +192,7 @@ run mp_bind_back.cpp ;
|
|||||||
# mpl
|
# mpl
|
||||||
run mpl.cpp : ;
|
run mpl.cpp : ;
|
||||||
run mpl_list.cpp : ;
|
run mpl_list.cpp : ;
|
||||||
|
run mpl_tuple.cpp : ;
|
||||||
|
|
||||||
# version
|
# version
|
||||||
run version.cpp ;
|
run version.cpp ;
|
||||||
|
36
test/mpl_tuple.cpp
Normal file
36
test/mpl_tuple.cpp
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
// Copyright 2017, 2019 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/mpl_tuple.hpp>
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
|
#include <boost/mpl/at.hpp>
|
||||||
|
#include <boost/mpl/size.hpp>
|
||||||
|
|
||||||
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
namespace mpl = boost::mpl;
|
||||||
|
using namespace boost::mp11;
|
||||||
|
|
||||||
|
using L1 = std::tuple<char, int, float>;
|
||||||
|
|
||||||
|
BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at<L1, mpl::int_<0>>::type, mp_at_c<L1, 0>>));
|
||||||
|
BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at<L1, mpl::int_<1>>::type, mp_at_c<L1, 1>>));
|
||||||
|
BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at<L1, mpl::int_<2>>::type, mp_at_c<L1, 2>>));
|
||||||
|
|
||||||
|
BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at_c<L1, 0>::type, mp_at_c<L1, 0>>));
|
||||||
|
BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at_c<L1, 1>::type, mp_at_c<L1, 1>>));
|
||||||
|
BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at_c<L1, 2>::type, mp_at_c<L1, 2>>));
|
||||||
|
|
||||||
|
BOOST_TEST_EQ((mpl::size<L1>::type::value), mp_size<L1>::value);
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Reference in New Issue
Block a user