28 #ifndef VC_TRAITS_HAS_EQUALITY_OPERATOR_H_
29 #define VC_TRAITS_HAS_EQUALITY_OPERATOR_H_
34 template <
typename T,
typename U,
35 typename = enable_if<!std::is_same<void, decltype(std::declval<T>() == std::declval<U>())>::value>>
36 std::true_type test(
int);
37 template <
typename T,
typename U> std::false_type test(...);
41 template <
typename T,
typename U = T>
42 struct has_equality_operator :
public decltype(has_equality_operator_impl::test<T, U>(1))
46 static_assert(has_equality_operator<int>::value,
"has_equality_operator fails");
50 static_assert(!has_equality_operator<Foobar>::value,
"has_equality_operator fails");
53 #endif // VC_TRAITS_HAS_EQUALITY_OPERATOR_H_