Prechádzať zdrojové kódy

entity/invoke: properly decay deduced argument to avoid nasty errors with reference types

Michele Caini 3 rokov pred
rodič
commit
fe3b5b03eb
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      src/entt/entity/helper.hpp

+ 1 - 1
src/entt/entity/helper.hpp

@@ -89,7 +89,7 @@ private:
  * @param reg A registry that contains the given entity and its components.
  * @param entt Entity from which to get the component.
  */
-template<auto Member, typename Registry = nth_argument_t<0u, Member>>
+template<auto Member, typename Registry = std::remove_const_t<std::remove_reference_t<nth_argument_t<0u, Member>>>>
 void invoke(Registry &reg, const typename Registry::entity_type entt) {
     static_assert(std::is_member_function_pointer_v<decltype(Member)>, "Invalid pointer to non-static member function");
     delegate<void(Registry &, const typename Registry::entity_type)> func;