From 5d8a1e3ee1239123d5b4a0e9911ebcbd58368b6c Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Thu, 14 Dec 2023 09:42:23 +0100 Subject: [PATCH] view: proper ctors for single type base view --- src/entt/entity/view.hpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/entt/entity/view.hpp b/src/entt/entity/view.hpp index 52aefa5bc..62096ce25 100644 --- a/src/entt/entity/view.hpp +++ b/src/entt/entity/view.hpp @@ -615,7 +615,17 @@ public: * @tparam Type Common type among all storage types. */ template -struct basic_storage_view { +class basic_storage_view { +protected: + /*! @cond TURN_OFF_DOXYGEN */ + basic_storage_view() noexcept + : leading{} {} + + basic_storage_view(const Type *value) noexcept + : leading{value} {} + /*! @endcond */ + +public: /*! @brief Common type among all storage types. */ using common_type = Type; /*! @brief Underlying entity identifier. */ @@ -738,7 +748,7 @@ struct basic_storage_view { protected: /*! @cond TURN_OFF_DOXYGEN */ - const common_type *leading{}; + const common_type *leading; /*! @endcond */ }; @@ -779,8 +789,7 @@ public: * @param value The storage for the type to iterate. */ basic_view(Get &value) noexcept - : basic_view{} { - storage(value); + : base_type{&value} { } /**