From 3fe7400de095756362b999908fd2a2ba3b71a848 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 5 Nov 2024 18:48:46 +0100 Subject: merge #18 --- src/crepe/ComponentManager.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/crepe/ComponentManager.hpp') diff --git a/src/crepe/ComponentManager.hpp b/src/crepe/ComponentManager.hpp index f469d12..e74f2e9 100644 --- a/src/crepe/ComponentManager.hpp +++ b/src/crepe/ComponentManager.hpp @@ -36,12 +36,13 @@ T & ComponentManager::add_component(uint32_t id, Args &&... args) { // Check if the vector size is not greater than get_instances_max if (instance->get_instances_max() != -1 && components[type][id].size() >= instance->get_instances_max()) { + // TODO: Exception throw std::runtime_error( "Exceeded maximum number of instances for this component type"); } // store its unique_ptr in the vector<> - components[type][id].push_back(move(instance)); + components[type][id].push_back(std::move(instance)); return *instance; } -- cgit v1.2.3