C++的判断上当然要复杂一些:
template<typename T1, typename T2> struct is_same_type { operator bool() { return false; } }; template<typename T1> struct is_same_type<T1, T1> { operator bool() { return true; } };
C++的判断上当然要复杂一些:
template<typename T1, typename T2> struct is_same_type { operator bool() { return false; } }; template<typename T1> struct is_same_type<T1, T1> { operator bool() { return true; } };