I have some complicated C++ code but the problem narrows down to doing a push_back
on a list of structures:
list<cache_page> cachedPages;
void f()
{
cache_page cpage(a,b);
cachedPages.push_back(cpage);
}
I have commented all the data members of the struct cache_page
and still the error persists. If I comment the push_back
line, there is no error.
What could be the reason?
I have tried using GDB and the error occurs in _List_Node_base::hook()
function.
template < class T >
class A
{
T x;
public:
void func()
{
x->f();
}
};
class B : public A < B* >
{
list<cache_page> cachedPages;
public:
void f()
{
cache_page cpage;
cachedPages.push_back(cpage);
}
};
I have a do nothing copy constructor. I have no data members in cache_page.