C++ Standard Library C++ STL Library

C++ <forward_list> - ~forward_list() Function



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

C++98: The forward_list is destroyed and the storage capacity of forward_list is deallocated using its allocator.

C++11: The allocator_traits::destroy is called on each element of the forward_list and the storage capacity of forward_list is deallocated using its allocator.

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

Syntax

~forward_list();

Parameters

No parameter is required.

Return Value

None.

Time Complexity

Linear i.e, Θ(n).

Exceptions

Never throws exceptions.


❮ C++ <forward_list> Library