Pointer Elements & STL Containers :: STL

Started by
1 comment, last by kuphryn 21 years, 6 months ago
Hi. Do delete STL functions such as remove() and erase() calls a class destructor if the element is a pointer to an object? For example, consider a vector of pointers to ClassX objects and a list of pointers to ClassX objects.. ----- std::vector sTextVec; ClassX *pCX; sTextVec.push_back(pCX); ... // Now you need to deallocate memory from pText. // Do functions such as remove() and erase() call ClassX // destructor, or do you have to delete them explicitly? ----- Thanks, Kuphryn
Advertisement
They don''t - didn''t you ask this question about a month or two ago?
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Okay. Thanks.

No. In my limited programming experience, I have never stored pointers in an STL container.

Kuphryn

This topic is closed to new replies.

Advertisement