#pragma once #include #include namespace GUIStuff { struct GUIManagerID { GUIManagerID() = default; GUIManagerID(int64_t numID); GUIManagerID(const std::string& strID); bool operator==(const GUIManagerID& other) const; bool idIsStr; std::string idStr; int64_t idNum = 0; }; typedef std::vector GUIManagerIDStack; } template <> struct std::hash { size_t operator()(const GUIStuff::GUIManagerID& v) const { if(v.idIsStr) return std::hash{}(v.idStr); else return std::hash{}(v.idNum); } }; template <> struct std::hash { size_t operator()(const GUIStuff::GUIManagerIDStack& v) const { uint64_t h = 0; for(const auto& i : v) hash_combine(h, i); return h; } };