00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef MLN_TRAIT_SOLVE_HH
00027 # define MLN_TRAIT_SOLVE_HH
00028
00037 # include <mln/core/category.hh>
00038 # include <mln/metal/equal.hh>
00039 # include <mln/metal/if.hh>
00040 # include <mln/metal/ret.hh>
00041
00042
00043
00044
00045 # ifndef MLN_DEBUG_TRAITS
00046 # endif // ! MLN_DEBUG_TRAITS
00047
00048
00049 # define mln_trait_unary(Name, T) typename mln::trait::solve_unary< Name, T >::ret
00050 # define mln_trait_unary_(Name, T) mln::trait::solve_unary< Name, T >::ret
00051
00052 # define mln_trait_binary(Name, T1, T2) typename mln::trait::solve_binary< Name, T1, T2 >::ret
00053 # define mln_trait_binary_(Name, T1, T2) mln::trait::solve_binary< Name, T1, T2 >::ret
00054
00055
00056
00057 namespace mln
00058 {
00059
00060 namespace trait
00061 {
00062
00064 struct not_found {};
00065
00067 struct undefined {};
00068
00070 struct multiply_defined {};
00071
00072
00073
00074
00075
00076
00077 template < template <class> class Name,
00078 typename T >
00079 struct set_precise_unary_
00080 {
00081 typedef undefined ret;
00082 };
00083
00084
00085 template < template <class> class Name,
00086 template <class> class Category_T, typename T >
00087 struct set_unary_
00088 {
00089 typedef undefined ret;
00090 };
00091
00092 template < template <class> class Name,
00093 typename T >
00094 struct set_unary_< Name, Unknown, T >
00095 {
00096 typedef not_found ret;
00097 };
00098
00099
00100
00101
00102
00103
00104
00105 template < template <class, class> class Name,
00106 typename L,
00107 typename R >
00108 struct set_precise_binary_
00109 {
00110 typedef undefined ret;
00111 };
00112
00113
00114 template < template <class, class> class Name,
00115 template <class> class Category_L, typename L,
00116 template <class> class Category_R, typename R >
00117 struct set_binary_
00118 {
00119 typedef undefined ret;
00120 };
00121
00122 template < template <class, class> class Name,
00123 typename L,
00124 template <class> class Category_R, typename R >
00125 struct set_binary_< Name, Unknown, L, Category_R, R >
00126 {
00127 typedef not_found ret;
00128 };
00129
00130 template < template <class, class> class Name,
00131 template <class> class Category_L, typename L,
00132 typename R >
00133 struct set_binary_< Name, Category_L, L, Unknown, R >
00134 {
00135 typedef not_found ret;
00136 };
00137
00138 template < template <class, class> class Name,
00139 typename L,
00140 typename R >
00141 struct set_binary_< Name, Unknown, L, Unknown, R >
00142 {
00143 typedef not_found ret;
00144 };
00145
00146
00147 }
00148
00149 }
00150
00151
00152 # include <mln/trait/solve_unary.hh>
00153 # include <mln/trait/solve_binary.hh>
00154
00155
00156 #endif // ! MLN_TRAIT_SOLVE_HH