/* @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 using namespace boost::hana; //! [integral_create] auto one = integral; auto yes = integral; //! [integral_create] //! [integral_api] using One = decltype(one); static_assert(std::is_same{}, ""); static_assert(std::is_same{}, ""); static_assert(One::value == 1 && static_cast(one) == 1 && one() == 1 && value(one) == 1 , "these are all constant expressions"); //! [integral_api] namespace anon { //! [integral_shorthands] auto one = int_<1>; auto yes = bool_; //! [integral_shorthands] } //! [integral_operators] BOOST_HANA_CONSTANT_ASSERT(int_<1> == integral); BOOST_HANA_CONSTANT_ASSERT(int_<1> + long_<2> == long_<3>); BOOST_HANA_CONSTANT_ASSERT(!(bool_ && bool_)); //! [integral_operators] int main() { }