/* @copyright Louis Dionne 2015 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #include #include #include #include #include #include #include #include #include using namespace boost::hana; using test::ct_eq; using test::ct_ord; int main() { auto eq_elems = make(ct_eq<3>{}, ct_eq<4>{}); auto eqs = make( std::make_pair(ct_eq<3>{}, ct_eq<3>{}) , std::make_pair(ct_eq<3>{}, ct_eq<4>{}) , std::make_pair(ct_eq<4>{}, ct_eq<3>{}) , std::make_pair(ct_eq<4>{}, ct_eq<4>{}) ); auto ords = make( std::make_pair(ct_ord<3>{}, ct_ord<3>{}) , std::make_pair(ct_ord<3>{}, ct_ord<4>{}) , std::make_pair(ct_ord<4>{}, ct_ord<3>{}) , std::make_pair(ct_ord<4>{}, ct_ord<4>{}) ); ////////////////////////////////////////////////////////////////////////// // Comparable, Orderable, Foldable ////////////////////////////////////////////////////////////////////////// test::TestComparable{eqs}; test::TestOrderable{ords}; test::TestFoldable{eqs}; ////////////////////////////////////////////////////////////////////////// // Product ////////////////////////////////////////////////////////////////////////// { // first { BOOST_HANA_CONSTANT_CHECK(equal( first(std::make_pair(ct_eq<0>{}, ct_eq<1>{})), ct_eq<0>{} )); } // second { BOOST_HANA_CONSTANT_CHECK(equal( second(std::make_pair(ct_eq<0>{}, ct_eq<1>{})), ct_eq<1>{} )); } // make { BOOST_HANA_CONSTANT_CHECK(equal( make(ct_eq<0>{}, ct_eq<1>{}), std::make_pair(ct_eq<0>{}, ct_eq<1>{}) )); } // laws test::TestProduct{eq_elems}; } }