#include "globals.h" // Variables definitions std::map G_vars; // Functions addresses std::multimap G_funcs; // List of objects to save std::list G_tosave; // List of objects to print std::list G_toprint; void ClearGlobals() { for(auto& it:G_vars) delete it.second; for(auto& it:G_tosave) delete it; for(auto& it:G_toprint) delete it; G_vars.clear(); G_tosave.clear(); G_toprint.clear(); } void RegisterFunction(const std::string& name, Func func) { G_funcs.emplace(name,func); }