1 /*! 2 @file 3 Defines `boost::hana::Metafunction`. 4 5 @copyright Louis Dionne 2013-2017 6 Distributed under the Boost Software License, Version 1.0. 7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) 8 */ 9 10 #ifndef BOOST_HANA_CONCEPT_METAFUNCTION_HPP 11 #define BOOST_HANA_CONCEPT_METAFUNCTION_HPP 12 13 #include <boost/hana/fwd/concept/metafunction.hpp> 14 15 #include <boost/hana/config.hpp> 16 #include <boost/hana/core/tag_of.hpp> 17 #include <boost/hana/detail/integral_constant.hpp> 18 19 20 BOOST_HANA_NAMESPACE_BEGIN 21 namespace detail { 22 template <typename F, typename Tag = typename tag_of<F>::type> 23 struct metafunction_dispatch 24 : hana::integral_constant<bool, 25 Metafunction<Tag>::value 26 > 27 { }; 28 29 template <typename F> 30 struct metafunction_dispatch<F, F> 31 : hana::integral_constant<bool, false> 32 { }; 33 } 34 35 template <typename F> 36 struct Metafunction 37 : detail::metafunction_dispatch<F> 38 { }; 39 BOOST_HANA_NAMESPACE_END 40 41 #endif // !BOOST_HANA_CONCEPT_METAFUNCTION_HPP 42