c++ - STL containers element destruction order -


does iso c++ standard mandate sort of destruction order of objects inside stl containers?

  • are std::list/std::vector/std::map elements destroyed starting beginning or end of container?
  • can rely on std::map storing elements in std::pairs internally key in pair destroyed before value (or vice versa)?

  1. unspecified in standard.
  2. yes, means key destroyed after associated value.

Comments

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c# - Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text) -