Browse Source

*: use transparent comparators

Michele Caini 1 year ago
parent
commit
e5804ac0a2

+ 2 - 2
src/entt/container/fwd.hpp

@@ -12,14 +12,14 @@ template<
     typename Key,
     typename Key,
     typename Type,
     typename Type,
     typename = std::hash<Key>,
     typename = std::hash<Key>,
-    typename = std::equal_to<Key>,
+    typename = std::equal_to<>,
     typename = std::allocator<std::pair<const Key, Type>>>
     typename = std::allocator<std::pair<const Key, Type>>>
 class dense_map;
 class dense_map;
 
 
 template<
 template<
     typename Type,
     typename Type,
     typename = std::hash<Type>,
     typename = std::hash<Type>,
-    typename = std::equal_to<Type>,
+    typename = std::equal_to<>,
     typename = std::allocator<Type>>
     typename = std::allocator<Type>>
 class dense_set;
 class dense_set;
 
 

+ 3 - 3
src/entt/entity/registry.hpp

@@ -218,7 +218,7 @@ public:
     }
     }
 
 
 private:
 private:
-    dense_map<id_type, basic_any<0u>, identity, std::equal_to<id_type>, allocator_type> ctx;
+    dense_map<id_type, basic_any<0u>, identity, std::equal_to<>, allocator_type> ctx;
 };
 };
 
 
 } // namespace internal
 } // namespace internal
