How to know if a std::list has been modified
- by Nick
I have this class:
class C
{
public:
C* parent;
std::list<C> children;
};
I can use this class in this way for example:
C root;
C child;
root.children.push_back(child); // or other method of std::list (es: push_front, insert, ...)
// Here child.parent is root
// How can I set the parent of child?
I want to do this work internally to my class without losing the functionality of std::list, is it possible?