Hi,
Can any one give some idea whether the call to list::pop_front invokes destructor or not. As per definition given for list::pop_front on cplusplus.com site
If you have a list of pointers-to-something then keep in mind that what is being destroyed is the pointer, which is not the same thing as destroying the object.
So to give a counterexample using Bazzy's code,
1 2 3 4 5 6 7 8
struct S
{
~S() { cout << "Destructor Called"; }
};
list<S*> li;
li.push_back( new S );
li.pop_front();
In this case ~S is NOT called, because what is being destroyed is an S*, not an S.