...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::unordered::node_handle_map —
An object that owns a single element extracted from an
unordered_map or an
unordered_multimap, that
can then be inserted into a compatible container type.
The name and template parameters of this type are implementation
defined, and should be obtained using the node_type
member typedef from the appropriate container.
// In header: <boost/unordered_map.hpp> template<typename ImplementationDefined> class node_handle_map { public: // types typedef typename Container::key_type key_type; typedef typename Container::mapped_type mapped_type; typedef typename Container::allocator_type> allocator_type; // construct/copy/destruct constexpr node_handle_map() noexcept; node_handle_map(node_handle_map &&) noexcept; ~node_handle_map(); node_handle_map& operator=(node_handle_map&&); key_type& key() const; mapped_type& mapped() const; allocator_type get_allocator() const; explicit operator bool() const noexcept; bool empty() const noexcept; void swap(node_handle_map&) noexcept(ator_traits::propagate_on_container_swap::value); }; // swap template<typename ImplementationDefined> void swap(node_handle_map<ImplementationDefined>&, node_handle_map<ImplementationDefined>&);
node_handle_map& operator=(node_handle_map&&);
key_type& key() const;
mapped_type& mapped() const;
allocator_type get_allocator() const;
explicit operator bool() const noexcept;
bool empty() const noexcept;
void swap(node_handle_map&) noexcept(ator_traits::propagate_on_container_swap::value);
Notes: |
In C++17 is also |