Alternative for quad-nested unordered_map monstrosity?
问题 I've been trying out to figure an effective way to store and retrieve a number of objects. Let me explain what I'm trying to achieve, then list the options I've come up with ( But am unhappy with ). The following technically does what I need it to do, but is an obvious no-no: std::unordered_map<uint32_t, std::unordered_map<uint32_t, std::unordered_map<uint32_t, std::unordered_map<uint32_t, Component*>>>> //Scene -> Layer -> Type -> Id -> Component* The most inner map holds the Components