// Copyright Louis Dionne 2013-2017 // 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 namespace hana = boost::hana; struct x1; struct x2; struct x3; struct y1 { }; struct y2 { }; struct y3 { }; template struct f; BOOST_HANA_CONSTANT_CHECK(hana::equal( hana::template_(), hana::type_c> )); BOOST_HANA_CONSTANT_CHECK(hana::equal( hana::template_(hana::type_c), hana::type_c> )); BOOST_HANA_CONSTANT_CHECK(hana::equal( hana::template_(hana::type_c, hana::type_c), hana::type_c> )); BOOST_HANA_CONSTANT_CHECK(hana::equal( hana::template_(hana::type_c, hana::type_c, hana::type_c), hana::type_c> )); using F = decltype(hana::template_); static_assert(std::is_same::type, f<>>{}, ""); static_assert(std::is_same::type, f>{}, ""); static_assert(std::is_same::type, f>{}, ""); static_assert(std::is_same::type, f>{}, ""); // Make sure we model the Metafunction concept static_assert(hana::Metafunction)>::value, ""); static_assert(hana::Metafunction)&>::value, ""); // Make sure we can use aliases template using alias = T; static_assert(hana::template_(hana::type_c) == hana::type_c, ""); // Make sure template_ is SFINAE-friendly template struct unary; BOOST_HANA_CONSTANT_CHECK(hana::not_( hana::is_valid(hana::template_)(hana::type_c, hana::type_c) )); // Make sure we don't read from a non-constexpr variable int main() { auto t = hana::type_c; constexpr auto r = hana::template_(t); (void)r; }