/* @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 using namespace boost::hana; int main() { // operator() static_assert(std::integral_constant{}() == 0, ""); static_assert(std::integral_constant{}() == 1, ""); static_assert(std::integral_constant{}() == -3, ""); // decltype(operator()) BOOST_HANA_STATIC_ASSERT(decltype_(std::integral_constant{}()) == type); BOOST_HANA_STATIC_ASSERT(decltype_(std::integral_constant{}()) == type); // conversions constexpr std::size_t a = std::integral_constant{}, b = std::integral_constant{}; static_assert(a == 0 && b == 1, ""); constexpr int c = std::integral_constant{}, d = std::integral_constant{}; static_assert(c == 0 && d == -3, ""); }