]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*! |
2 | @file | |
3 | Defines `boost::hana::Metafunction`. | |
4 | ||
b32b8144 | 5 | @copyright Louis Dionne 2013-2017 |
7c673cae FG |
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> | |
b32b8144 | 17 | #include <boost/hana/detail/integral_constant.hpp> |
7c673cae FG |
18 | |
19 | ||
1e59de90 | 20 | namespace boost { namespace hana { |
7c673cae FG |
21 | namespace detail { |
22 | template <typename F, typename Tag = typename tag_of<F>::type> | |
b32b8144 FG |
23 | struct metafunction_dispatch |
24 | : hana::integral_constant<bool, | |
25 | Metafunction<Tag>::value | |
26 | > | |
27 | { }; | |
7c673cae FG |
28 | |
29 | template <typename F> | |
b32b8144 FG |
30 | struct metafunction_dispatch<F, F> |
31 | : hana::integral_constant<bool, false> | |
32 | { }; | |
7c673cae FG |
33 | } |
34 | ||
35 | template <typename F> | |
36 | struct Metafunction | |
37 | : detail::metafunction_dispatch<F> | |
38 | { }; | |
1e59de90 | 39 | }} // end namespace boost::hana |
7c673cae FG |
40 | |
41 | #endif // !BOOST_HANA_CONCEPT_METAFUNCTION_HPP |