Initial revision
[ardour.git] / libs / sigc++2 / sigc++ / adaptors / deduce_result_type.h
1 // -*- c++ -*-
2 /* Do not edit! -- generated file */
3 /*
4 */
5 #ifndef _SIGC_ADAPTORS_MACROS_DEDUCE_RESULT_TYPEHM4_
6 #define _SIGC_ADAPTORS_MACROS_DEDUCE_RESULT_TYPEHM4_
7 #include <sigc++/functors/functor_trait.h>
8
9
10 namespace sigc {
11
12 /** A hint to the compiler.
13  * Functors which have all methods based on templates
14  * should publicly inherit from this hint and define 
15  * a nested template class @p deduce_result_type that
16  * can be used to deduce the methods' return types.
17  *
18  * adaptor_base inherits from the functor_base hint so
19  * derived types should also have a result_type defined.
20  *
21  * Adaptors don't inherit from this type directly. They use
22  * use sigc::adapts as a base type instead. sigc::adaptors
23  * wraps arbitrary functor types as well as function pointers
24  * and class methods.
25  *
26  * @ingroup adaptors
27  */
28 struct adaptor_base : public functor_base {};
29
30
31 /** Deduce the return type of a functor.
32  * <tt>typename deduce_result_type<functor_type, list of arg_types>::type</tt>
33  * deduces a functor's result type if @p functor_type inherits from
34  * sigc::functor_base and defines @p result_type or if @p functor_type
35  * is actually a (member) function type. Multi-type functors are not
36  * supported.
37  *
38  * sigc++ adaptors use
39  * <tt>typename deduce_result_type<functor_type, list of arg_types>::type</tt>
40  * to determine the return type of their <tt>templated operator()</tt> overloads.
41  *
42  * Adaptors in turn define a nested template class @p deduce_result_type
43  * that is used by template specializations of the global deduce_result_type
44  * template to correctly deduce the return types of the adaptor's suitable
45  * <tt>template operator()</tt> overload.
46  *
47  * @ingroup adaptors
48  */
49 template <class T_functor,
50           class T_arg1=void,class T_arg2=void,class T_arg3=void,class T_arg4=void,class T_arg5=void,class T_arg6=void,class T_arg7=void,
51           bool I_derives_adaptor_base=is_base_and_derived<adaptor_base,T_functor>::value>
52 struct deduce_result_type
53   { typedef typename functor_trait<T_functor>::result_type type; };
54
55 /** Deduce the return type of a functor.
56  * This is the template specialization of the sigc::deduce_result_type template
57  * for 0 arguments.
58  */
59 template <class T_functor>
60 struct deduce_result_type<T_functor, void,void,void,void,void,void,void, true>
61   { typedef typename T_functor::template deduce_result_type<>::type type; };
62
63 /** Deduce the return type of a functor.
64  * This is the template specialization of the sigc::deduce_result_type template
65  * for 1 arguments.
66  */
67 template <class T_functor, class T_arg1>
68 struct deduce_result_type<T_functor, T_arg1, void,void,void,void,void,void, true>
69   { typedef typename T_functor::template deduce_result_type<T_arg1>::type type; };
70
71 /** Deduce the return type of a functor.
72  * This is the template specialization of the sigc::deduce_result_type template
73  * for 2 arguments.
74  */
75 template <class T_functor, class T_arg1,class T_arg2>
76 struct deduce_result_type<T_functor, T_arg1,T_arg2, void,void,void,void,void, true>
77   { typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2>::type type; };
78
79 /** Deduce the return type of a functor.
80  * This is the template specialization of the sigc::deduce_result_type template
81  * for 3 arguments.
82  */
83 template <class T_functor, class T_arg1,class T_arg2,class T_arg3>
84 struct deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3, void,void,void,void, true>
85   { typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2,T_arg3>::type type; };
86
87 /** Deduce the return type of a functor.
88  * This is the template specialization of the sigc::deduce_result_type template
89  * for 4 arguments.
90  */
91 template <class T_functor, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
92 struct deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3,T_arg4, void,void,void, true>
93   { typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4>::type type; };
94
95 /** Deduce the return type of a functor.
96  * This is the template specialization of the sigc::deduce_result_type template
97  * for 5 arguments.
98  */
99 template <class T_functor, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
100 struct deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, void,void, true>
101   { typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::type type; };
102
103 /** Deduce the return type of a functor.
104  * This is the template specialization of the sigc::deduce_result_type template
105  * for 6 arguments.
106  */
107 template <class T_functor, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
108 struct deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, void, true>
109   { typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::type type; };
110
111 /** Deduce the return type of a functor.
112  * This is the template specialization of the sigc::deduce_result_type template
113  * for 7 arguments.
114  */
115 template <class T_functor, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
116 struct deduce_result_type<T_functor, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, true>
117   { typedef typename T_functor::template deduce_result_type<T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::type type; };
118
119
120 } /* namespace sigc */
121 #endif /* _SIGC_ADAPTORS_MACROS_DEDUCE_RESULT_TYPEHM4_ */