// 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 #include #include namespace hana = boost::hana; template using void_t = void; template struct has_type : std::false_type { }; template struct has_type> : std::true_type { }; auto common_type_impl = hana::sfinae([](auto t, auto u) -> hana::type< decltype(true ? hana::traits::declval(t) : hana::traits::declval(u)) > { return {}; }); template using common_type = decltype(common_type_impl(hana::type_c, hana::type_c)); BOOST_HANA_CONSTANT_CHECK( common_type_impl(hana::type_c, hana::type_c) == hana::just(hana::type_c) ); static_assert(!has_type>{}, ""); static_assert(std::is_same::type, float>{}, ""); int main() { }