A virtual destructor is only useful for inheritance scenarios. STL containers are not designed to be inherited from (nor is it a supported scenario). Hence they don’t have virtual destructors.
More Related Contents:
- Does std::list::remove method call destructor of each removed element?
- stl::map assert [closed]
- How can I use std::maps with user-defined types as key?
- How to find if a given key exists in a C++ std::map
- How to get std::vector pointer to the raw data?
- Can standard container templates be instantiated with incomplete types?
- Sort list using STL sort function
- When is an object “out of scope”?
- How to declare a vector of atomic in C++
- Destructor being called twice when being explicitly invoked
- Why is “!=” used with iterators instead of “
- Cleaning up an STL list/vector of pointers
- Reverse map lookup
- Efficiency of the STL priority_queue
- use std::fill to populate vector with increasing numbers
- What is the default hash function used in C++ std::unordered_map?
- Can we use a user defined class for the key in a STL map?
- How is it possible (if it is) to implement shared_ptr without requiring polymorphic classes to have virtual destructor?
- What happens when you call data() on a std::vector?
- STL analogue in Fortran
- How to use the priority queue STL for objects?
- std::vector reserve() and push_back() is faster than resize() and array index, why?
- std::mutex performance compared to win32 CRITICAL_SECTION
- Vector Iterators Incompatible
- Should you overload swap in the std namespace?
- Why can’t I replace std::map with std::unordered_map
- Missing C++ header after updating OSX Command Line Tools 6.3
- What’s the time complexity of iterating through a std::set/std::map?
- const auto std::initializer_list difference between Clang and GCC
- What C++ pitfalls should I avoid? [closed]