/* @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 using namespace boost::hana; int main() { { //! [make] BOOST_HANA_CONSTEXPR_CHECK(first(make(1, 'x')) == 1); BOOST_HANA_CONSTEXPR_CHECK(second(make(1, 'x')) == 'x'); //! [make] }{ //! [make_pair] BOOST_HANA_CONSTEXPR_CHECK(make_pair(1, 'x') == make(1, 'x')); //! [make_pair] }{ //! [comparable] BOOST_HANA_CONSTEXPR_CHECK(make(1, 'x') == make(1, 'x')); BOOST_HANA_CONSTEXPR_CHECK(make(2, 'x') != make(1, 'x')); BOOST_HANA_CONSTEXPR_CHECK(make(1, 'y') != make(1, 'x')); //! [comparable] }{ //! [orderable] BOOST_HANA_CONSTEXPR_CHECK(make(1, 'x') < make(1, 'y')); BOOST_HANA_CONSTEXPR_CHECK(make(1, 'x') < make(10, 'x')); BOOST_HANA_CONSTEXPR_CHECK(make(1, 'y') < make(10, 'x')); //! [orderable] }{ //! [foldable] BOOST_HANA_CONSTEXPR_CHECK(fold.left(make(1, 3), 0, plus) == 4); BOOST_HANA_CONSTEXPR_CHECK(fold.right(make(1, 3), 0, minus) == -2); //! [foldable] }{ //! [product] BOOST_HANA_CONSTEXPR_CHECK(first(make(1, 'x')) == 1); BOOST_HANA_CONSTEXPR_CHECK(second(make(1, 'x')) == 'x'); //! [product] } }