Difference between revisions of "Template:cpp/container/destructor"
From cppreference.com
Andreas Krug (Talk | contribs) m (fmt) |
m (simplified.) |
||
Line 1: | Line 1: | ||
{{cpp/container/{{{1|}}}/title|~{{{1}}}}} | {{cpp/container/{{{1|}}}/title|~{{{1}}}}} | ||
{{cpp/container/{{{1|}}}/navbar}} | {{cpp/container/{{{1|}}}/navbar}} | ||
− | {{ | + | {{ddcl|since={{cpp/std|{{{1|unordered_set}}}}}|notes={{#ifeq:{{{1|}}}|vector|{{mark constexpr since c++20}}}}| |
− | {{#ifeq:{{{1}}}|vector| | + | |
− | {{ | + | |
− | + | ||
~{{{1}}}(); | ~{{{1}}}(); | ||
− | |||
− | |||
}} | }} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Destructs the {{tt|{{{1}}}}}. The destructors of the elements are called and the used storage is deallocated. Note, that if the elements are pointers, the pointed-to objects are not destroyed. | Destructs the {{tt|{{{1}}}}}. The destructors of the elements are called and the used storage is deallocated. Note, that if the elements are pointers, the pointed-to objects are not destroyed. |
Revision as of 11:18, 6 December 2023
~{{{1}}}(); |
(since C++11) | |
Destructs the {{{1}}}
. The destructors of the elements are called and the used storage is deallocated. Note, that if the elements are pointers, the pointed-to objects are not destroyed.
Complexity
Linear in the size of the {{{1}}}
.