#pragma once #include "Error.h" //A class that has an initialization lock so that when the lock is activated, any further gets that are missing items in it will report themselves for easier debugging detection. template class safemap{ std::mapmap; bool initialized=false; public: O&operator[](T key){ if(initialized&&map.count(key)==0){ ERR("WARNING! Trying to get non-existent key "<::iterator it){ return map.erase(it); } auto erase_if(std::function)>lambda){ return std::erase_if(map,lambda); } }; //A class that has an initialization lock so that when the lock is activated, any further gets that are missing items in it will report themselves for easier debugging detection. //This unordered map should return items inserted in order. Therefore internally, it's hosted as a vector. As such, if an item is added to this map it's possible the refernce becomes stale when another item is added due to a vector expanding. BEWARE! template class safeunorderedmap{ std::unordered_mapmap; std::vectoritems; bool initialized=false; public: O&operator[](T key){ if(initialized&&map.count(key)==0){ ERR("WARNING! Trying to get non-existent key "<