|
|
@@ -71,10 +71,9 @@ class basic_registry {
|
|
|
template<typename... Args>
|
|
|
decltype(auto) assign(basic_registry ®istry, const Entity entt, Args &&... args) {
|
|
|
if constexpr(std::is_empty_v<Component>) {
|
|
|
- Component component{std::forward<Args>(args)...};
|
|
|
storage<Entity, Component>::construct(entt);
|
|
|
- construction.publish(entt, registry, std::as_const(component));
|
|
|
- return component;
|
|
|
+ construction.publish(entt, registry, Component{std::forward<Args>(args)...});
|
|
|
+ return Component{};
|
|
|
} else {
|
|
|
auto &component = storage<Entity, Component>::construct(entt, std::forward<Args>(args)...);
|
|
|
construction.publish(entt, registry, component);
|