소스 검색

entitiy/invoke: use nth_argument_t and avoid explicitly mentioning the registry

Michele Caini 3 년 전
부모
커밋
a85ad88d5a
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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 = registry>
+template<auto Member, typename Registry = 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;