How stl containers destroy objects

How does stl call object destructors, like in std :: vector :: erase or std :: vector :: pop_back?

+5
source share
2 answers

Perhaps some additions to Steve answer:

Indeed, internal distribution is performed by distributors that fulfill two separate goals: allocating and freeing memory, and building and destroying objects. Objects always (copy or move) built on insertand destroyed on erase, however, interns change.

Based containers

Node, , node, , (, next/prev ). , .

, , ; , , , ( ), , .

new/delete, , .

+4

vector , , destroy .

, , .

, , IDE.

+6

All Articles