improve resouce iteration

This commit is contained in:
Green Sky 2022-04-12 16:44:28 +02:00
parent a98098af91
commit ab169927fe

View File

@ -85,7 +85,8 @@ class ResourceManager {
discard(entt::hashed_string{id}.value());
}
void each(std::function<void(res_id_type, std::shared_ptr<Resource>)>& fn) {
template<typename FN>
void each(FN&& fn) {
for (auto& it : _storage) {
fn(it.first, it.second);
}