template<class T, class U>
struct is_convertible
{
typedef char yes;
typedef struct
{char _[2];}no;
static yes test(U);
static no test(...);
enum {value = (sizeof(test(0)) == sizeof(yes)) ? 1 : 0};
//THE PART I'M INTERESTED IN IS (test(0)). Why 0 (zero) works here?
};
请参阅代码中的注释。