[container.node.overview]

A node handle is an object that accepts ownership of a single element from an associative container ([associative.reqmts]) or an unordered associative container ([unord.req]).

It may be used to transfer that ownership to another container with compatible nodes.

Containers with compatible nodes have the same node handle type.

Elements may be transferred in either direction between container types in the same row of Table 75.

Table 75 — Container types with compatible nodes [tab:container.node.compat]

map<K, T, C1, A>

map<K, T, C2, A>

map<K, T, C1, A>

multimap<K, T, C2, A>

set<K, C1, A>

set<K, C2, A>

set<K, C1, A>

multiset<K, C2, A>

unordered_map<K, T, H1, E1, A>

unordered_map<K, T, H2, E2, A>

unordered_map<K, T, H1, E1, A>

unordered_multimap<K, T, H2, E2, A>

unordered_set<K, H1, E1, A>

unordered_set<K, H2, E2, A>

unordered_set<K, H1, E1, A>

unordered_multiset<K, H2, E2, A>

If a node handle is not empty, then it contains an allocator that is equal to the allocator of the container when the element was extracted.

If a node handle is empty, it contains no allocator.

If a user-defined specialization of pair exists for pair<const Key, T> or pair<Key, T>, where Key is the container's key_type and T is the container's mapped_type, the behavior of operations involving node handles is undefined.

template<unspecified> class node-handle { public: using value_type = see below; using key_type = see below; using mapped_type = see below; using allocator_type = see below; private: using container-node-type = unspecified; using ator-traits = allocator_traits<allocator_type>; typename ator-traits::template rebind_traits<container-node-type>::pointer ptr_; optional<allocator_type> alloc_; public: constexpr node-handle() noexcept : ptr_(), alloc_() {} constexpr node-handle(node-handle&&) noexcept; constexpr node-handle& operator=(node-handle&&); constexpr ~node-handle(); constexpr value_type& value() const; key_type& key() const; constexpr mapped_type& mapped() const; constexpr allocator_type get_allocator() const; constexpr explicit operator bool() const noexcept; constexpr bool empty() const noexcept; constexpr void swap(node-handle&) noexcept(ator-traits::propagate_on_container_swap::value || ator-traits::is_always_equal::value); friend constexpr void swap(node-handle& x, node-handle& y) noexcept(noexcept(x.swap(y))) { x.swap(y); } };