Michele Caini пре 5 година
родитељ
комит
2d9398ae1a
1 измењених фајлова са 6 додато и 4 уклоњено
  1. 6 4
      src/entt/entity/handle.hpp

+ 6 - 4
src/entt/entity/handle.hpp

@@ -24,10 +24,12 @@ namespace entt {
  */
  */
 template<typename Entity, typename... Type>
 template<typename Entity, typename... Type>
 struct basic_handle {
 struct basic_handle {
-    /*! @brief Underlying entity identifier. */
-    using entity_type = std::remove_const_t<Entity>;
     /*! @brief Type of registry accepted by the handle. */
     /*! @brief Type of registry accepted by the handle. */
-    using registry_type = constness_as_t<basic_registry<entity_type>, Entity>;
+    using registry_type = constness_as_t<basic_registry<std::remove_const_t<Entity>>, Entity>;
+    /*! @brief Underlying entity identifier. */
+    using entity_type = typename registry_type::entity_type;
+    /*! @brief Underlying version type. */
+    using version_type = typename registry_type::version_type;
 
 
     /*! @brief Constructs an invalid handle. */
     /*! @brief Constructs an invalid handle. */
     basic_handle() ENTT_NOEXCEPT
     basic_handle() ENTT_NOEXCEPT
@@ -126,7 +128,7 @@ struct basic_handle {
      * @sa basic_registry::destroy
      * @sa basic_registry::destroy
      * @param version A desired version upon destruction.
      * @param version A desired version upon destruction.
      */
      */
-    void destroy(const typename registry_type::version_type version) {
+    void destroy(const version_type version) {
         reg->destroy(entt, version);
         reg->destroy(entt, version);
     }
     }