From 12e773f3fbd9e4cd30a8462823a9b05bc3009515 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 17 May 2022 12:40:47 +0200 Subject: [PATCH] as_group/as_view: make them transparent to the registry type --- src/entt/entity/helper.hpp | 48 ++++++++------------------------------ 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/src/entt/entity/helper.hpp b/src/entt/entity/helper.hpp index e5a81a779..a6e5959d6 100644 --- a/src/entt/entity/helper.hpp +++ b/src/entt/entity/helper.hpp @@ -13,14 +13,14 @@ namespace entt { /** * @brief Converts a registry to a view. - * @tparam Entity A valid entity type (see entt_traits for more details). + * @tparam Type Basic registry type. */ -template +template struct as_view { - /*! @brief Underlying entity identifier. */ - using entity_type = std::remove_const_t; /*! @brief Type of registry to convert. */ - using registry_type = constness_as_t, Entity>; + using registry_type = Type; + /*! @brief Underlying entity identifier. */ + using entity_type = std::remove_const_t; /** * @brief Constructs a converter for a given registry. @@ -44,30 +44,16 @@ private: registry_type ® }; -/** - * @brief Deduction guide. - * @tparam Entity A valid entity type (see entt_traits for more details). - */ -template -as_view(basic_registry &) -> as_view; - -/** - * @brief Deduction guide. - * @tparam Entity A valid entity type (see entt_traits for more details). - */ -template -as_view(const basic_registry &) -> as_view; - /** * @brief Converts a registry to a group. - * @tparam Entity A valid entity type (see entt_traits for more details). + * @tparam Type Basic registry type. */ -template +template struct as_group { - /*! @brief Underlying entity identifier. */ - using entity_type = std::remove_const_t; /*! @brief Type of registry to convert. */ - using registry_type = constness_as_t, Entity>; + using registry_type = Type; + /*! @brief Underlying entity identifier. */ + using entity_type = std::remove_const_t; /** * @brief Constructs a converter for a given registry. @@ -96,20 +82,6 @@ private: registry_type ® }; -/** - * @brief Deduction guide. - * @tparam Entity A valid entity type (see entt_traits for more details). - */ -template -as_group(basic_registry &) -> as_group; - -/** - * @brief Deduction guide. - * @tparam Entity A valid entity type (see entt_traits for more details). - */ -template -as_group(const basic_registry &) -> as_group; - /** * @brief Helper to create a listener that directly invokes a member function. * @tparam Member Member function to invoke on a component of the given type.