C++ Standard Library C++ STL Library

C++ unordered_map - ~unordered_map() Function



The C++ unordered_map::~unordered_map function is used to destroy the unordered_map. The destructors of the elements are called and the used storage is deallocated.

The allocator_traits::destroy is called on each element of the unordered_map and the storage capacity of unordered_map is deallocated using its allocator.

Note:: If the elements of the unordered_map are pointers, the pointed-to objects are not destroyed.

Syntax

~unordered_map();

Parameters

No parameter is required.

Return Value

None.

Time Complexity

Linear i.e, Θ(n).

Exceptions

Never throws exceptions.


❮ C++ <unordered_map> Library