I\'m accustomed to the existing interface of std::map
.
Inserting elements returns a bool describing successful insertion,
as well the iterator as to where t
It's not just std::map
, similar functions have been added to all associative and unordered associative containers. They are explained in the standard in [container.node]/1
A node handle is an object that accepts ownership of a single element from an associative container (23.2.4) or an unordered associative container (23.2.5). It may be used to transfer that ownership to another container with compatible nodes. Containers with compatible nodes have the same node handle type. ...
The table following the section above shows the containers with compatible nodes.
What the node handle interface allows you to do is transfer elements (nodes) from one container to another (compatible) container without having to copy/move the elements. Instead, the individual internal nodes maintained by the container are transferred as a whole.
This becomes necessary when dealing with a container that contains a non-copyable, non-moveable type.