Sfoglia il codice sorgente

view: update basic_view definition

skypjack 1 mese fa
parent
commit
fdbf30abc4
2 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. 1 1
      src/entt/entity/fwd.hpp
  2. 3 2
      src/entt/entity/view.hpp

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

@@ -61,7 +61,7 @@ class basic_reactive_mixin;
 template<entity_like Entity = entity, typename = std::allocator<Entity>>
 template<entity_like Entity = entity, typename = std::allocator<Entity>>
 class basic_registry;
 class basic_registry;
 
 
-template<typename, typename, typename = void>
+template<typename, typename>
 class basic_view;
 class basic_view;
 
 
 template<typename Type, typename = std::allocator<Type *>>
 template<typename Type, typename = std::allocator<Type *>>

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

@@ -198,7 +198,7 @@ private:
  * In all other cases, modifying the storage iterated by a view in any way can
  * In all other cases, modifying the storage iterated by a view in any way can
  * invalidate all iterators.
  * invalidate all iterators.
  */
  */
-template<typename, typename, typename>
+template<typename, typename>
 class basic_view;
 class basic_view;
 
 
 /**
 /**
@@ -409,7 +409,8 @@ private:
  * @tparam Exclude Types of storage used to filter the view.
  * @tparam Exclude Types of storage used to filter the view.
  */
  */
 template<typename... Get, typename... Exclude>
 template<typename... Get, typename... Exclude>
-class basic_view<get_t<Get...>, exclude_t<Exclude...>, std::enable_if_t<(sizeof...(Get) != 0u)>>
+requires (sizeof...(Get) != 0u)
+class basic_view<get_t<Get...>, exclude_t<Exclude...>>
     : public basic_common_view<std::common_type_t<typename Get::base_type...>, internal::tombstone_check_v<Get...>, sizeof...(Get), sizeof...(Exclude)> {
     : public basic_common_view<std::common_type_t<typename Get::base_type...>, internal::tombstone_check_v<Get...>, sizeof...(Get), sizeof...(Exclude)> {
     using base_type = basic_common_view<std::common_type_t<typename Get::base_type...>, internal::tombstone_check_v<Get...>, sizeof...(Get), sizeof...(Exclude)>;
     using base_type = basic_common_view<std::common_type_t<typename Get::base_type...>, internal::tombstone_check_v<Get...>, sizeof...(Get), sizeof...(Exclude)>;