#pragma once #include namespace anm2ed::util::map { template int next_id_get(std::map& map) { int id = 0; for (auto& [key, value] : map) { if (key != id) break; ++id; } return id; } template T1* find(std::map& map, T0 index) { return map.contains(index) ? &map[index] : nullptr; } }