transparent_equal_to.h 452 B

1234567891011121314151617181920
  1. #ifndef ENTT_COMMON_TRANSPARENT_EQUAL_TO_H
  2. #define ENTT_COMMON_TRANSPARENT_EQUAL_TO_H
  3. #include <type_traits>
  4. namespace test {
  5. struct transparent_equal_to {
  6. using is_transparent = void;
  7. template<typename Type, typename Other>
  8. constexpr std::enable_if_t<std::is_convertible_v<Other, Type>, bool>
  9. operator()(const Type &lhs, const Other &rhs) const {
  10. return lhs == static_cast<Type>(rhs);
  11. }
  12. };
  13. } // namespace test
  14. #endif