diff --git a/libs/util/include/psemek/util/ecs.hpp b/libs/util/include/psemek/util/ecs.hpp index ba82cabc..3752fe7b 100644 --- a/libs/util/include/psemek/util/ecs.hpp +++ b/libs/util/include/psemek/util/ecs.hpp @@ -304,9 +304,10 @@ namespace psemek::util struct species_impl_base : species_base { - species_impl_base(ecs * ecs, std::string name, species_handle id, Components && ... components) + template + species_impl_base(ecs * ecs, std::string name, species_handle id, Args && ... components) : species_base(ecs, std::move(name), id) - , species_components_{std::move(components)...} + , species_components_{std::forward(components)...} {} using species_base::get_species_component; @@ -720,9 +721,9 @@ namespace psemek::util { species_handle result{species_.size()}; if (p == policy::sparse) - species_.push_back(std::make_unique>(this, std::move(name), result.value, std::move(components)...)); + species_.push_back(std::make_unique...>>(this, std::move(name), result.value, std::forward(components)...)); else - species_.push_back(std::make_unique>(this, std::move(name), result.value, std::move(components)...)); + species_.push_back(std::make_unique...>>(this, std::move(name), result.value, std::forward(components)...)); for (auto const & ctor : species_constructors_) ctor(result); return result;