15 lines
329 B
C
Raw Normal View History

2023-10-16 17:15:10 -05:00
#pragma once
#include "olcPixelGameEngine.h"
template<typename T,typename O>
class safemap{
static bool initializeCompleted;
std::map<T,O>map;
public:
O&operator[](T key){
if(initializeCompleted&&map.count(key)==0){
std::cout<<"WARNING! Trying to get non-existent key "<<key<<"!"<<std::endl;
}
return map[key];
}
};