From bc929bcb909bfc8be7f8d236c67549f7c9781ef3 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 18 May 2022 15:21:35 +0200 Subject: [PATCH] snapshot: suppress warnings/errors due to shadow template parameters --- src/entt/entity/snapshot.hpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/entt/entity/snapshot.hpp b/src/entt/entity/snapshot.hpp index 8014c59cc..5892c767b 100644 --- a/src/entt/entity/snapshot.hpp +++ b/src/entt/entity/snapshot.hpp @@ -163,28 +163,28 @@ template class basic_snapshot_loader { using entity_traits = entt_traits; - template + template void assign(Archive &archive) const { typename entity_traits::entity_type length{}; entity_type entt; archive(length); - if constexpr(ignore_as_empty_v) { + if constexpr(ignore_as_empty_v) { while(length--) { archive(entt); const auto entity = reg->valid(entt) ? entt : reg->create(entt); ENTT_ASSERT(entity == entt, "Entity not available for use"); - reg->template emplace(entt); + reg->template emplace(entt); } } else { - Type instance; + Component instance; while(length--) { archive(entt, instance); const auto entity = reg->valid(entt) ? entt : reg->create(entt); ENTT_ASSERT(entity == entt, "Entity not available for use"); - reg->template emplace(entt, std::move(instance)); + reg->template emplace(entt, std::move(instance)); } } } @@ -357,9 +357,9 @@ class basic_continuous_loader { } } - template - void update([[maybe_unused]] Other &instance, [[maybe_unused]] Member Type::*member) { - if constexpr(!std::is_same_v) { + template + void update([[maybe_unused]] Component &instance, [[maybe_unused]] Member Other::*member) { + if constexpr(!std::is_same_v) { return; } else if constexpr(std::is_same_v) { instance.*member = map(instance.*member); @@ -380,27 +380,27 @@ class basic_continuous_loader { } } - template - void assign(Archive &archive, [[maybe_unused]] Member Type::*...member) { + template + void assign(Archive &archive, [[maybe_unused]] Member Other::*...member) { typename entity_traits::entity_type length{}; entity_type entt; archive(length); - if constexpr(ignore_as_empty_v) { + if constexpr(ignore_as_empty_v) { while(length--) { archive(entt); restore(entt); - reg->template emplace_or_replace(map(entt)); + reg->template emplace_or_replace(map(entt)); } } else { - Other instance; + Component instance; while(length--) { archive(entt, instance); (update(instance, member), ...); restore(entt); - reg->template emplace_or_replace(map(entt), std::move(instance)); + reg->template emplace_or_replace(map(entt), std::move(instance)); } } } @@ -469,14 +469,14 @@ public: * * @tparam Component Type of component to restore. * @tparam Archive Type of input archive. - * @tparam Type Types of components to update with local counterparts. + * @tparam Other Types of components to update with local counterparts. * @tparam Member Types of members to update with their local counterparts. * @param archive A valid reference to an input archive. * @param member Members to update with their local counterparts. * @return A non-const reference to this loader. */ - template - basic_continuous_loader &component(Archive &archive, Member Type::*...member) { + template + basic_continuous_loader &component(Archive &archive, Member Other::*...member) { (remove_if_exists(), ...); (assign(archive, member...), ...); return *this;