view: ::contains in_place support for single type views

This commit is contained in:
Michele Caini
2024-07-10 16:48:25 +02:00
parent d233a40c3d
commit b2cdc6aa57
+1 -1
View File
@@ -802,7 +802,7 @@ public:
* @return True if the view contains the given entity, false otherwise.
*/
[[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);
} else {
static_assert(Policy == deletion_policy::swap_only, "Unexpected storage policy");