26 #ifndef MLN_TRAIT_NEXT_SOLVE_UNARY_HH
27 # define MLN_TRAIT_NEXT_SOLVE_UNARY_HH
37 # include <mln/core/category.hh>
38 # include <mln/core/routine/exact.hh>
39 # include <mln/metal/equal.hh>
40 # include <mln/metal/if.hh>
41 # include <mln/metal/ret.hh>
42 # include <mln/trait/next/solve.hh>
47 # ifndef MLN_DEBUG_TRAITS
48 # endif // ! MLN_DEBUG_TRAITS
65 template <
typename Name,
68 struct trait_set_unary_;
70 template <
typename Name,
71 template <
class>
class Category,
typename _,
73 struct trait_set_unary_< Name, Category<_>,
T >
80 template <
typename Name,
81 typename Category,
typename T >
85 template <
typename user_ret,
87 typename Category,
typename T >
88 struct helper_get_unary_
94 template <
typename Name,
95 typename Category,
typename T >
96 struct helper_get_unary_< not_found,
99 typedef not_found
ret;
103 template <
typename Name,
104 typename Category,
typename T >
105 struct helper_get_unary_< undefined,
109 typedef typename get_unary_<Name, Super_Category, T>::ret
ret;
113 template <
typename Name,
114 typename Category,
typename T >
117 typedef typename trait_set_unary_<Name, Category, T>::ret user_ret;
118 typedef helper_get_unary_<user_ret, Name, Category, T> helper;
119 typedef mlc_ret(helper)
ret;
123 template < typename precise_ret,
125 typename Category, typename
T >
126 struct helper_choose_unary_wrt_
128 typedef precise_ret ret;
131 template <
typename Name,
132 typename Category,
typename T >
133 struct helper_choose_unary_wrt_< undefined,
136 typedef typename get_unary_<Name, Category, T>::ret
ret;
140 template <
typename Name,
141 typename Category,
typename T >
142 struct helper_solve_unary_
144 typedef typename set_precise_unary_<Name, T>::ret precise_ret;
145 typedef helper_choose_unary_wrt_< precise_ret,
146 Name, Category,
T> helper;
147 typedef mlc_ret(helper)
ret;
153 template < typename Name,
157 typedef mln_exact(T_)
T;
158 typedef typename mln::category<T>::ret Category;
159 typedef internal::helper_solve_unary_< Name, Category, T > meta_code;
160 typedef typename meta_code::ret ret;
170 #endif // ! MLN_TRAIT_NEXT_SOLVE_UNARY_HH