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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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