#include <iostream>
template <typename from, typename to>
struct is_convertible
{
struct yes_type { char a; };
struct no_type { yes_type a[2]; };
static const from& from_helper();
static yes_type test(to);
static no_type test(...);
const static bool value = sizeof(test(from_helper())) == sizeof(yes_type);
};
int main() {
std::cout << is_convertible<int, long>::value <<std::endl; // true
std::cout << is_convertible<int*, float>::value <<std::endl; // false
}