27 #ifndef MLN_METAL_CONVERTS_TO_HH
28 # define MLN_METAL_CONVERTS_TO_HH
35 # include <mln/metal/is_a.hh>
36 # include <mln/metal/const.hh>
37 # include <mln/core/def/coord.hh>
40 # define mlc_converts_to(T, U) mln::metal::converts_to< T, U >
49 template <
unsigned n>
struct int_u;
50 template <
unsigned n>
struct int_s;
62 template <
typename T> eat(
const volatile T&);
63 template <
typename T> eat(
T&);
66 template <
typename T,
typename U>
67 struct helper_converts_to_
69 static yes_ selector(U,
int);
70 static no_ selector(eat, ...);
81 template <
typename T,
typename U>
82 struct converts_to :
bool_<( sizeof(internal::helper_converts_to_<T, U>
83 ::selector(*internal::make_<mlc_const(T)>::ptr(),
86 sizeof(internal::yes_) )>
90 template <
typename T,
typename U>
91 struct converts_to<
T*, U*> : converts_to<T, U>
94 template <
typename T,
typename U>
95 struct converts_to<
T**, U**> :
false_
104 template <
unsigned n>
struct converts_to<
float,
value::int_u<n> > :
true_ {};
105 template <
unsigned n>
struct converts_to<
float,
value::int_s<n> > :
true_ {};
109 template <
unsigned n>
struct converts_to<
double,
value::int_u<n> > :
true_ {};
110 template <
unsigned n>
struct converts_to<
double,
value::int_s<n> > :
true_ {};
121 #endif // ! MLN_METAL_CONVERTS_TO_HH