Namespaces
Variants
Views
Actions

Difference between revisions of "Template:cpp/container/destructor"

From cppreference.com
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}}
{{dcl begin}}
+
{{ddcl|since={{cpp/std|{{{1|unordered_set}}}}}|notes={{#ifeq:{{{1|}}}|vector|{{mark constexpr since c++20}}}}|
{{#ifeq:{{{1}}}|vector|
+
{{dcl rev multi
+
|until1=c++20|dcl1=
+
 
~{{{1}}}();
 
~{{{1}}}();
|dcl2=
 
constexpr ~{{{1}}}();
 
 
}}
 
}}
|
 
{{dcl|since={{cpp/std|{{{1|}}}}}|
 
~{{{1}}}();
 
}}
 
}}
 
{{dcl end}}
 
  
 
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}}}.