Reputation: 84822
Does ISO C++ standard mandate any sort of destruction order of objects inside STL containers?
std::list
/std::vector
/std::map
elements destroyed starting from the beginning or the end of the container?std::map
storing its elements in std::pair
s internally so a key in a pair is destroyed before its value (or vice versa)?Upvotes: 29
Views: 2923
Reputation:
Upvotes: 25
Reputation: 11981
Upvotes: 5