diff options
author | Max-001 <80035972+Max-001@users.noreply.github.com> | 2024-10-03 15:22:38 +0200 |
---|---|---|
committer | Max-001 <80035972+Max-001@users.noreply.github.com> | 2024-10-03 15:22:38 +0200 |
commit | 03b25facdf35117eb9f56c7a2edbec5b34b90203 (patch) | |
tree | 55515da204a3c700a73dfa2f598176bcd3c91892 /mwe/ecs-homemade/inc/ComponentManager.hpp | |
parent | 23ce7028e76cbbce6c104f3f3e58758d46f6a500 (diff) |
Replace push_back with emplace_back
Diffstat (limited to 'mwe/ecs-homemade/inc/ComponentManager.hpp')
-rw-r--r-- | mwe/ecs-homemade/inc/ComponentManager.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mwe/ecs-homemade/inc/ComponentManager.hpp b/mwe/ecs-homemade/inc/ComponentManager.hpp index 75b2ab1..53dfddd 100644 --- a/mwe/ecs-homemade/inc/ComponentManager.hpp +++ b/mwe/ecs-homemade/inc/ComponentManager.hpp @@ -76,7 +76,7 @@ std::vector<std::pair<std::reference_wrapper<T>, std::uint32_t>> ComponentManage T* castedComponent = static_cast<T*>(componentPtr.get()); //Cast the unique_ptr to a raw pointer if (castedComponent) { //Ensure that the cast was successful - componentVector.push_back(std::make_pair(std::ref(*castedComponent), id)); //Pair the dereferenced raw pointer and the id and add it to the vector<> + componentVector.emplace_back(std::ref(*castedComponent), id); //Pair the dereferenced raw pointer and the id and add it to the vector<> } } |