transparent_equal_to.h 431 B

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