Commit 8ddf70c5 authored by Georg Schaefer's avatar Georg Schaefer
Browse files

extend component helper to work with all containers

parent f5785032
......@@ -4,11 +4,11 @@
#include <vector>
namespace gdw {
template <typename t>
void remove_component(std::vector<t*>& v, t* component) {
auto it = std::find(v.begin(), v.end(), component);
if (it != v.end()) {
v.erase(it);
template <typename container, typename t>
void remove_component(container& c, t* component) {
auto it = std::find(c.begin(), c.end(), component);
if (it != c.end()) {
c.erase(it);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment