Explorar o código

view: ::contains in_place support for single type views

Michele Caini %!s(int64=2) %!d(string=hai) anos
pai
achega
b2cdc6aa57
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/entt/entity/view.hpp

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

@@ -802,7 +802,7 @@ public:
      * @return True if the view contains the given entity, false otherwise.
      * @return True if the view contains the given entity, false otherwise.
      */
      */
     [[nodiscard]] bool contains(const entity_type entt) const noexcept {
     [[nodiscard]] bool contains(const entity_type entt) const noexcept {
-        if constexpr(Policy == deletion_policy::swap_and_pop) {
+        if constexpr(Policy == deletion_policy::swap_and_pop || Policy == deletion_policy::in_place) {
             return leading && leading->contains(entt);
             return leading && leading->contains(entt);
         } else {
         } else {
             static_assert(Policy == deletion_policy::swap_only, "Unexpected storage policy");
             static_assert(Policy == deletion_policy::swap_only, "Unexpected storage policy");