26 #ifndef MLN_TRAIT_SOLVE_UNARY_HH
27 # define MLN_TRAIT_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>
46 # ifndef MLN_DEBUG_TRAITS
47 # endif // ! MLN_DEBUG_TRAITS
61 template <
template <
class>
class Name,
64 struct trait_set_unary_;
66 template <
template <
class>
class Name,
67 template <
class>
class Category,
typename _,
69 struct trait_set_unary_< Name, Category<_>, T >
71 typedef typename mln::trait::set_unary_<Name, Category, T>::ret ret;
76 template <
template <
class>
class Name,
77 typename Category,
typename T >
81 template <
typename user_ret,
82 template <
class>
class Name,
83 typename Category,
typename T >
84 struct helper_get_unary_
90 template <
template <
class>
class Name,
91 typename Category,
typename T >
92 struct helper_get_unary_< not_found,
95 typedef not_found ret;
99 template <
template <
class>
class Name,
100 typename Category,
typename T >
101 struct helper_get_unary_< undefined,
104 typedef typename mln::internal::super_category_< Category, T >::ret Super_Category;
105 typedef typename get_unary_<Name, Super_Category, T>::ret ret;
109 template <
template <
class>
class Name,
110 typename Category,
typename T >
113 typedef typename trait_set_unary_<Name, Category, T>::ret user_ret;
114 typedef helper_get_unary_<user_ret, Name, Category, T> helper;
115 typedef mlc_ret(helper) ret;
119 template < typename precise_ret,
120 template <class> class Name,
121 typename Category, typename T >
122 struct helper_choose_unary_wrt_
124 typedef precise_ret ret;
127 template <
template <
class>
class Name,
128 typename Category,
typename T >
129 struct helper_choose_unary_wrt_< undefined,
132 typedef typename get_unary_<Name, Category, T>::ret ret;
136 template <
template <
class>
class Name,
137 typename Category,
typename T >
138 struct helper_solve_unary_
140 typedef typename set_precise_unary_<Name, T>::ret precise_ret;
141 typedef helper_choose_unary_wrt_< precise_ret,
142 Name, Category, T> helper;
143 typedef mlc_ret(helper) ret;
149 template < template <class> class Name,
154 typedef typename mln::category<T>::ret Category;
155 typedef internal::helper_solve_unary_< Name, Category, T > meta_code;
156 typedef typename meta_code::ret ret;
164 #endif // ! MLN_TRAIT_SOLVE_UNARY_HH