[Cs3] deallocation of elements in a container

Mikhail Nesterenko mikhail at cs.kent.edu
Tue Nov 28 22:15:56 EST 2023


CS3 students,

There was a question in the lecture today about the order of the
element deallocation in a vector. The behavior is
unspecified. Unspecified means that it can be implemented any
possible way and the implementation should not even describe how:

  https://eel.is/c++draft/defns.unspecified

Here is the answer from stackoverflow:

   https://stackoverflow.com/questions/2083603/stl-containers-element-destruction-order

Thanks,
-- 
Mikhail


More information about the cs3 mailing list