registry: suppress warnings on ::replace for empty components (close #407, close #408)

This commit is contained in:
Michele Caini
2020-02-08 15:50:16 +01:00
parent a4d576bae8
commit 3aef00af18

View File

@@ -99,7 +99,7 @@ class basic_registry {
}
template<typename... Args>
decltype(auto) replace(basic_registry &owner, const Entity entt, Args &&... args) {
auto replace(basic_registry &owner, const Entity entt, Args &&... args) -> decltype(this->get(entt)) {
Component component{std::forward<Args>(args)...};
update.publish(owner, entt, component);
return (this->get(entt) = std::move(component));