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

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

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

c++ - Convert big endian to little endian when reading from a binary file -