I would like to use pointers to resources stored in an std::map as handles to the resource but for this to work the std::map cannot move any of its contained elements due to insertion/deletion from the map. For example:
class Resource { ... }
std::map<std::string, Resource> resources;
resources["one"] = Resource( ... );
Resource *handle = &resources["one"];
resources["two"] = Resource( ... );
handle->doSomething(); // Is handle guaranteed to still point to the same resource?
I cannot find any documentation that states whether elements can be moved or not, std::map can contain an uncopyable and unmovable type however I want to be sure this isn't some intended adaption to such a type.