@@ -235,8 +235,8 @@ class basic_registry {
     using alloc_traits = std::allocator_traits<Allocator>;
     using alloc_traits = std::allocator_traits<Allocator>;
     static_assert(std::is_same_v<typename alloc_traits::value_type, Entity>, "Invalid value type");
     static_assert(std::is_same_v<typename alloc_traits::value_type, Entity>, "Invalid value type");
     // std::shared_ptr because of its type erased allocator which is useful here
     // std::shared_ptr because of its type erased allocator which is useful here
-    using pool_container_type = dense_map<id_type, std::shared_ptr<base_type>, identity, std::equal_to<id_type>, typename alloc_traits::template rebind_alloc<std::pair<const id_type, std::shared_ptr<base_type>>>>;
-    using group_container_type = dense_map<id_type, std::shared_ptr<internal::group_descriptor>, identity, std::equal_to<id_type>, typename alloc_traits::template rebind_alloc<std::pair<const id_type, std::shared_ptr<internal::group_descriptor>>>>;
+    using pool_container_type = dense_map<id_type, std::shared_ptr<base_type>, identity, std::equal_to<>, typename alloc_traits::template rebind_alloc<std::pair<const id_type, std::shared_ptr<base_type>>>>;
+    using group_container_type = dense_map<id_type, std::shared_ptr<internal::group_descriptor>, identity, std::equal_to<>, typename alloc_traits::template rebind_alloc<std::pair<const id_type, std::shared_ptr<internal::group_descriptor>>>>;
     using traits_type = entt_traits<Entity>;
     using traits_type = entt_traits<Entity>;
 
 
     template<typename Type>
     template<typename Type>

+ 2 - 2
src/entt/graph/flow.hpp

@@ -29,9 +29,9 @@ template<typename Allocator>
 class basic_flow {
 class basic_flow {
     using alloc_traits = std::allocator_traits<Allocator>;
     using alloc_traits = std::allocator_traits<Allocator>;
     static_assert(std::is_same_v<typename alloc_traits::value_type, id_type>, "Invalid value type");
     static_assert(std::is_same_v<typename alloc_traits::value_type, id_type>, "Invalid value type");
-    using task_container_type = dense_set<id_type, identity, std::equal_to<id_type>, typename alloc_traits::template rebind_alloc<id_type>>;
+    using task_container_type = dense_set<id_type, identity, std::equal_to<>, typename alloc_traits::template rebind_alloc<id_type>>;
     using ro_rw_container_type = std::vector<std::pair<std::size_t, bool>, typename alloc_traits::template rebind_alloc<std::pair<std::size_t, bool>>>;
     using ro_rw_container_type = std::vector<std::pair<std::size_t, bool>, typename alloc_traits::template rebind_alloc<std::pair<std::size_t, bool>>>;
-    using deps_container_type = dense_map<id_type, ro_rw_container_type, identity, std::equal_to<id_type>, typename alloc_traits::template rebind_alloc<std::pair<const id_type, ro_rw_container_type>>>;
+    using deps_container_type = dense_map<id_type, ro_rw_container_type, identity, std::equal_to<>, typename alloc_traits::template rebind_alloc<std::pair<const id_type, ro_rw_container_type>>>;
     using adjacency_matrix_type = adjacency_matrix<directed_tag, typename alloc_traits::template rebind_alloc<std::size_t>>;
     using adjacency_matrix_type = adjacency_matrix<directed_tag, typename alloc_traits::template rebind_alloc<std::size_t>>;
 
 
     void emplace(const id_type res, const bool is_rw) {
     void emplace(const id_type res, const bool is_rw) {

+ 1 - 1
src/entt/resource/cache.hpp

@@ -154,7 +154,7 @@ class resource_cache {
     using alloc_traits = std::allocator_traits<Allocator>;
     using alloc_traits = std::allocator_traits<Allocator>;
     static_assert(std::is_same_v<typename alloc_traits::value_type, Type>, "Invalid value type");
     static_assert(std::is_same_v<typename alloc_traits::value_type, Type>, "Invalid value type");
     using container_allocator = typename alloc_traits::template rebind_alloc<std::pair<const id_type, typename Loader::result_type>>;
     using container_allocator = typename alloc_traits::template rebind_alloc<std::pair<const id_type, typename Loader::result_type>>;
-    using container_type = dense_map<id_type, typename Loader::result_type, identity, std::equal_to<id_type>, container_allocator>;
+    using container_type = dense_map<id_type, typename Loader::result_type, identity, std::equal_to<>, container_allocator>;
 
 
 public:
 public:
     /*! @brief Allocator type. */
     /*! @brief Allocator type. */

+ 1 - 1
src/entt/signal/dispatcher.hpp

@@ -115,7 +115,7 @@ class basic_dispatcher {
 
 
     using alloc_traits = std::allocator_traits<Allocator>;
     using alloc_traits = std::allocator_traits<Allocator>;
     using container_allocator = typename alloc_traits::template rebind_alloc<std::pair<const key_type, mapped_type>>;
     using container_allocator = typename alloc_traits::template rebind_alloc<std::pair<const key_type, mapped_type>>;
-    using container_type = dense_map<key_type, mapped_type, identity, std::equal_to<key_type>, container_allocator>;
+    using container_type = dense_map<key_type, mapped_type, identity, std::equal_to<>, container_allocator>;
 
 
     template<typename Type>
     template<typename Type>
     [[nodiscard]] handler_type<Type> &assure(const id_type id) {
     [[nodiscard]] handler_type<Type> &assure(const id_type id) {

+ 1 - 1
src/entt/signal/emitter.hpp

@@ -39,7 +39,7 @@ class emitter {
 
 
     using alloc_traits = std::allocator_traits<Allocator>;
     using alloc_traits = std::allocator_traits<Allocator>;
     using container_allocator = typename alloc_traits::template rebind_alloc<std::pair<const key_type, mapped_type>>;
     using container_allocator = typename alloc_traits::template rebind_alloc<std::pair<const key_type, mapped_type>>;
-    using container_type = dense_map<key_type, mapped_type, identity, std::equal_to<key_type>, container_allocator>;
+    using container_type = dense_map<key_type, mapped_type, identity, std::equal_to<>, container_allocator>;
 
 
 public:
 public:
     /*! @brief Allocator type. */
     /*! @brief Allocator type. */