/* @copyright Louis Dionne 2014 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 #include #include #include #include #include using namespace boost::hana; int main() { //! [standard] BOOST_HANA_CONSTANT_CHECK( is); BOOST_HANA_CONSTANT_CHECK(!is); BOOST_HANA_CONSTANT_CHECK(!is); BOOST_HANA_CONSTANT_CHECK( is); //! [standard] //! [alternate] constexpr auto row = tuple; BOOST_HANA_CONSTEXPR_LAMBDA auto check_table = [](auto ...headers) { return [=](auto ...rows) { auto row_is_correct = [=](auto row) { return tuple(headers(head(row))...) == tail(row); }; BOOST_HANA_CONSTANT_CHECK(all(tuple(rows...), row_is_correct)); }; }; check_table( is, is, is_a )( row(just(1), false_, false_, true_ ), row(tuple(1, '2', 3.3), false_, true_, true_ ), row(std::make_tuple("abc", 'd'), false_, true_, true_ ), row(long_<12>, true_, false_, false_ ), row(range(int_<-4>, int_<15>), false_, true_, false_ ) ); //! [alternate] }