MPL11
 All Classes Namespaces Files Typedefs Macros Groups Pages
test_method_dispatch.hpp
Go to the documentation of this file.
1 
6 #ifndef BOOST_MPL11_TEST_TEST_METHOD_DISPATCH_HPP
7 #define BOOST_MPL11_TEST_TEST_METHOD_DISPATCH_HPP
8 
9 #include <boost/mpl11/core.hpp>
11 
12 
13 template <unsigned level = 0>
14 struct Archetype;
15 
16 template <unsigned level = 0>
17 struct archetype {
18  struct type { using mpl_datatype = Archetype<level>; };
19 };
20 
21 namespace boost { namespace mpl11 {
22  template <unsigned from, unsigned to>
23  struct cast<Archetype<from>, Archetype<to>> {
24  using type = cast;
25  template <typename>
26  using apply = archetype<to>;
27  };
28 }}
29 
30 template <template <typename ...> class f>
31 struct method_tag { using type = method_tag; };
32 
33 template <template <typename ...> class f, typename ...args>
34 struct method {
36  typename f<args...>::type,
37  method_tag<f>
38  >::value, "");
39 };
40 
41 #endif // !BOOST_MPL11_TEST_TEST_METHOD_DISPATCH_HPP
Defines boost::mpl11::detail::std_is_same.
Defines the Core module.
Invokes a metafunction class with the given arguments.
Definition: functional.hpp:39
Equivalent to std::is_same; except it only has a nested ::value and a nested ::type.
Definition: std_is_same.hpp:23