소스 검색

view: avoid unnecessary parameter pack

Michele Caini 4 년 전
부모
커밋
88db623dc1
1개의 변경된 파일과 2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/entt/entity/view.hpp

+ 2 - 2
src/entt/entity/view.hpp

@@ -577,9 +577,9 @@ public:
      * @tparam Comp Type of component of which to return the storage.
      * @tparam Comp Type of component of which to return the storage.
      * @return The storage for the given component type.
      * @return The storage for the given component type.
      */
      */
-    template<typename... Comp>
+    template<typename Comp = Component>
     [[nodiscard]] decltype(auto) storage() const ENTT_NOEXCEPT {
     [[nodiscard]] decltype(auto) storage() const ENTT_NOEXCEPT {
-        static_assert((std::is_same_v<Comp, Component> && ...), "Invalid component type");
+        static_assert(std::is_same_v<Comp, Component>, "Invalid component type");
         return *std::get<0>(pools);
         return *std::get<0>(pools);
     }
     }