#pragma once #include #include namespace c10 { namespace guts { /** * is_equality_comparable is true_type iff the equality operator is defined for T. */ template struct is_equality_comparable : std::false_type {}; template struct is_equality_comparable() == std::declval())>> : std::true_type {}; template using is_equality_comparable_t = typename is_equality_comparable::type; /** * is_hashable is true_type iff std::hash is defined for T */ template struct is_hashable : std::false_type {}; template struct is_hashable()(std::declval()))>> : std::true_type {}; template using is_hashable_t = typename is_hashable::type; /** * is_function_type is true_type iff T is a plain function type (i.e. "Result(Args...)") */ template struct is_function_type : std::false_type {}; template struct is_function_type : std::true_type {}; template using is_function_type_t = typename is_function_type::type; /** * is_instantiation_of is true_type iff I is a template instantiation of T (e.g. vector is an instantiation of vector) * Example: * is_instantiation_of_t> // true * is_instantiation_of_t> // true * is_instantiation_of_t> // false */ template