transparent_equal_to.h 408 B

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