For the new C++17 std::unordered_map::extract
function the documentation says:
Extracting a node invalidates only the iterators to the extracted element, and preserves the relative order of the elements that are not erased. Pointers and references to the extracted element remain valid, but cannot be used while element is owned by a node handle: they become usable if the element is inserted into a container.
Naturally, extract
invalidates iterator of the extracted (which is a thing of the container, from which the element was removed). But the documentation is funky about references and pointers - it says these remain valid but cannot be used until re-inserted into (possibly another) container - case in which they will have retained their values (?).
Question: My use case is to examine an element after extracting, i.e. do an erase-examine-discardForGood operation with only one hash lookup. The extract
function seemed perfectly suited for this however documentation suggests I can't use node_type
to examine the element. Is my understanding correct?