C++ unordered_set - ~unordered_set() Function
The C++ unordered_set::~unordered_set function is used to destroy the unordered_set. 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_set and the storage capacity of unordered_set is deallocated using its allocator.
Note:: If the elements of the unordered_set are pointers, the pointed-to objects are not destroyed.
Syntax
~unordered_set();
Parameters
No parameter is required.
Return Value
None.
Time Complexity
Linear i.e, Θ(n).
Exceptions
Never throws exceptions.
❮ C++ <unordered_set> Library