From 8d64106372a12fbeec492d96530094ab837cfef2 Mon Sep 17 00:00:00 2001 From: skypjack Date: Tue, 16 Dec 2025 16:14:03 +0100 Subject: [PATCH] view: refine storage view conversion logic --- src/entt/entity/view.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index 893920013..94a9f2ba6 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -903,8 +903,10 @@ class basic_view, exclude_t<>> : public basic_storage_view { using base_type = basic_storage_view; - basic_view(Get *value) noexcept - : base_type{value} { + void storage_if(Get *value) noexcept { + if(value != nullptr) { + storage(*value); + } } public: @@ -949,7 +951,8 @@ public: */ template>>> basic_view(const basic_view &other) noexcept - : basic_view{other.storage()} { + : base_type{} { + storage_if(other.storage()); } /**